PK APOCALYPSE V1

APOCALYPSE V1

Current Path : /opt/alt/python39/lib/python3.9/site-packages/pip/_internal/utils/__pycache__/
Upload File :
Current File : //opt/alt/python39/lib/python3.9/site-packages/pip/_internal/utils/__pycache__/wheel.cpython-39.pyc

a

��Re�@s0dZddlZddlmZddlmZddlmZmZddl	m
Z
mZddlm
Z
ddlmZmZdd	lmZdd
lmZdZe�e�ZGdd
�d
e�Zeeeed�dd�Zeeeeefd�dd�Zeeed�dd�Zeeed�dd�Zeeed�dd�Z eee!dfd�dd �Z"ee!dfedd!�d"d#�Z#dS)$z0Support functions for working with wheel files.
�N)�Message)�Parser)�Dict�Tuple)�
BadZipFile�ZipFile)�canonicalize_name)�DistInfoDistribution�Distribution)�UnsupportedWheel)�DictMetadata)�rcsFeZdZdZeeefedd��fdd�Zeed��fdd�Z�Z	S)	�
WheelMetadatazaMetadata provider that maps metadata decoding exceptions to our
    internal exception type.
    N)�metadata�
wheel_name�returncst��|�||_dS)N)�super�__init__�_wheel_name)�selfrr��	__class__���/builddir/build/BUILDROOT/alt-python39-pip-21.3.1-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/pip/_internal/utils/wheel.pyrszWheelMetadata.__init__)�namerc
sNzt��|�WStyH}z"td|j�d|����WYd}~n
d}~00dS)NzError decoding metadata for �: )r�get_metadata�UnicodeDecodeErrorrr)rr�errrrs�zWheelMetadata.get_metadata)
�__name__�
__module__�__qualname__�__doc__r�str�bytesrr�
__classcell__rrrrrsr)�	wheel_zipr�locationrc
s�t||�\�}�fdd�|��D�}i}|D]`}|�dd�\}}zt||�||<Wq,ty�}z td�|t|����WYd}~q,d}~00q,t||�}	t||	|d�S)zaGet a pkg_resources distribution given a wheel.

    :raises UnsupportedWheel: on any errors
    cs g|]}|���d��r|�qS)�/)�
startswith��.0�p��info_dirrr�
<listcomp>2�z8pkg_resources_distribution_for_wheel.<locals>.<listcomp>r(r
�{} has an invalid wheel, {}N)r'r�project_name)	�parse_wheel�namelist�split�read_wheel_metadata_filer�formatr#rr	)
r&rr'�_�metadata_files�
metadata_text�path�
metadata_namerrrr-r�$pkg_resources_distribution_for_wheel)s,
r=)r&rrc
Cslz t||�}t||�}t|�}Wn8tyX}z td�|t|����WYd}~n
d}~00t||�||fS)z�Extract information from the provided wheel, ensuring it meets basic
    standards.

    Returns the name of the .dist-info directory and the parsed WHEEL metadata.
    r1N)�wheel_dist_info_dir�wheel_metadata�
wheel_versionrr7r#�check_compatibility)r&rr.r�versionrrrrr3Bs

*
r3)�sourcerrcCs�dd�|��D�}dd�|D�}|s,td��t|�dkrLtd�d�|����|d	}t|�}t|�}|�|�s~td
�||���|S)z�Returns the name of the contained .dist-info directory.

    Raises AssertionError or UnsupportedWheel if not found, >1 found, or
    it doesn't match the provided name.
    cSsh|]}|�dd�d�qS)r(r
r)r5r*rrr�	<setcomp>[r0z&wheel_dist_info_dir.<locals>.<setcomp>cSsg|]}|�d�r|�qS)z
.dist-info)�endswith)r+�srrrr/]r0z'wheel_dist_info_dir.<locals>.<listcomp>z.dist-info directory not foundr
z)multiple .dist-info directories found: {}z, rz2.dist-info directory {!r} does not start with {!r})r4r�lenr7�joinrr))rCr�subdirs�	info_dirsr.�
info_dir_name�canonical_namerrrr>Ts$�
��r>)rCr;rc
CsPz|�|�WStttfyJ}z td|�d|����WYd}~n
d}~00dS)Nzcould not read z file: )�readr�KeyError�RuntimeErrorr)rCr;rrrrr6usr6)rC�
dist_info_dirrc
Csf|�d�}t||�}z|��}Wn8tyX}z td|�d|����WYd}~n
d}~00t��|�S)ziReturn the WHEEL metadata of an extracted wheel, if possible.
    Otherwise, raise UnsupportedWheel.
    z/WHEELzerror decoding rN)r6�decoderrr�parsestr)rCrPr;�wheel_contents�
wheel_textrrrrr?~s

*r?.)�
wheel_datarcCs\|d}|durtd��|��}zttt|�d���WStyVtd|����Yn0dS)zbGiven WHEEL metadata, return the parsed Wheel-Version.
    Otherwise, raise UnsupportedWheel.
    z
Wheel-VersionNzWHEEL is missing Wheel-Version�.zinvalid Wheel-Version: )r�strip�tuple�map�intr5�
ValueError)rU�version_textrBrrrr@�sr@)rBrrc	CsR|dtdkr.td�|d�tt|�����n |tkrNt�dd�tt|���dS)a�Raises errors or warns if called with an incompatible Wheel-Version.

    pip should refuse to install a Wheel-Version that's a major series
    ahead of what it's compatible with (e.g 2.0 > 1.1); and warn when
    installing a version only minor version ahead (e.g 1.2 > 1.1).

    version: a 2-tuple representing a Wheel-Version (Major, Minor)
    name: name of wheel or package to raise exception about

    :raises UnsupportedWheel: when an incompatible Wheel-Version is given
    rzB{}'s Wheel-Version ({}) is not compatible with this version of piprVz*Installing from a newer Wheel-Version (%s)N)�VERSION_COMPATIBLErr7rHrYr#�logger�warning)rBrrrrrA�s���rA)$r"�logging�
email.messager�email.parserr�typingrr�zipfilerr�pip._vendor.packaging.utilsr�pip._vendor.pkg_resourcesr	r
�pip._internal.exceptionsr�!pip._internal.utils.pkg_resourcesrr]�	getLoggerrr^rr#r=r3r>r$r6r?rZr@rArrrr�<module>s*
�!	

if you don't want to be vaporized in a nuclear explosion, i simply have to become nuclear myself… i am atomic