HEX
Server: LiteSpeed
System: Linux php-prod-1.spaceapp.ru 5.15.0-157-generic #167-Ubuntu SMP Wed Sep 17 21:35:53 UTC 2025 x86_64
User: sport3497 (1034)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: //usr/local/lib/python3.10/dist-packages/pip/_internal/utils/__pycache__/wheel.cpython-310.pyc
o

��ht�@s�dZddlZddlmZddlmZddlmZmZddl	m
Z
ddlmZdZ
e�e�Zd	ed
edeeeffdd
�Zded
edefdd�Zdededefdd�Zdededefdd�Zdedeedffdd�Zdeedfd
eddfdd�ZdS)z/Support functions for working with wheel files.�N)�Message)�Parser)�
BadZipFile�ZipFile)�canonicalize_name)�UnsupportedWheel)�r�	wheel_zip�name�returnc
Cs^zt||�}t||�}t|�}Wnty%}z	t|�d|����d}~wwt||�||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.
    z has an invalid wheel, N)�wheel_dist_info_dir�wheel_metadata�
wheel_versionr�check_compatibility)r	r
�info_dir�metadata�version�e�r�D/usr/local/lib/python3.10/dist-packages/pip/_internal/utils/wheel.py�parse_wheels

��
r�sourcecCs�dd�|��D�}dd�|D�}|std��t|�dkr&td�d�|����|d	}t|�}t|�}|�|�sAtd
|�d|����|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)�/rr)�split)�.0�prrr�	<setcomp>+sz&wheel_dist_info_dir.<locals>.<setcomp>cSsg|]	}|�d�r|�qS)z
.dist-info)�endswith)r�srrr�
<listcomp>-sz'wheel_dist_info_dir.<locals>.<listcomp>z.dist-info directory not foundrz)multiple .dist-info directories found: {}z, rz.dist-info directory z does not start with )�namelistr�len�format�joinr�
startswith)rr
�subdirs�	info_dirsr�
info_dir_name�canonical_namerrrr$s �
�r�pathc
Cs@z|�|�WStttfy}z
td|�d|����d}~ww)Nzcould not read z file: )�readr�KeyError�RuntimeErrorr)rr)rrrr�read_wheel_metadata_fileCs��r-�
dist_info_dirc
CsZ|�d�}t||�}z|��}Wnty&}z
td|�d|����d}~wwt��|�S)ziReturn the WHEEL metadata of an extracted wheel, if possible.
    Otherwise, raise UnsupportedWheel.
    z/WHEELzerror decoding z: N)r-�decode�UnicodeDecodeErrorrr�parsestr)rr.r)�wheel_contents�
wheel_textrrrrr
Ls

��r
�
wheel_data.cCsT|d}|durtd��|��}zttt|�d���WSty)td|����w)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�intr�
ValueError)r4�version_textrrrrr_s�rrc	CsT|dtdkrtd�|d�tt|�����|tkr(t�dd�tt|���dSdS)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 pipr5z*Installing from a newer Wheel-Version (%s)N)�VERSION_COMPATIBLErr"r#r8�str�logger�warning)rr
rrrros���r)�__doc__�logging�
email.messager�email.parserr�zipfilerr�pip._vendor.packaging.utilsr�pip._internal.exceptionsrr<�	getLogger�__name__r>r=r7rr�bytesr-r
r9rrrrrr�<module>s
	"