HEX
Server: Apache
System: Linux zacp120.webway.host 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
User: govancoz (1003)
PHP: 8.3.26
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: //usr/lib/python3.9/site-packages/pip/_internal/operations/install/__pycache__/wheel.cpython-39.pyc
a

?�fNz�@sdZddlmZddlZddlZddlZddlZddlZddlZddl	Z
ddlZddlZddl
Z
ddlZddlmZddlmZmZddlmZddlmZddlmZdd	lmZdd
lmZmZmZm Z m!Z!m"Z"ddl#m$Z$m%Z%ddl&m'Z'dd
l(m)Z)ddl*m+Z+m,Z,ddl-m.Z.ddl/m0Z0m1Z1ddl2m3Z3m4Z4m5Z5m6Z6ddl7m8Z8ddl9m:Z:m;Z;m<Z<m=Z=ddl>m?Z?m@Z@e8�s�ddl7mAZAn�ddlBmCZCddlDmEZEmFZFmGZGmHZHmIZImJZJmKZKmLZLmMZMmNZNmOZOmPZPmQZQmRZRmAZAddlmSZSddlTmUZUddl-mVZVddl/mWZWeLde"�ZXeQeXeYeReZeYffZ[Gdd�deN�Z\e�]e^�Z_dJd d!�Z`d"d#�Zad$d%�Zbd&d'�Zcd(d)�Zdd*d+�Zed,d-�Zfd.d/�ZgdKd0d1�Zhd2d3�Zid4d5�Zjd6d7�ZkGd8d9�d9el�ZmGd:d;�d;el�ZnGd<d=�d=e'�Zod>d?�ZpGd@dA�dAe�ZqdLdDdE�ZrejsdFdG��ZtdMdHdI�ZudS)NzGSupport for installing and building the "wheel" binary package format.
�)�absolute_importN)�urlsafe_b64encode)�chain�starmap)�ZipFile)�
pkg_resources)�ScriptMaker)�get_export_entry)�PY2�
ensure_str�ensure_text�
itervalues�reraise�	text_type)�filterfalse�map)�InstallationError)�get_major_minor_version)�DIRECT_URL_METADATA_NAME�	DirectUrl)�SCHEME_KEYS)�adjacent_tmp_file�replace)�captured_stdout�
ensure_dir�	hash_file�	partition)�MYPY_CHECK_RUNNING)�
current_umask�is_within_directory�2set_extracted_file_to_default_mode_plus_executable�zip_item_is_executable)�parse_wheel�$pkg_resources_distribution_for_wheel)�cast)�Message)�Any�Callable�Dict�IO�Iterable�Iterator�List�NewType�Optional�Protocol�Sequence�Set�Tuple�Unionr$)�ZipInfo)�Distribution)�Scheme)�NamedTemporaryFileResult�
RecordPathc@s eZdZdZdZdZdd�ZdS)�FileNcCsdS�N���selfr;r;�J/usr/lib/python3.9/site-packages/pip/_internal/operations/install/wheel.py�save`sz	File.save)�__name__�
__module__�__qualname__�src_record_path�	dest_path�changedr?r;r;r;r>r9[sr9�cCs6t||�\}}dt|����d��d�}|t|�fS)z?Return (encoded_digest, length) for path using hashlib.sha256()zsha256=�latin1�=)rr�digest�decode�rstrip�str)�pathZ	blocksize�h�lengthrIr;r;r>�rehashhs���rPcCs"trdd�|�iS|ddd�SdS)zPReturn keyword arguments to properly open a CSV file
    in the given mode.
    �modez{}b��utf-8)rQ�newline�encodingN)r
�format)rQr;r;r>�
csv_io_kwargsssrWcCs�tj�|�sJ�t|d��^}|��}|�d�s>Wd�dStj�t�	��}d|tj
�d�}|��}Wd�n1s~0Yt|d��$}|�|�|�|�Wd�n1s�0YdS)	zQReplace #!python with #!/path/to/python
    Return True if file was changed.
    �rbs#!pythonNFs#!�ascii�wbT)
�osrM�isfile�open�readline�
startswith�sys�
executable�encode�getfilesystemencoding�linesep�read�write)rMZscript�	firstlineZexename�restr;r;r>�
fix_script~s
&
(ricCs|�dd���dkS)NzRoot-Is-PurelibrR�true)�get�lower)�metadatar;r;r>�wheel_root_is_purelib�srncsxz|�d�}|�d�}Wnty2iifYS0dd��t�fdd�|��D��}t�fdd�|��D��}||fS)NZconsole_scriptsZgui_scriptscSs&t|��dd��d�}|d|dfS)z[get the string representation of EntryPoint,
        remove space and split on '='
        � rRrHr�)rLr�split)�sZsplit_partsr;r;r>�	_split_ep�sz"get_entrypoints.<locals>._split_epc3s|]}�|�VqdSr:r;��.0�v�rsr;r>�	<genexpr>��z"get_entrypoints.<locals>.<genexpr>c3s|]}�|�VqdSr:r;rtrwr;r>rx�ry)Z
get_entry_map�KeyError�dict�values)�distribution�console�guir;rwr>�get_entrypoints�s
	r�c
s�|sdSt�t�}|D]*}tj�|�}tj�|�}||�|�qdd�tj�	dd��
tj�D����tj�
tj�tj����fdd�|��D�}|s�dSg}|��D]b\}}t|�}t|�dkr�d	�|d
�}	n$d�d�|dd
��d|d
�}	|�d�|	|��q�d}
t|�dk�r0|�|
�d��n|�|
�d��tdd�tj�	dd��
tj�D��}|�rxd}|�|�d�|�S)z�Determine if any scripts are not on PATH and format a warning.
    Returns a warning message if one or more scripts are not on PATH,
    otherwise None.
    NcSs g|]}tj�|��tj��qSr;)r[rM�normcaserK�sep�ru�ir;r;r>�
<listcomp>�sz5message_about_scripts_not_on_PATH.<locals>.<listcomp>�PATHrRcs&i|]\}}tj�|��vr||�qSr;)r[rMr�)ru�
parent_dir�scripts�Z
not_warn_dirsr;r>�
<dictcomp>�s�z5message_about_scripts_not_on_PATH.<locals>.<dictcomp>rpzscript {} isrzscripts {} are�, ���z and z.The {} installed in '{}' which is not on PATH.zeConsider adding {} to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.zthis directoryzthese directoriescss|]}|r|ddkVqdS)r�~Nr;r�r;r;r>rx�sz4message_about_scripts_not_on_PATH.<locals>.<genexpr>ziNOTE: The current PATH contains path(s) starting with `~`, which may not be expanded by all applications.�
)�collections�defaultdict�setr[rM�dirname�basename�add�environrkrq�pathsep�appendr�r`ra�items�sorted�lenrV�join�any)
r�Zgrouped_by_dir�destfiler�Zscript_nameZwarn_for�	msg_linesZdir_scriptsZsorted_scriptsZ
start_textZ
last_line_fmtZwarn_for_tildeZtilde_warning_msgr;r�r>�!message_about_scripts_not_on_PATH�sT
�
�������
r�cCstdd�|D��S)a�Normalize the given rows of a RECORD file.

    Items in each row are converted into str. Rows are then sorted to make
    the value more predictable for tests.

    Each row is a 3-tuple (path, hash, size) and corresponds to a record of
    a RECORD file (see PEP 376 and PEP 427 for details).  For the rows
    passed to this function, the size can be an integer as an int or string,
    or the empty string.
    css*|]"\}}}t|dd�|t|�fVqdS)rS�rUN)rrL)ru�record_pathZhash_�sizer;r;r>rxs�z&_normalized_outrows.<locals>.<genexpr>)r�)Zoutrowsr;r;r>�_normalized_outrows�s�r�cCs|Sr:r;)r�r;r;r>�_record_to_fs_pathsr�cCsX|dur>tj�|�d��tj�|�d��kr>tj�||�}|�tjjd�}td|�S)Nr�/r8)r[rM�
splitdriverl�relpathrr�r$)rM�relative_tor;r;r>�_fs_to_record_paths�r�cCst|dd�}td|�S)NrSr�r8)rr$)Z
record_column�pr;r;r>�_parse_record_path#sr�cCs�g}|D]�}t|�dkr$t�d|�t|d�}|�||�}||vrVtt|��\}	}
n0t|�dkrj|dnd}	t|�dkr�|dnd}
|�||	|
f�q|D]*}t||�}t|�\}	}
|�||	|
f�q�t	|�D]}
|�|
ddf�q�|S)z_
    :param installed: A map from archive RECORD path to installation RECORD
        path.
    �z,RECORD line has more than three elements: %srrprR�)
r��logger�warningr��poprPr�r�r�r
)Zold_csv_rows�	installedrE�	generated�lib_dirZinstalled_rows�rowZold_record_pathZnew_record_pathrIrO�frMZinstalled_record_pathr;r;r>�get_csv_rows_for_installed)s$
r�cCs|��}g}|�dd�}|r�dtjvr4|�d|�tj�dd�dkr^|�d�tjd|��|�d�t	�|��d	d
�|D�}|D]
}||=q�|�dd�}|r�dtjvr�|�d|�|�d
�t	�|��dd
�|D�}|D]
}||=q�|�
tdj|����|S)zk
    Given the mapping from entrypoint name to callable, return the relevant
    console script specs.
    ZpipNZENSUREPIP_OPTIONSzpip = rRZ
altinstallz
pip{} = {}rcSsg|]}t�d|�r|�qS)zpip(\d(\.\d)?)?$��re�match�ru�kr;r;r>r��ryz,get_console_script_specs.<locals>.<listcomp>Zeasy_installzeasy_install = zeasy_install-{} = {}cSsg|]}t�d|�r|�qS)zeasy_install(-\d\.\d)?$r�r�r;r;r>r��s�{} = {})
�copyr�r[r�r�rkrVr`�version_infor�extendrr�)r~�scripts_to_generateZ
pip_scriptZpip_epr�Zeasy_install_scriptZeasy_install_epr;r;r>�get_console_script_specsJsD#
��
����r�c@s$eZdZdd�Zdd�Zdd�ZdS)�
ZipBackedFilecCs||_||_||_d|_dS�NF)rCrD�	_zip_filerE)r=rCrD�zip_filer;r;r>�__init__�szZipBackedFile.__init__cCs&ts|j�|j�S|j�|j�d��S)NrS)r
r�ZgetinforCrbr<r;r;r>�_getinfo�szZipBackedFile._getinfoc	Cs�tj�|j�}t|�tj�|j�r0t�|j�|��}|j�	|��H}t	|jd��}t
�||�Wd�n1st0YWd�n1s�0Yt|�r�t
|j�dS)NrZ)r[rMr�rDr�exists�unlinkr�r�r]�shutilZcopyfileobjr!r )r=r�Zzipinfor��destr;r;r>r?�s
HzZipBackedFile.saveN)r@rArBr�r�r?r;r;r;r>r��s	r�c@seZdZdd�Zdd�ZdS)�
ScriptFilecCs$||_|jj|_|jj|_d|_dSr�)�_filerCrDrE)r=�filer;r;r>r��s

zScriptFile.__init__cCs|j��t|j�|_dSr:)r�r?rirDrEr<r;r;r>r?�s
zScriptFile.saveN)r@rArBr�r?r;r;r;r>r��sr�cseZdZ�fdd�Z�ZS)�MissingCallableSuffixcstt|��d�|��dS)Nz�Invalid script entry point: {} - A callable suffix is required. Cf https://packaging.python.org/specifications/entry-points/#use-for-scripts for more information.)�superr�r�rV)r=Zentry_point��	__class__r;r>r��s

��zMissingCallableSuffix.__init__)r@rArBr��
__classcell__r;r;r�r>r��sr�cCs*t|�}|dur&|jdur&tt|���dSr:)r	�suffixr�rL)�
specification�entryr;r;r>�_raise_for_invalid_entrypoint�sr�cseZdZd�fdd�	Z�ZS)�PipScriptMakerNcst|�tt|��||�Sr:)r�r�r��make)r=r��optionsr�r;r>r��szPipScriptMaker.make)N)r@rArBr�r�r;r;r�r>r��sr�TFc:	s�t�|�\}}	t|	�r|j�n|j�i�t��g}
d-���fdd�	}�fdd�}dd�}
�fdd	���fd
d�}��fdd
�}dd�}|�}t|
|�}t||�\}}|�t�t�	�d��}t
||�}dd�}t||�\}}|�|�}t
||�}t||�}t�|��}t
|�\����fdd�}t
||�}t||�}t
t|�}t||�}|D] }|��||j|j|j��qJ��fdd�} dd�}!|�r`t���}"t����t�d�| �D]f}#t|#t�	�d�}$tj|$ddd�}%|%�r�|!|#�}&tj�|&��s�J�td|&�tjjd��}'||'|&��q�Wd�n1�s(0YWd�n1�sH0Yt �!|"�"��t#d|j$�}(d|(_%dh|(_&d|(_'t(��})t)t*d j+��,���}*|(�-|)�}+|
�.|+�|
�.|(�-|*d!di��|�r�t/|+�},|,du�r�t �0|,�d"t1�@�t2j3�fd#d$��}-tj�4�|�}.tj�4|.d%�}/|-|/��}0|0�5d&�Wd�n1�sL0Y|
�6|/�|du�r�tj�4|.t7�}1|-|1��$}2|2�5|�8��9d'��Wd�n1�s�0Y|
�6|1�|�r
tj�4|.d(�}3t:|3d)��Wd�n1�s�0Y|
�6|3�|�;d*�}4t)t<�=|4�>���}5t?|5��|
�d+�}6tj�4|.d*�}7|-|7fit@d)����.}8t<�Atd,|8��}9|9�BtC|6��Wd�n1�s�0YdS).a�Install a wheel.

    :param name: Name of the project to install
    :param wheel_zip: open ZipFile for wheel being installed
    :param scheme: Distutils scheme dictating the install directories
    :param req_description: String used in place of the requirement, for
        logging
    :param pycompile: Whether to byte-compile installed Python files
    :param warn_script_location: Whether to check that scripts are installed
        into a directory on PATH
    :raises UnsupportedWheel:
        * when the directory holds an unpacked wheel with incompatible
          Wheel-Version
        * when the .dist-info dir does not match the wheel
    Fcs(t|��}|�|<|r$��t|��dS)z6Map archive RECORD paths to installation RECORD paths.N)r�r�)Zsrcfiler�Zmodified�newpath)rEr�r�r;r>�record_installeds
z(_install_wheel.<locals>.record_installedc3s,���}tt|�}|D]}td|�VqdS)Nr8)Znamelistrrr$)�namesZ
decoded_names�name)�	wheel_zipr;r>�	all_paths&s
z!_install_wheel.<locals>.all_pathscSs
|�d�S)Nr�)�endswith�rMr;r;r>�is_dir_path/sz#_install_wheel.<locals>.is_dir_pathcs$t||�s d}t|��||���dS)NzRThe wheel {!r} has a file {!r} trying to install outside the target directory {!r})rrrV)Z
dest_dir_pathZtarget_path�message)�
wheel_pathr;r>�assert_no_path_traversal3s
��z0_install_wheel.<locals>.assert_no_path_traversalcs���fdd�}|S)Ncs0tj�|�}tj��|�}��|�t||��Sr:)r[rM�normpathr�r�)r��normed_pathrD)r�r�r�r;r>�make_root_scheme_file@s
zM_install_wheel.<locals>.root_scheme_file_maker.<locals>.make_root_scheme_filer;)r�r�r�)r�)r�r�r>�root_scheme_file_maker>sz._install_wheel.<locals>.root_scheme_file_makercsFi�tD]&}t|�}tt||�t��d��|<q����fdd�}|S)Nr�c		s�tj�|�}z|�tjjd�\}}}Wn&tyLd��|�}t|��Yn0z�|}Wn8ty�d�	t
���}d��|||�}t|��Yn0tj�	||�}�||�t||��S)Nr�zbUnexpected file in {}: {!r}. .data directory contents should be named like: '<scheme key>/<path>'.r�z�Unknown scheme key used in {}: {} (for file {!r}). .data directory contents should be in subdirectories named with a valid scheme key ({}))r[rMr�rqr��
ValueErrorrVrrzr�r�r�)	r�r��_Z
scheme_keyZdest_subpathr�Zscheme_pathZvalid_scheme_keysrD)r��scheme_pathsr�r�r;r>�make_data_scheme_fileRs*����
zM_install_wheel.<locals>.data_scheme_file_maker.<locals>.make_data_scheme_file)rr�getattrr`rc)r��scheme�keyZencoded_keyr�)r�r�)r�r�r>�data_scheme_file_makerIs�z._install_wheel.<locals>.data_scheme_file_makercSs|�dd�d�d�S)Nr�rpr�.data)rqr�r�r;r;r>�is_data_scheme_pathqsz+_install_wheel.<locals>.is_data_scheme_pathr�cSs2|�dd�}t|�dko0|d�d�o0|ddkS)Nr�r�rr�rpr�)rqr�r�)rM�partsr;r;r>�is_script_scheme_path�s�
�z-_install_wheel.<locals>.is_script_scheme_pathcsz|j}tj�|�}|���d�r.|dd�}n<|���d�rJ|dd�}n |���d�rf|dd�}n|}|�vpx|�vS)Nz.exe���z
-script.pyi����z.pya)rDr[rMr�rlr�)r�rMr�Z	matchname)r~rr;r>�is_entrypoint_wrapper�sz-_install_wheel.<locals>.is_entrypoint_wrapperc3sHtt�����D]2}tj��|�}tj�|�s0q|�d�s<q|VqdS)Nz.py)r�r�r|r[rMr�r\r�)Zinstalled_pathZfull_installed_path)r�r�r;r>�pyc_source_file_paths�s
z-_install_wheel.<locals>.pyc_source_file_pathscSs.trtjjr|dS|dSntj�|�SdS)zAReturn the path the pyc file would have been written to.
        �o�cN)r
r`�flags�optimize�	importlib�util�cache_from_sourcer�r;r;r>�pyc_output_path�s

z'_install_wheel.<locals>.pyc_output_path�ignoreT)�force�quietr8r�NrRr�ri�c;sTt|fi|���}|VWd�n1s,0Yt�|j��t|j|�dSr:)rr[�chmodr�r)rM�kwargsr�)�generated_file_moder;r>�_generate_files$z&_install_wheel.<locals>._generate_fileZ	INSTALLERspip
rSZ	REQUESTED�wZRECORD)r�rEr�r�zIO[str])F)Dr"rnZpurelibZplatlibr�rrrr`rcrrr#r�r�r?rCrDrEr�warnings�catch_warnings�filterwarningsr�
compileall�compile_filer[rMr�r$rr�r��debug�getvaluer�r�ZclobberZvariantsZset_moder��listrrVr�Z
make_multipler�r�r�r�
contextlib�contextmanagerr�rfr�rZto_jsonrbr]Zget_metadata�csv�reader�
splitlinesr�rW�writerZ	writerowsr�):r�r�r�r��	pycompile�warn_script_location�
direct_url�	requestedZinfo_dirrmr�r�r�r�r�r�r��pathsZ
file_pathsZroot_scheme_pathsZdata_scheme_pathsr��filesr�Zother_scheme_pathsZscript_scheme_pathsr�Zother_scheme_filesr}r�Zscript_scheme_filesr�r�r�stdoutrMZpath_arg�successZpyc_pathZpyc_record_pathZmakerr�Zgui_scripts_to_generateZgenerated_console_scripts�msgrZ
dest_info_dirZinstaller_pathZinstaller_fileZdirect_url_pathZdirect_url_fileZrequested_pathZrecord_textZrecord_rowsZrowsr�Zrecord_filerr;)	r�rEr~rrr�r�r�r�r>�_install_wheel�s�	(
��
	�


�
�





���N

�


*


4
 

�r!c
cs^z
dVWnNtyX}z6d�||jd�}ttt|�t��d�WYd}~n
d}~00dS)NzFor req: {}. {}rr�)rrV�argsrr`�exc_info)�req_description�er�r;r;r>�req_error_context;s
�r&c	Cspt|dd��P}t|��(t||||||||d�Wd�n1sD0YWd�n1sb0YdS)NT)Z
allowZip64)r�r�r�r�rrrr)rr&r!)	r�r�r�r$rrrr�zr;r;r>�
install_wheelGs
�r()rF)N)TTNF)TTNF)v�__doc__Z
__future__rr�r
rrr�ZloggingZos.pathr[r�r�r`r
�base64r�	itertoolsrrZzipfilerZpip._vendorrZpip._vendor.distlib.scriptsrZpip._vendor.distlib.utilr	Zpip._vendor.sixr
rrr
rrZpip._vendor.six.movesrrZpip._internal.exceptionsrZpip._internal.locationsrZpip._internal.models.direct_urlrrZpip._internal.models.schemerZpip._internal.utils.filesystemrrZpip._internal.utils.miscrrrrZpip._internal.utils.typingrZpip._internal.utils.unpackingrrr r!Zpip._internal.utils.wheelr"r#r$Z
email.messager%�typingr&r'r(r)r*r+r,r-r.r/r0r1r2r3r4Zpip._vendor.pkg_resourcesr5r6r7r8rL�intZInstalledCSVRowr9Z	getLoggerr@r�rPrWrirnr�r�r�r�r�r�r�r��objectr�r�r�r�r�r!rr&r(r;r;r;r>�<module>s� D



G
!V.�
H
�