!%dp X d Z ddlZddlmZmZmZ ddlmZ ddlm Z G d d Z
dS )z`Represents a wheel file and provides access to the various parts of the
name that have meaning.
N)DictIterableList)Tag)InvalidWheelFilenamec e Zd ZdZ ej dej ZdeddfdZ de
e fdZde
e de
fd Zde
e d
eee
f de
fdZdee defdZdS )
WheelzA wheel filez^(?P(?P.+?)-(?P.*?))
((-(?P\d[^-]*?))?-(?P.+?)-(?P.+?)-(?P.+?)
\.whl|\.dist-info)$filenamereturnNc j | }|st | d | _ | d dd _ | d dd _ | d _ | d d _
| d d _ | d
d _ fd j
D _
dS )
zX
:raises InvalidWheelFilename: when the filename is invalid for a wheel
z is not a valid wheel filename.name_-verbuildpyver.abiplatc Z h | ]'}j D ]}j D ]}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_rematchr r
groupreplacer
version build_tagsplit
pyversionsr r file_tags)r r
wheel_infos ` r __init__zWheel.__init__ s< '--h77
U&('S'S'STTT
$$V,,44S#>> "''..66sC@@#))'22$**73399#>>$$U++11#66 %%f--33C88
"&/
r! c > t d | j D S )z4Return the wheel's tags as a sorted list of strings.c 3 4 K | ]}t | V d S N)str)r tags r z0Wheel.get_formatted_file_tags... s( 993c#hh999999r! )sortedr* )r s r get_formatted_file_tagszWheel.get_formatted_file_tags, s! 99$.999999r! tagsc D t fd| j D S )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 J K | ]}|v | V d S r/ )index)r r1 r5 s r r2 z*Wheel.support_index_min..= s1 LLst4::c??LLr! minr* r r5 s `r support_index_minzWheel.support_index_min0 s* LLLLdnLLLLLLr! tag_to_priorityc D t fd| 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 0 K | ]}|v | V d S r/ r )r r1 r= s r r2 z0Wheel.find_most_preferred_tag..P s;
%(c_>T>TOC >T>T>T>T
r! r9 )r r5 r= s `r find_most_preferred_tagzWheel.find_most_preferred_tag? s? "
,0N
r! c 8 | 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.supportedT s
>,,T2222r! )__name__
__module____qualname____doc__recompileVERBOSEr" r0 r, r r4 r intr<