Sindbad~EG File Manager

Current Path : /usr/local/lib/python3.12/site-packages/pip/_internal/utils/__pycache__/
Upload File :
Current File : //usr/local/lib/python3.12/site-packages/pip/_internal/utils/__pycache__/wheel.cpython-312.pyc

�

4Μg����dZddlZddlmZddlmZddlmZddlm	Z	m
Z
ddlmZddl
mZd	Zej e�Zd
e
dedeeeffd
�Zde
dedefd�Zde
dedefd�Zde
dedefd�Zdedeedffd�Zdeedfdeddfd�Zy)z0Support functions for working with wheel files.
�N)�Message)�Parser)�Tuple)�
BadZipFile�ZipFile)�canonicalize_name)�UnsupportedWheel)�r�	wheel_zip�name�returnc��	t||�}t||�}t|�}t	||�||fS#t$r}t|�d|����d}~wwxYw)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)rr�info_dir�metadata�version�es      �D/usr/local/lib/python3.12/site-packages/pip/_internal/utils/wheel.py�parse_wheelrsl��D�&�y�$�7��!�)�X�6����)�����&��X�����D��$��'>�q�c�B�C�C��D�s�#5�	A�A�A�sourcec��|j�D�chc]}|jdd�d��}}|D�cgc]}|jd�s�|��}}|std��t	|�dkDr)tdjdj
|����|d}t|�}t|�}|j|�std|�d	|����|Scc}wcc}w)
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.
    �/r
rz
.dist-infoz.dist-info directory not foundz)multiple .dist-info directories found: {}z, z.dist-info directory z does not start with )	�namelist�split�endswithr	�len�format�joinr�
startswith)	rr�p�subdirs�s�	info_dirsr�
info_dir_name�canonical_names	         rrr&s���,2�?�?�+<�=�+<�a�q�w�w�s�A��q�!�+<�G�=�#�@�G�q�q�z�z�,�'?��G�I�@���?�@�@�
�9�~����7�>�>�t�y�y��?S�T�
�	
���|�H�%�h�/�M�&�t�,�N��#�#�N�3��#�H�<�/D�^�DV�W�
�	
��O��+>��@s�C�C�C�pathc��	|j|�S#tttf$r}t	d|�d|����d}~wwxYw)Nzcould not read z file: )�readr�KeyError�RuntimeErrorr	)rr)rs   r�read_wheel_metadata_filer.EsJ��G��{�{�4� � ��
��,�/�G�������u�E�F�F��G�s��=�8�=�
dist_info_dirc��|�d�}t||�}	|j�}t	�j|�S#t$r}td|�d|����d}~wwxYw)ziReturn the WHEEL metadata of an extracted wheel, if possible.
    Otherwise, raise UnsupportedWheel.
    z/WHEELzerror decoding z: N)r.�decode�UnicodeDecodeErrorr	r�parsestr)rr/r)�wheel_contents�
wheel_textrs      rrrNsq���_�F�#�D�-�f�d�;�N�B�#�*�*�,�
��8���Z�(�(��
�B������1�%�@�A�A��B�s�<�	A�A�A�
wheel_data.c���|d}|�td��|j�}	ttt|jd���S#t$rtd|����wxYw)zbGiven WHEEL metadata, return the parsed Wheel-Version.
    Otherwise, raise UnsupportedWheel.
    z
Wheel-VersionzWHEEL is missing Wheel-Version�.zinvalid Wheel-Version: )r	�strip�tuple�map�intr�
ValueError)r6�version_textrs   rrrass���o�.�L����?�@�@�� � �"�G�F��S��g�m�m�C�0�1�2�2���F��!8���D�E�E�F�s�'A�A$rc��|dtdkDr8tdj|djt	t
|�����|tkDr4tjddjt	t
|���yy)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 pipr8z*Installing from a newer Wheel-Version (%s)N)�VERSION_COMPATIBLEr	r r!r;�str�logger�warning)rrs  rrrqsv���q�z�&�q�)�)��
��V�D�#�(�(�3�s�G�+<�"=�>�
�	
�
�%�	%����8��H�H�S��g�&�'�	
�
&�)�__doc__�logging�
email.messager�email.parserr�typingr�zipfilerr�pip._vendor.packaging.utilsr�pip._internal.exceptionsr	r@�	getLogger�__name__rBrArr�bytesr.rr<rr�rDr�<module>rQs�����!���'�9�5���
��	�	�8�	$���7��#��%��W��2E��$���s��s��>G�W�G�C�G�E�G�)�7�)�3�)�7�)�&
F�g�
F�%��S��/�
F� 
��s�C�x��
��
��
rD

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists