Viewing File: /opt/hc_python/lib/python3.12/site-packages/pip/_internal/models/__pycache__/wheel.cpython-312.pyc

�

T�*jh��d�dZddlmZddlmZddlmZddlmZ	ddlm
Z
ddlmZGd�d�Zy	)
z`Represents a wheel file and provides access to the various parts of the
name that have meaning.
�)�annotations)�Iterable)�Tag)�InvalidWheelFilename)�parse_wheel_filenamec�D�eZdZdZdd�Zd	d�Zd
d�Z						dd�Zdd�Zy)
�WheelzA wheel filec���||_	t|�}|\|_}|_|_t|�|_	y#t$r}t|jd�d�d}~wwxYw)Nr)
�filenamer�_PackagingInvalidWheelFilenamer�args�name�	build_tag�	file_tags�str�version)�selfr�
wheel_info�e�_versions     �I/opt/hc_python/lib/python3.12/site-packages/pip/_internal/models/wheel.py�__init__zWheel.__init__sa�� ��
�	<�-�h�7�J�?I�;��	�8�T�^�T�^��8�}����	.�	<�&�q�v�v�a�y�1�t�;��	<�s�;�	A"�A�A"c�:�td�|jD��S)z4Return the wheel's tags as a sorted list of strings.c3�2K�|]}t|����y�w�N)r)�.0�tags  r�	<genexpr>z0Wheel.get_formatted_file_tags.<locals>.<genexpr>"s����9�.�3�c�#�h�.�s�)�sortedr)rs r�get_formatted_file_tagszWheel.get_formatted_file_tags s���9�$�.�.�9�9�9�c�n��	t�fd�t|�D��S#t$rt��wxYw)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.
        c3�F�K�|]\}}|�jvs�|���y�wr)r)r�i�trs   �rrz*Wheel.support_index_min.<locals>.<genexpr>2s!�����M�o�d�a���d�n�n�9L��o�s�!�!)�next�	enumerate�
StopIteration�
ValueError�r�tagss` r�support_index_minzWheel.support_index_min$s4���	��M�i��o�M�M�M���	��,��	�s� �4c�@��t�fd�|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.
        c3�2�K�|]}|�vs��|���y�wr�)rr�tag_to_prioritys  �rrz0Wheel.find_most_preferred_tag.<locals>.<genexpr>Gs!�����
�,:�S�c�_�>T�O�C� �N�s�	�
)�minr)rr+r0s  `r�find_most_preferred_tagzWheel.find_most_preferred_tag6s#���"�
�,0�N�N�
�
�	
r!c�:�|jj|�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�
isdisjointr*s  r�	supportedzWheel.supportedKs��
�>�>�,�,�T�2�2�2r!N)rr�return�None)r6z	list[str])r+�	list[Tag]r6�int)r+r8r0zdict[Tag, int]r6r9)r+z
Iterable[Tag]r6�bool)	�__name__�
__module__�__qualname__�__doc__rr r,r2r5r/r!rr	r	s6���	%�:��$
��
�0>�
�	�
�*3r!r	N)
r>�
__future__r�collections.abcr�pip._vendor.packaging.tagsr�pip._vendor.packaging.utilsrrr�pip._internal.exceptionsr	r/r!r�<module>rDs,���#�$�*��=�9�>3�>3r!
Back to Directory File Manager