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/utils/__pycache__/wheel.cpython-39.pyc
a

?�f��@s dZddlmZddlZddlmZddlmZddlm	Z	ddl
mZddlm
Z
mZdd	lmZdd
lmZddlmZer�ddlmZdd
lmZmZddl
mZe
r�ddlmZnddlmZdZe�e�Z Gdd�de�Z!dd�Z"dd�Z#dd�Z$dd�Z%dd�Z&dd�Z'd d!�Z(dS)"z0Support functions for working with wheel files.
�)�absolute_importN)�Parser)�ZipFile)�canonicalize_name)�DistInfoDistribution)�PY2�
ensure_str)�UnsupportedWheel)�DictMetadata)�MYPY_CHECK_RUNNING)�Message)�Dict�Tuple)�Distribution)�
BadZipfile)�
BadZipFile)�rcs,eZdZdZ�fdd�Z�fdd�Z�ZS)�
WheelMetadatazaMetadata provider that maps metadata decoding exceptions to our
    internal exception type.
    cstt|��|�||_dS)N)�superr�__init__�_wheel_name)�self�metadataZ
wheel_name��	__class__��=/usr/lib/python3.9/site-packages/pip/_internal/utils/wheel.pyr(szWheelMetadata.__init__c
sNztt|��|�WStyH}ztd�|j|���WYd}~n
d}~00dS)Nz"Error decoding metadata for {}: {})rr�get_metadata�UnicodeDecodeErrorr	�formatr)r�name�errrr-s��zWheelMetadata.get_metadata)�__name__�
__module__�__qualname__�__doc__rr�
__classcell__rrrrr$srcs�t||�\�}�fdd�|��D�}i}|D]h}t|�}|�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)z{}/)�
startswithr��.0�p��info_dirrr�
<listcomp>Bsz8pkg_resources_distribution_for_wheel.<locals>.<listcomp>�/r�{} has an invalid wheel, {}N)�locationrZproject_name)
�parse_wheel�namelistr�split�read_wheel_metadata_filer	r�strrr)�	wheel_zipr r0�_Zmetadata_filesZ
metadata_text�path�	full_pathZ
metadata_namer!rrr+r�$pkg_resources_distribution_for_wheel:s(
���
�r:c
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.
    r/N)�wheel_dist_info_dir�wheel_metadata�
wheel_versionr	rr5�check_compatibility)r6r r,r�versionr!rrrr1_s

�
r1cCs�tdd�|��D��}dd�|D�}|s0td��t|�dkrPtd�d�|����|d	}t|�}t|�}|�|�s�td
�||���t|�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.
    css|]}|�dd�dVqdS)r.rrN)r3r(rrr�	<genexpr>|�z&wheel_dist_info_dir.<locals>.<genexpr>cSsg|]}|�d�r|�qS)z
.dist-info)�endswith)r)�srrrr-~rAz'wheel_dist_info_dir.<locals>.<listcomp>z.dist-info directory not foundrz)multiple .dist-info directories found: {}z, rz2.dist-info directory {!r} does not start with {!r})	�setr2r	�lenr�joinrr'r)�sourcer �subdirsZ	info_dirsr,Z
info_dir_nameZcanonical_namerrrr;ts(��
��r;c
CsLz|�|�WStttfyF}ztd�||���WYd}~n
d}~00dS)Nzcould not read {!r} file: {!r})�readr�KeyError�RuntimeErrorr	r)rGr8r!rrrr4�s
�r4c
Csbd�|�}t||�}zt|�}Wn4tyT}ztd�||���WYd}~n
d}~00t��|�S)ziReturn the WHEEL metadata of an extracted wheel, if possible.
    Otherwise, raise UnsupportedWheel.
    z{}/WHEELzerror decoding {!r}: {!r}N)rr4rrr	rZparsestr)rGZ
dist_info_dirr8Zwheel_contentsZ
wheel_textr!rrrr<�s

&r<cCs\|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})r	�strip�tuple�map�intr3�
ValueErrorr)Z
wheel_dataZversion_textr?rrrr=�sr=c	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 piprLz*Installing from a newer Wheel-Version (%s)N)�VERSION_COMPATIBLEr	rrFrOr5�loggerZwarning)r?r rrrr>�s
���r>))r%Z
__future__rZloggingZemail.parserrZzipfilerZpip._vendor.packaging.utilsrZpip._vendor.pkg_resourcesrZpip._vendor.sixrrZpip._internal.exceptionsr	Z!pip._internal.utils.pkg_resourcesr
Zpip._internal.utils.typingrZ
email.messager�typingr
rrrrrRZ	getLoggerr"rSrr:r1r;r4r<r=r>rrrr�<module>s6
%&