Your IP : 18.221.157.203


Current Path : /opt/alt/python312/lib64/python3.12/venv/__pycache__/
Upload File :
Current File : //opt/alt/python312/lib64/python3.12/venv/__pycache__/__init__.cpython-312.opt-2.pyc

�

�Q�f�c��(�	ddlZddlZddlZddlZddlZddlZddlZdZeje	�Z
Gd�d�Z		dd�Zdd�Z
e	dk(rdZ	e
�dZej&e�yy#e$r!Zed	ezej$�
�YdZ[�5dZ[wwxYw)
�N)�pipc��eZdZ				dd�Zd�Zd�Zd�Zed��Zd�Z	d�Z
ejd	k7rdd
�Z
ndd�Z
d�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zy)�
EnvBuilderNc���||_||_||_||_||_||_|dk(r1tjjt
j��}||_
||_y)N�.)�system_site_packages�clear�symlinks�upgrade�with_pip�orig_prompt�os�path�basename�getcwd�prompt�upgrade_deps)�selfrr	r
rrrrs        �4/opt/alt/python312/lib64/python3.12/venv/__init__.py�__init__zEnvBuilder.__init__.s`��%9��!���
� ��
���� ��
�!����S�=��W�W�%�%�b�i�i�k�2�F����(���c���	tjj|�}|j|�}|j}d|_|j|�|j
|�|jr|j|�|js"|j|�|j|�|rd|_|j|�|jr|j|�yy)NFT)rr�abspath�ensure_directoriesr�create_configuration�setup_pythonr�
_setup_pipr�
setup_scripts�
post_setupr�upgrade_dependencies)r�env_dir�context�true_system_site_packagess    r�createzEnvBuilder.create<s���	��'�'�/�/�'�*���)�)�'�2��%)�$=�$=�!�$)��!��!�!�'�*����'�"��=�=��O�O�G�$��|�|����w�'��O�O�G�$�$�)-�D�%��%�%�g�.�����%�%�g�.�rc��tj|�D]�}tjj||�}tjj	|�stjj|�rtj|��wtjj|�s��tj|���y�N)
r�listdirr�join�islink�isfile�remove�isdir�shutil�rmtree)rr�fns   r�clear_directoryzEnvBuilder.clear_directoryXso���*�*�T�"�B������d�B�'�B��w�w�~�~�b�!�R�W�W�^�^�B�%7��	�	�"�
������r�"��
�
�b�!�#rc�@�||||d�}tj|d|��S)N)�base�platbase�installed_base�installed_platbase�venv)�scheme�vars)�	sysconfig�get_path)rr!�namer8s    r�
_venv_pathzEnvBuilder._venv_path`s,����%�")�	
���!�!�$�v�D�A�Arc��	tjdk(r�tjj	|�tjj	|�k(ryddl}	|j
tj|��}	|j
tj|��}tjj	|�tjj	|�k(ryy||k(S#t$rY�vwxYw#t$rY�`wxYw)N�win32TrF)	�sys�platformrr�normcase�_winapi�GetLongPathName�fsdecode�OSError)�cls�path1�path2rBs    r�
_same_pathzEnvBuilder._same_pathis���	��<�<�7�"��w�w����&�"�'�'�*:�*:�5�*A�A���
��/�/����E�0B�C��
��/�/����E�0B�C���w�w����&�"�'�'�*:�*:�5�*A�A����E�>�!���
��
���
��
�s$�$C)�?$C8�)	C5�4C5�8	D�Dc�z�	d�}tjtj|�vr td|�dtj�d���tjj|�r|jr|j|�tj�}||_
tjj|�d|_|j�|jn|j}d|z|_
||�tj}|std��tjjtjj!|��\}}||_||_||_|j)|d�}|j)|d	�}	|j)|d
�}
|	|_||	�|
|_||
�tj.dkDr{tj0dk(rhtj2d
k7rUtjj5|d�}tjj|�stj6d|�||_tjj;||�|_tjj5||�|_||�|j>|_ tj2dk(rmtjjC|j>�}|jE||j>�s(tFjId|j>|�||_ |S)Nc��tjj|�stj|�ytjj	|�stjj|�rt
d|z��y)NzUnable to create directory %r)rr�exists�makedirsr)r*�
ValueError)�ds r�create_if_neededz7EnvBuilder.ensure_directories.<locals>.create_if_needed�sR���7�7�>�>�!�$����A��������"�b�g�g�n�n�Q�&7� �!@�1�!D�E�E�'8rzRefusing to create a venv in z( because it contains the PATH separator r�z(%s) z�Unable to determine path to the running Python interpreter. Provide an explicit path or check that your PATH environment variable is correctly set.�scripts�include�purelibl�posix�darwin�lib64�libr>z�Actual environment location may have moved due to redirects, links or junctions.
  Requested location: "%s"
  Actual location:    "%s")%r�pathsep�fspathrNrrLr	r0�types�SimpleNamespacer!�split�env_namerr?�_base_executabler�
executable�
python_dir�
python_exer<�inc_path�lib_path�maxsizer;r@r(�symlink�bin_path�relpath�bin_name�env_exe�env_exec_cmd�realpathrI�logger�warning)
rr!rPr"rr`�dirname�exename�binpath�incpath�libpath�	link_path�real_env_exes
             rrzEnvBuilder.ensure_directories�s���	�	F��:�:����7�+�+��<�W�I�F?�?A�z�z�l�!�M�N�
N�
�7�7�>�>�'�"�t�z�z�� � ��)��'�'�)��!����7�7�=�=��1�!�4��� $��� 7����W�=M�=M�� �6�)�����!��)�)�
���.�/�
/��7�7�=�=�������)D�E����'���$���$����/�/�'�9�5���/�/�'�9�5���/�/�'�9�5��"�����!�"�����!�
�[�[�5�
 �r�w�w�'�'9�
�\�\�X�
%������W�g�6�I��7�7�>�>�)�,��
�
�5�)�,�"����7�7�?�?�7�G�<����'�'�,�,�w��8�����!� '������<�<�7�"��7�7�+�+�G�O�O�<�L��?�?�<����A���� <� '����	>�
(4��$��rc��	tjj|jd�x|_}t|dd��5}|j
d|jz�|jrd}nd}|j
d|z�|j
d	tjdd
z�|j�|j
d|j�d��|j
d
tjjtj�z�g}tjdk(}|r|jr|j!d�|s|js|j!d�|j"s|j!d�|jr|j!d�|j$r|j!d�|j&r|j!d�|j(r|j!d�|j*�|j!d|j*�d��|j!|j�dj|�}|j
dtj�d|�d��ddd�y#1swYyxYw)Nz
pyvenv.cfg�w�utf-8)�encodingz
home = %s
�true�falsez"include-system-site-packages = %s
zversion = %d.%d.%d
�z	prompt = �
zexecutable = %s
�nt�
--symlinks�--copies�
--without-pip�--system-site-packages�--clear�	--upgrade�--upgrade-depsz
--prompt="�"� z
command = z	 -m venv )rrr(r!�cfg_path�open�writerarr?�version_inforrlr`r;r
�appendrr	rrr
)rr"r�f�incl�argsr~s       rrzEnvBuilder.create_configuration�s���	�#%�'�'�,�,�w����"M�M���4�
�$��g�
.�!�
�G�G�M�G�$6�$6�6�7��(�(�����
�G�G�9�D�@�A�
�G�G�*�S�-=�-=�b�q�-A�A�B��{�{�&����)�D�K�K�?�"�5�6�
�G�G�'�"�'�'�*:�*:�3�>�>�*J�J�K��D����D��B��d�m�m����L�)��d�m�m����J�'��=�=����O�,��(�(����4�5��z�z����I�&��|�|����K�(�� � ����,�-����+����j��)9�)9�(:�!�<�=��K�K����(��8�8�D�>�D�
�G�G�j���� 0�	�$��r�B�C�A/�
.�
.�s
�H4I>�>Jr~c�~�	|j}|sl	tjj|�sL|r4tjtjj|�|�ntj||�|rtj||�yy#t$rtjd||�d}Y�>wxYw)N�Unable to symlink %r to %rT)r
rrr)rfr�	Exceptionrmrnr-�copyfile)r�src�dst�relative_symlinks_ok�
force_copys     r�symlink_or_copyzEnvBuilder.symlink_or_copy�s���
�"�]�]�*�J��	&��7�7�>�>�#�.�/��J�J�r�w�w�'7�'7��'<�c�B��J�J�s�C�0������S�)���!�&��N�N�#?��c�J�!%�J�&�s�A+B�"B<�;B<c��	tjj|�xr tjj|�}|jro|smtjj|�sN	|r4tjtjj|�|�ytj||�ytjjtjj|��\}}tjjtjjt�dd||z�}tj �stjj#|�sk|j%d�r
d|z}|dd}|dk(rd}n|dk(rd	}tjjtjj|�||z�}n|}tjj|�s|stjd
|�yt'j(||�y#t$rtjd||�Y���wxYw)Nr�rRr~�_d����python�venvlauncher�pythonw�
venvwlauncherzUnable to copy %r)rr�lexistsrLr
r)rfrr�rmrn�splitextr(ro�__file__r9�is_python_buildr*�endswithr-r�)rr�r�r��bad_srcr�ext�srcfns        rr�zEnvBuilder.symlink_or_copy	s���
��g�g�o�o�c�*�F�2�7�7�>�>�#�3F�/F�G��}�}�W�R�W�W�^�^�C�5H�K�+��
�
�2�7�7�#3�#3�C�#8�#�>���
�
�3��,���G�G�,�,�R�W�W�-=�-=�c�-B�C�M�H�c��G�G�L�L�������!:�!*�!%�!)�C��1�E��(�(�*�"�'�'�.�.��2G��$�$�T�*���*�C�'���}�H��x�'�-�H���*�.�H��g�g�l�l�2�7�7�?�?�3�#7��C��H�����7�7�>�>�#�&���N�N�#6��<���O�O�C��%��9!�K��N�N�#?��c�J�K�s�15H2�'H2�2 I�Ic��	|j}|j}|j}|j}tj
dk7r�||j|�tjj|�st	j|d�dddtjd��fD]�}tjj||�}tjj|�r�C||j|d��tjj|�r�xt	j|d���y|jr�t	j|�D�cgc]E}tjj!tjj#|�d�d	vr|��G}}t%j&�r||D�cgc]2}tjj!|�j)d
�r|��4}}n>hd�}tjj+|j�}	|j-|	�|D]i}tjj||�}
tjj/|
�s�C||
tjj||���kt%j&��rt	j0|j�D]�\}}}
d|
vs�tjj+|�}tjj|j2d
|�}tjj|�st	j4|�tjj|d�}
tjj|d�}t7j8|
|�yyycc}wcc}w)Nr~i�r��python3zpython3.rQT)r�)�.exez.dll)r��	vcruntime>�
python.exe�pythonw.exe�python_d.exe�
pythonw_d.exezinit.tcl�Lib)rgrjr�rarr;r`rr)�chmodr?r�r(rLr
r'rAr�r9r��
startswithr�addr��walkr!rMr-r�)rr"rqr�copierro�suffixr��suffixes�base_exer��root�dirs�files�tcldirr�s                rrzEnvBuilder.setup_python4s���	��"�"�������%�%���$�$��
�7�7�d�?��7�%�%�t�,��7�7�>�>�$�'�����u�%�#�Y�(�3�;K�;K�A�;N�:O�0P�Q���w�w�|�|�G�V�4���w�w�~�~�d�+��7�?�?�D�t�L��7�7�>�>�$�/�����u�-�R��}�}� "�z�z�'�2��2�!��G�G�$�$�R�W�W�%5�%5�a�%8��%;�<�@P�P��2����,�,�.�#+� �#+�a����(�(��+�6�6�7N�O��8�� �
Z���7�7�+�+�G�O�O�<�����X�&�"���g�g�l�l�7�F�3���7�7�?�?�3�'��3������W�f� =�>�#�
�(�(�*�)+����1C�1C�)D�%�D�$��!�U�*�!#���!1�!1�$�!7��!#�����g�o�o�u�f�!M��!�w�w�~�~�f�5��K�K��/� �g�g�l�l�4��<�� �g�g�l�l�6�:�>������S�1��*E�+��'��
 s
�A
N=�>7Oc�8�	|jg|�}tjj�x|d<}|j|d<|jdd�|jdd�|j|d<|j|d<t
j|fi|��y)N�env�VIRTUAL_ENV�
PYTHONHOME�
PYTHONPATH�cwdr`)rkr�environ�copyr!�pop�
subprocess�check_output)rr"�py_args�kwargsr�r�s      r�_call_new_pythonzEnvBuilder._call_new_pythonqs���F�
�$�$�/�w�/�� �j�j�o�o�/�/��u�
��$�_�_��M������d�#�����d�#�����u�
�&�3�3��|������/��/rc�P�	|j|ddddtj��y)N�-m�	ensurepipr�z
--default-pip)�stderr)r�r��STDOUT�rr"s  rrzEnvBuilder._setup_pip�s,��?����g�t�[�+�-�j�6G�6G�	�	Irc���	tjjtjjt��}tjj|d�}|j
||�y)NrR)rrrror�r(�install_scripts)rr"rs   rrzEnvBuilder.setup_scripts�sL��		��w�w���r�w�w���x�8�9���w�w�|�|�D�)�,�����W�d�+rc��	yr&�r�s  rrzEnvBuilder.post_setup�s��	�	
rc� �	|jd|j�}|jd|j�}|jd|j�}|jd|j�}|jd|j
�}|S)N�__VENV_DIR__�
__VENV_NAME__�__VENV_PROMPT__�__VENV_BIN_NAME__�__VENV_PYTHON__)�replacer!r^rrirj)r�textr"s   r�replace_variableszEnvBuilder.replace_variables�sy��		��|�|�N�G�O�O�<���|�|�O�W�-=�-=�>���|�|�-�w�~�~�>���|�|�/��1A�1A�B���|�|�-�w���?���rc��	|j}t|�}tj|�D�]�\}}}||k(r1|ddD](}|dtjfvs�|j|��*�>|D�]�}	tjdk(r#|	j
d�r|	jd�r�:tjj||	�}
||djtj�dd}|s|}n tjj|g|���}tjj|�stj|�tjj||	�}
t|
d�5}	|	j�}ddd�|
jd�s5	j!d�}|j#||�}|j%d�}���gt|
d	�5}	|	j-|�ddd�t/j0|
|
�������y#1swY��xYw#t&$r#}d}t(j+d|
|�Yd}~�zd}~wwxYw#1swY�axYw)
N�commonr~r�)r�z.pdb��rbrxz+unable to copy script %r, may be binary: %s�wb)rg�lenrr�r;r+r�r�rr(r]�seprLrMr��read�decoder��encode�UnicodeErrorrmrnr�r-�copymode)rr"rrq�plenr�r�r�rOr��srcfiler��dstdir�dstfile�data�es                rr�zEnvBuilder.install_scripts�s���	��"�"���4�y��!#������D�$���t�|��a��A���2�7�7� 3�3����A��!�����G�G�t�O����X�(>��J�J�'7�8���'�'�,�,�t�Q�/���d�e��*�*�2�6�6�2�1�2�6���$�F��W�W�\�\�'�;�F�;�F��w�w�~�~�f�-��K�K��'��'�'�,�,�v�q�1���'�4�(�A��6�6�8�D�)��'�'�(8�9�H�#�{�{�7�3��#�5�5�d�G�D��#�{�{�7�3��
�#��g�t�,������
�-��O�O�G�W�5�7�
"/�&)�(��(�H�#�����(;�<C�Q�H�H��H��
-�,�s0�2H�4H$�!I�H!�$	I�-I�I�Ic��tjdt�d|j���|j|ddddgt���y)Nz
Upgrading z
 packages in r�r�installr�)rm�debug�CORE_VENV_DEPSrgr�r�s  rr zEnvBuilder.upgrade_dependencies�sJ�������(�
�g�6F�6F�5G�H�	
�	����g�t�U�I�{�	/�-�	/r)FFFFFNF)F)�__name__�
__module__�__qualname__rr$r0r<�classmethodrIrrrr;r�rr�rrrr�r�r r�rrrrs����2:?�GK�#�)�/�8"�B��"��"�4C�J*D�X
�w�w�$��	*�&)	&�V;�z
0�I�

,�
��$06�d/rrc�J�	t||||||��}|j|�y)N)rr	r
rrr)rr$)r!rr	r
rrr�builders        rr$r$�s-��6��.B�$�x�(� &�\�C�G��N�N�7�rc
��ddl}|jtdd��}|jdddd�	�|jd
ddd
d��tj
dk(rd}nd}|j
�}|jd|ddd��|jd|ddd��|jddddd��|jddddd��|jddddd �!�|jd"d#�$�|jd%ddd&d'd(jt��d)���|j|�}|jr|jrtd*��t|j|j|j|j|j |j"|j$�+�}|j&D]}|j)|��y),NrzFCreates virtual Python environments in one or more target directories.z|Once an environment has been created, you may wish to activate it, e.g. by sourcing an activate script in its bin directory.)�prog�description�epilogr��ENV_DIR�+z)A directory to create the environment in.)�metavar�nargs�helpr�F�
store_true�system_sitezDGive the virtual environment access to the system site-packages dir.)�default�action�destrr~Trr
z[Try to use symlinks rather than copies, when symlinks are not the default for the platform.r��store_falsez\Try to use copies rather than symlinks, even when symlinks are the default for the platform.r�r	zcDelete the contents of the environment directory if it already exists, before environment creation.r�rzlUpgrade the environment directory to use this version of Python, assuming Python has been upgraded in-place.r�rz]Skips installing or upgrading pip in the virtual environment (pip is bootstrapped by default))rrrrz--promptz;Provides an alternative prompt prefix for this environment.)rr�rzUpgrade core dependencies (z, z) to the latest version in PyPIz1you cannot supply --upgrade and --clear together.)rr	r
rrrr)�argparse�ArgumentParserr��add_argumentrr;�add_mutually_exclusive_groupr(r��
parse_argsrr	rNrrr
rrrr�r$)r�r	�parser�use_symlinks�group�optionsr�rOs        r�mainr�s#���
�
$�
$�(�2@�-D�%�	E�F�����	��H��J�
���0�%�+�-�9��:�
�w�w�$�������/�/�1�E�	���|�\�*��,��-�

���z�|�+;�+�*�,��-�
���	�5��$�,C��D�
����U�<�&�.K��L�
����j� $�]�+��,�
���
�1��2����(�%��+�:�4�9�9�^�;T�:U�V=�=��>�����%�G����7�=�=��L�M�M��g�.A�.A�&�}�}�")�"2�"2�!(���")�"2�"2� '���&-�&:�&:�
<�G��\�\�����q��r�__main__rQz	Error: %s)�file)FFFFNFr&)�loggingrr-r�r?r9r[r��	getLoggerr�rmrr$r�rcr�r��printr��exitr�rr�<module>rs�����	�
��
�����	��	�	�8�	$��S/�S/�l7<�EJ��C�L�z��	
�B�0���
��
�C�H�H�R�L���
�0�
�k�A�o�C�J�J�/�/��0�s�	A+�+B�0B�B

?>