Ë
    äØjj  ã                   óP   — d Z ddlZddlmZmZmZ ddlmZ ddlm	Z	  G d„ d«      Z
y)z`Represents a wheel file and provides access to the various parts of the
name that have meaning.
é    N)ÚDictÚIterableÚList)ÚTag)ÚInvalidWheelFilenamec                   ó¼   — e Zd ZdZ ej
                  dej                  «      Zdeddfd„Z	de
e   fd„Zde
e   defd	„Zde
e   d
eeef   defd„Zdee   defd„Zy)Ú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ÚreturnNc                 ó¸  — | j                   j                  |«      }|st        |› d�«      ‚|| _        |j	                  d«      j                  dd«      | _        |j	                  d«      j                  dd«      | _        |j	                  d«      | _        |j	                  d«      j                  d«      | _
        |j	                  d	«      j                  d«      | _        |j	                  d
«      j                  d«      | _        | j                  D ���ch c]1  }| j                  D ]   }| j                  D ]  }t        |||«      ’Œ Œ" Œ3 c}}}| _        yc c}}}w )zX
        :raises InvalidWheelFilename: when the filename is invalid for a wheel
        z is not a valid wheel filename.ÚnameÚ_ú-ÚverÚbuildÚpyverú.ÚabiÚplatN)Úwheel_file_reÚmatchr   r
   ÚgroupÚreplacer   ÚversionÚ	build_tagÚsplitÚ
pyversionsÚabisÚplatsr   Ú	file_tags)Úselfr
   Ú
wheel_infoÚxÚyÚzs         ú\/opt/eval-harness/bench_task/venv/lib/python3.12/site-packages/pip/_internal/models/wheel.pyÚ__init__zWheel.__init__   s;  € ð ×'Ñ'×-Ñ-¨hÓ7ˆ
ÙÜ&¨(¨Ð3RÐ'SÓTÐTØ ˆŒØ×$Ñ$ VÓ,×4Ñ4°S¸#Ó>ˆŒ	ð "×'Ñ'¨Ó.×6Ñ6°s¸CÓ@ˆŒØ#×)Ñ)¨'Ó2ˆŒØ$×*Ñ*¨7Ó3×9Ñ9¸#Ó>ˆŒØ×$Ñ$ UÓ+×1Ñ1°#Ó6ˆŒ	Ø×%Ñ% fÓ-×3Ñ3°CÓ8ˆŒ
ð #'§/¡/÷
ð 
Ø¸4¿9¹9ò
Ø67ÈdÏjÉjò
ØIJŒC��1�a�Lð
Øð
Øô
ˆ�ùô 
s   Ä6Ec                 ó:   — t        d„ | j                  D «       «      S )z4Return the wheel's tags as a sorted list of strings.c              3   ó2   K  — | ]  }t        |«      –— Œ y ­w©N)Ústr)Ú.0Útags     r&   ú	<genexpr>z0Wheel.get_formatted_file_tags.<locals>.<genexpr>.   s   è ø€ Ò9 3”c˜#—hÑ9ùs   ‚)Úsortedr    )r!   s    r&   Úget_formatted_file_tagszWheel.get_formatted_file_tags,   s   € äÑ9¨$¯.©.Ô9Ó9Ð9ó    Útagsc                 ón   ‡ — 	 t        ˆ fd„t        |«      D «       «      S # t        $ r t        «       ‚w xY 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.
        c              3   óF   •K  — | ]  \  }}|‰j                   v sŒ|–— Œ y ­wr*   )r    )r,   ÚiÚtr!   s      €r&   r.   z*Wheel.support_index_min.<locals>.<genexpr>>   s    øè ø€ ÒM™d˜a ¸¸d¿n¹nÒ9LœÑMùs   ƒ!š!)ÚnextÚ	enumerateÚStopIterationÚ
ValueError©r!   r2   s   ` r&   Úsupport_index_minzWheel.support_index_min0   s4   ø€ ð	ÜÓM¤i°£oÔMÓMÐMøÜò 	Ü“,Ðð	ús   ƒ   4Útag_to_priorityc                 ó@   ‡— t        ˆfd„| j                  D «       «      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.
        c              3   ó2   •K  — | ]  }|‰v sŒ‰|   –— Œ y ­wr*   © )r,   r-   r=   s     €r&   r.   z0Wheel.find_most_preferred_tag.<locals>.<genexpr>S   s"   øè ø€ ò 
Ø%(¸cÀ_Ò>TˆO˜CÕ ñ
ùs   ƒ	�
)Úminr    )r!   r2   r=   s     `r&   Úfind_most_preferred_tagzWheel.find_most_preferred_tagB   s#   ø€ ô" ó 
Ø,0¯N©Nô
ó 
ð 	
r1   c                 ó:   — | j                   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    Ú
isdisjointr;   s     r&   Ú	supportedzWheel.supportedW   s   € ð
 —>‘>×,Ñ,¨TÓ2Ð2Ð2r1   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__ÚreÚcompileÚVERBOSEr   r+   r'   r   r0   r   Úintr<   r   rB   r   ÚboolrE   r@   r1   r&   r	   r	      s�   „ Ùà�B—J‘Jð	ð 	�
‰
ó	€Mð
 ð 
¨ó 
ð,:¨¨c©ó :ð d¨3¡ið °Có ð$
Ø˜‘Ið
Ø04°S¸#°X±ð
à	ó
ð*3˜h s™mð 3°ô 3r1   r	   )rI   rJ   Útypingr   r   r   Úpip._vendor.packaging.tagsr   Úpip._internal.exceptionsr   r	   r@   r1   r&   ú<module>rR      s'   ðñó 
ß 'Ñ 'å *å 9÷P3ò P3r1   