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 ZdZejdejƒZdd„ 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|ƒƒ‚|ˆ _|jdƒjddƒˆ _|jdƒjddƒˆ _|jdƒˆ _ |jdƒj
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Ú_ú-ÚverÚbuildÚpyverÚ.ÚabiÚplatc s0 h | ](}ˆ j D ]}ˆ jD ]}t|||ƒ’qqqS © )ÚabisÚplatsr )Ú.0ÚxÚyÚz)Úselfr ú‰/builddir/build/BUILDROOT/alt-python36-pip-20.2.4-5.el8.x86_64/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/models/wheel.pyú . s z!Wheel.__init__..N)Ú
wheel_file_reÚmatchr ÚformatÚfilenameÚgroupÚreplacer ÚversionÚ build_tagÚsplitÚ
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 )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$ Ú
isdisjoint)r r- r r r Ú supportedH s zWheel.supportedN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__ÚreÚcompileÚVERBOSEr r&