3
Re
@ sT d Z ddlZddlmZ ddlmZ ddlmZ er@ddlm Z G dd de
ZdS ) z`Represents a wheel file and provides access to the various parts of the
name that have meaning.
N)Tag)InvalidWheelFilename)MYPY_CHECK_RUNNING)Listc @ s> e Zd ZdZejdejZdd Zdd Z dd Z
d d
ZdS )WheelzA wheel filez^(?P(?P.+?)-(?P.*?))
((-(?P\d[^-]*?))?-(?P.+?)-(?P.+?)-(?P.+?)
\.whl|\.dist-info)$c s j j|}|stdj|| _|jdjdd _|jdjdd _|jd _ |jdj
d _|jd j
d _|jd
j
d _
fdd jD _d
S )zX
:raises InvalidWheelFilename: when the filename is invalid for a wheel
z!{} is not a valid wheel filename.name_-verbuildpyver.abiplatc s0 h | ](} j D ]} jD ]}t|||qqqS )abisplatsr ).0xyz)selfr /builddir/build/BUILDROOT/alt-python36-pip-20.2.4-5.el9.x86_64/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/models/wheel.py . s z!Wheel.__init__..N)
wheel_file_rematchr formatfilenamegroupreplacer version build_tagsplit
pyversionsr r file_tags)r r
wheel_infor )r r __init__ s
zWheel.__init__c C s t dd | jD S )z4Return the wheel's tags as a sorted list of strings.c s s | ]}t |V qd S )N)str)r tagr r r 6 s z0Wheel.get_formatted_file_tags..)sortedr$ )r r r r get_formatted_file_tags3 s zWheel.get_formatted_file_tagsc s t fdd| jD 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 s | ]}| kr j |V qd S )N)index)r r( )tagsr r r) F s z*Wheel.support_index_min..)minr$ )r r- r )r- r support_index_min8 s zWheel.support_index_minc C s | j 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$
isdisjoint)r r- r r r supportedH s zWheel.supportedN)__name__
__module____qualname____doc__recompileVERBOSEr r&