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/models/__pycache__/wheel.cpython-310.pyc
o

��h��@svdZddlmZddlZddlmZddlmZddlm	Z	m
Z
ddlmZddl
mZddlmZGd	d
�d
�ZdS)z`Represents a wheel file and provides access to the various parts of the
name that have meaning.
�)�annotationsN)�Iterable��Tag)�BuildTag�parse_wheel_filename)�InvalidWheelFilename)�
deprecatedc@s^eZdZdZe�dej�Zddd�Ze	dd
d��Z
dd
d�Zd dd�Zd!dd�Z
d"dd�ZdS)#�WheelzA wheel filez�^(?P<namever>(?P<name>[^\s-]+?)-(?P<ver>[^\s-]*?))
        ((-(?P<build>\d[^-]*?))?-(?P<pyver>[^\s-]+?)-(?P<abi>[^\s-]+?)-(?P<plat>[^\s-]+?)
        \.whl|\.dist-info)$�filename�str�return�Nonec
s||_|d|_zt|�}|\|_}|_|_t|�|_WdSty�}zb|j�	|�}|s5t
|jd�d�td|�d|jd�d�dddd�|�
d	��d
d�|_|�
d��d
d�|_|�
d
��d�}|�
d��d��|�
d��d��t��fdd�|D��|_WYd}~dSd}~ww)NrzWheel filename zU is not correctly normalised. Future versions of pip will raise the following error:
z

zvto rename the wheel to use a correctly normalised name (this may require updating the version in the project metadata)z25.3i�2)�reason�replacement�gone_in�issue�name�_�-�ver�pyver�.�abi�platc3s2�|]}�D]}�D]
}t|||d�Vq
qqdS))�interpreterr�platformNr)�.0�pyrr��abis�plats��E/usr/local/lib/python3.10/dist-packages/pip/_internal/models/wheel.py�	<genexpr>Fs�����z!Wheel.__init__.<locals>.<genexpr>)r�
_build_tagrr�	file_tagsr�version�_PackagingInvalidWheelFilename�legacy_wheel_file_re�matchr�argsr	�group�replace�split�	frozenset)�selfr�
wheel_info�_version�e�legacy_wheel_info�
pyversionsr"rr#�__init__s:�����zWheel.__init__rcCsx|jdur|jS|j�|j�}|dusJd��|�d�}t�d|�}|dus*Jd��|��}t|d�|df|_|jS)Nz!guaranteed by filename validation�buildz^(\d+)(.*)$r�)r%r)r*rr,�re�groups�int)r0r4�	build_tagr*�build_tag_groupsr"r"r#r<Ms

zWheel.build_tag�	list[str]cCstdd�|jD��S)z4Return the wheel's tags as a sorted list of strings.css�|]}t|�VqdS�N)r�r�tagr"r"r#r$_s�z0Wheel.get_formatted_file_tags.<locals>.<genexpr>)�sortedr&�r0r"r"r#�get_formatted_file_tags]szWheel.get_formatted_file_tags�tags�	list[Tag]r;cs2zt�fdd�t|�D��WStyt��w)a�Return the lowest index that one of the wheel's file_tag combinations
        achieves in the given list of supported tags.

        For example, if there are 8 supported tags and one of the file tags
        is first in the list, then return 0.

        :param tags: the PEP 425 tags to check the wheel against, in order
            with most preferred first.

        :raises ValueError: If none of the wheel's file tags match one of
            the supported tags.
        c3s"�|]\}}|�jvr|VqdSr?)r&)r�i�trCr"r#r$os� z*Wheel.support_index_min.<locals>.<genexpr>)�next�	enumerate�
StopIteration�
ValueError�r0rEr"rCr#�support_index_minas

�zWheel.support_index_min�tag_to_priority�dict[Tag, int]cst�fdd�|jD��S)a�Return the priority of the most preferred tag that one of the wheel's file
        tag combinations achieves in the given list of supported tags using the given
        tag_to_priority mapping, where lower priorities are more-preferred.

        This is used in place of support_index_min in some cases in order to avoid
        an expensive linear scan of a large list of tags.

        :param tags: the PEP 425 tags to check the wheel against.
        :param tag_to_priority: a mapping from tag to priority of that tag, where
            lower is more preferred.

        :raises ValueError: If none of the wheel's file tags match one of
            the supported tags.
        c3s �|]}|�vr�|VqdSr?r"r@�rOr"r#r$�s��z0Wheel.find_most_preferred_tag.<locals>.<genexpr>)�minr&)r0rErOr"rQr#�find_most_preferred_tagss�zWheel.find_most_preferred_tag�
Iterable[Tag]�boolcCs|j�|�S)z�Return whether the wheel is compatible with one of the given tags.

        :param tags: the PEP 425 tags to check the wheel against.
        )r&�
isdisjointrMr"r"r#�	supported�szWheel.supportedN)rrr
r)r
r)r
r>)rErFr
r;)rErFrOrPr
r;)rErTr
rU)�__name__�
__module__�__qualname__�__doc__r9�compile�VERBOSEr)r6�propertyr<rDrNrSrWr"r"r"r#r
s�
/


r
)r[�
__future__rr9�collections.abcr�pip._vendor.packaging.tagsr�pip._vendor.packaging.utilsrrrr(�pip._internal.exceptions�pip._internal.utils.deprecationr	r
r"r"r"r#�<module>s