!%dpXdZddlZddlmZmZmZddlmZddlm Z GddZ dS)z`Represents a wheel file and provides access to the various parts of the name that have meaning. N)DictIterableList)Tag)InvalidWheelFilenameceZdZdZejdejZdeddfdZ de efdZ de e de fd Zde e d ee e fde fd Zdee defd ZdS) Wheelz A wheel filez^(?P(?P.+?)-(?P.*?)) ((-(?P\d[^-]*?))?-(?P.+?)-(?P.+?)-(?P.+?) \.whl|\.dist-info)$filenamereturnNcj|}|st|d|_|ddd_|ddd_|d_|d d_ |d  d_ |d  d_ fd j D_ d S) zX :raises InvalidWheelFilename: when the filename is invalid for a wheel z is not a valid wheel filename.name_-verbuildpyver.abiplatc Zh|]'}jD]}jD]}t|||(S)abisplatsr).0xyzselfs /builddir/build/BUILDROOT/alt-python311-pip-21.3.1-4.el9.x86_64/opt/alt/python311/lib/python3.11/site-packages/pip/_internal/models/wheel.py z!Wheel.__init__..(s\   49  67dj  IJC1aLL     N) wheel_file_rematchrr groupreplacer version build_tagsplit pyversionsrr file_tags)rr wheel_infos` r__init__zWheel.__init__s<'--h77  U&('S'S'STT T  $$V,,44S#>> "''..66sC@@ #))'22$**73399#>>$$U++11#66 %%f--33C88     "&/   r!c>td|jDS)z4Return the wheel's tags as a sorted list of strings.c34K|]}t|VdSN)str)rtags r z0Wheel.get_formatted_file_tags...s(993c#hh999999r!)sortedr*)rs rget_formatted_file_tagszWheel.get_formatted_file_tags,s!99$.999999r!tagscDtfd|jDS)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. c3JK|]}|v|VdSr/)index)rr1r5s rr2z*Wheel.support_index_min..=s1LLst 4::c?? LLr!minr*rr5s `rsupport_index_minzWheel.support_index_min0s*LLLLdnLLLLLLr!tag_to_prioritycDtfd|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. c30K|]}|v|VdSr/r)rr1r=s rr2z0Wheel.find_most_preferred_tag..Ps;  %(c_>T>TOC >T>T>T>T  r!r9)rr5r=s `rfind_most_preferred_tagzWheel.find_most_preferred_tag?s?"    ,0N      r!c8|j| 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.supportedTs >,,T2222r!)__name__ __module__ __qualname____doc__recompileVERBOSEr"r0r,rr4rintr<rr@rboolrCrr!rr r sBJ  M      ,:c:::: Md3i MC M M M M I 04S#X     *3hsm3333333r!r ) rGrHtypingrrrpip._vendor.packaging.tagsrpip._internal.exceptionsrr rr!rrPs ''''''''''******999999M3M3M3M3M3M3M3M3M3M3r!