7iPdZddlZddlmZmZmZddlmZddlm Z GddZ y)z`Represents a wheel file and provides access to the various parts of the name that have meaning. N)DictIterableList)Tag)InvalidWheelFilenameceZdZdZej dej ZdeddfdZ de efdZ de e de fd Zde e d ee e fde fd Zdee defd Zy) Wheelz A wheel filez^(?P(?P[^\s-]+?)-(?P[^\s-]*?)) ((-(?P\d[^-]*?))?-(?P[^\s-]+?)-(?P[^\s-]+?)-(?P[^\s-]+?) \.whl|\.dist-info)$filenamereturnNc |jj|}|st|d||_|j dj dd|_|j dj dd|_|j d|_|j djd|_ |j d jd|_ |j d jd|_ |jDchc]1}|jD] }|jD]}t|||"3c}}}|_y cc}}}w) zX :raises InvalidWheelFilename: when the filename is invalid for a wheel z is not a valid wheel filename.name_-verbuildpyver.abiplatN) wheel_file_rematchrr groupreplacer version build_tagsplit pyversionsabisplatsr file_tags)selfr wheel_infoxyzs c/mnt/ssd/data/python-lab/ChefSystem/venv/lib/python3.12/site-packages/pip/_internal/models/wheel.py__init__zWheel.__init__s;''--h7 &(3R'ST T  $$V,44S#> "''.66sC@ #))'2$**7399#>$$U+11#6 %%f-33C8 #'//  499 67djj IJC1aL    s6Ec:td|jDS)z4Return the wheel's tags as a sorted list of strings.c32K|]}t|ywN)str).0tags r& z0Wheel.get_formatted_file_tags...s93c#h9s)sortedr )r!s r&get_formatted_file_tagszWheel.get_formatted_file_tags,s9$..999tagscn tfdt|DS#t$r twxYw)aReturn 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. c3FK|]\}}|jvs|ywr*)r )r,itr!s r&r.z*Wheel.support_index_min..>s Mdadnn9LMs!!)next enumerate StopIteration ValueErrorr!r2s` r&support_index_minzWheel.support_index_min0s4 MioMM M ,  s 4tag_to_priorityc@tfd|jDS)aReturn 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. c32K|]}|vs|ywr*)r,r-r=s r&r.z0Wheel.find_most_preferred_tag..Ss" %(c_>TOC  s  )minr )r!r2r=s `r&find_most_preferred_tagzWheel.find_most_preferred_tagBs#" ,0NN   r1c:|jj| S)zReturn 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.supportedWs >>,,T222r1)__name__ __module__ __qualname____doc__recompileVERBOSErr+r'rr0rintr<rrBrboolrEr@r1r&r r sBJJ  M   ,:c:d3iC$ I 04S#X  *3hsm33r1r ) rIrJtypingrrrpip._vendor.packaging.tagsrpip._internal.exceptionsrr r@r1r&rRs' ''*9P3P3r1