https://t.me/RX1948
Server : Apache
System : Linux iad1-shared-b8-43 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
User : dh_edsupp ( 6597262)
PHP Version : 8.2.26
Disable Function : NONE
Directory :  /lib/python3/dist-packages/packaging/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/packaging/__pycache__/specifiers.cpython-310.pyc
o

{ۓa�u�	@s�ddlZddlZddlZddlZddlZddlmZmZmZm	Z	m
Z
mZmZm
Z
mZmZmZddlmZddlmZmZmZeeefZeeeefZeded�ZeeegefZGdd	�d	e�ZGd
d�dejd�Z Gd
d�de �Z!Gdd�de!�Z"dedeegefdedeegeffdd�Z#Gdd�de!�Z$e�%d�Z&dede
efdd�Z'dedefdd�Z(de
ede
edee
ee
effd d!�Z)Gd"d#�d#e �Z*dS)$�N)�Callable�Dict�Iterable�Iterator�List�Optional�Pattern�Set�Tuple�TypeVar�Union�)�canonicalize_version)�
LegacyVersion�Version�parse�VersionTypeVar)�boundc@seZdZdZdS)�InvalidSpecifierzH
    An invalid specifier was found, users should refer to PEP 440.
    N)�__name__�
__module__�__qualname__�__doc__�rr�6/usr/lib/python3/dist-packages/packaging/specifiers.pyr!src	@s�eZdZejdefdd��Zejdefdd��Zejde	de
fdd��Zejde
e
fd	d
��Zejde
ddfd
d
��Zejddede
e
de
fdd��Zej	ddeede
e
deefdd��ZdS)�
BaseSpecifier�returncC�dS)z�
        Returns the str representation of this Specifier like object. This
        should be representative of the Specifier itself.
        Nr��selfrrr�__str__(�zBaseSpecifier.__str__cCr)zF
        Returns a hash value for this Specifier like object.
        Nrrrrr�__hash__/r!zBaseSpecifier.__hash__�othercCr)zq
        Returns a boolean representing whether or not the two Specifier like
        objects are equal.
        Nr�rr#rrr�__eq__5r!zBaseSpecifier.__eq__cCr)zg
        Returns whether or not pre-releases as a whole are allowed by this
        specifier.
        Nrrrrr�prereleases<r!zBaseSpecifier.prereleases�valueNcCr)zd
        Sets whether or not pre-releases as a whole are allowed by this
        specifier.
        Nr�rr'rrrr&Cr!�itemr&cCr)zR
        Determines if the given item is contained within this specifier.
        Nr�rr)r&rrr�containsJr!zBaseSpecifier.contains�iterablecCr)z�
        Takes an iterable of items and filters them so that only items which
        are contained within this specifier are allowed in it.
        Nr)rr,r&rrr�filterPr!zBaseSpecifier.filter�N)rrr�abc�abstractmethod�strr �intr"�object�boolr%�abstractpropertyrr&�setterr+rrr-rrrrr's,����r)�	metaclassc@sleZdZUiZeeefed<eeed<d+dedee	ddfdd	�Z
defd
d�Zdefdd
�Ze
deeeffdd��Zdefdd�Zdede	fdd�Zdedefdd�Zdedefdd�Ze
defdd��Ze
defdd��Ze
dee	fdd ��Zejd!e	ddfd"d ��Zd#ede	fd$d%�Z	d,d#edee	de	fd&d'�Z	d,d(ee dee	dee fd)d*�Z!dS)-�_IndividualSpecifier�
_operators�_regex�N�specr&rcCsH|j�|�}|std|�d���|�d���|�d���f|_||_dS)NzInvalid specifier: '�'�operator�version)r:�searchr�group�strip�_spec�_prereleases)rr<r&�matchrrr�__init___s�
z_IndividualSpecifier.__init__cCs8|jdurd|j��nd}d|jj�dt|��|�d�S)N�, prereleases=r;�<�(�)>)rDr&�	__class__rr1�r�prerrr�__repr__ls

��z_IndividualSpecifier.__repr__cCsdj|j�S)Nz{}{})�formatrCrrrrr usz_IndividualSpecifier.__str__cCs|jdt|jd�fS)Nrr
)rCrrrrr�_canonical_specxsz$_IndividualSpecifier._canonical_speccC�
t|j�Sr.)�hashrPrrrrr"|�
z_IndividualSpecifier.__hash__r#cCsPt|t�rz	|�t|��}WntytYSwt||j�s"tS|j|jkSr.)�
isinstancer1rKr�NotImplementedrPr$rrrr%s
�z_IndividualSpecifier.__eq__�opcCst|d|j|���}|S)N�	_compare_)�getattrr9)rrV�operator_callablerrr�
_get_operator�s�z"_IndividualSpecifier._get_operatorr?cCst|ttf�st|�}|Sr.)rTrrr�rr?rrr�_coerce_version�sz$_IndividualSpecifier._coerce_versioncC�
|jdS)Nr�rCrrrrr>��
z_IndividualSpecifier.operatorcCr])Nr
r^rrrrr?�r_z_IndividualSpecifier.versioncCs|jSr.�rDrrrrr&�sz _IndividualSpecifier.prereleasesr'cC�
||_dSr.r`r(rrrr&�r_r)cC�
|�|�Sr.�r+�rr)rrr�__contains__�rSz!_IndividualSpecifier.__contains__cCs>|dur|j}|�|�}|jr|sdS|�|j�}|||j�S�NF)r&r\�
is_prereleaserZr>r?)rr)r&�normalized_itemrYrrrr+�s

z_IndividualSpecifier.containsr,ccs��d}g}d|dur|ndi}|D]#}|�|�}|j|fi|��r4|jr/|s/|js/|�|�qd}|Vq|sA|rC|D]	}|Vq;dSdSdS)NFr&T)r\r+rgr&�append)rr,r&�yielded�found_prereleases�kwr?�parsed_versionrrrr-�s*�
����z_IndividualSpecifier.filter�r;Nr.)"rrrr9rr1�__annotations__rrr4rFrNr �propertyr
rPr2r"r3r%�CallableOperatorrZ�UnparsedVersion�
ParsedVersionr\r>r?r&r6rer+rrr-rrrrr8ZsJ

	���
�����r8cs�eZdZdZe�dedejejB�Zdddddd	d
�Z	d"d
e
deeddf�fdd�
Z
dedefdd�Zded
e
defdd�Zded
e
defdd�Zded
e
defdd�Zded
e
defdd�Zded
e
defdd�Zded
e
defd d!�Z�ZS)#�LegacySpecifiera�
        (?P<operator>(==|!=|<=|>=|<|>))
        \s*
        (?P<version>
            [^,;\s)]* # Since this is a "legacy" specifier, and the version
                      # string can be just about anything, we match everything
                      # except for whitespace, a semi-colon for marker support,
                      # a closing paren since versions can be enclosed in
                      # them, and a comma since it's a version separator.
        )
        �^\s*�\s*$�equal�	not_equal�less_than_equal�greater_than_equal�	less_than�greater_than)�==�!=�<=�>=rH�>r;Nr<r&rcst��||�t�dt�dS)NzZCreating a LegacyVersion has been deprecated and will be removed in the next major release)�superrF�warnings�warn�DeprecationWarning)rr<r&�rKrrrF�s
�zLegacySpecifier.__init__r?cCst|t�stt|��}|Sr.)rTrr1r[rrrr\s
zLegacySpecifier._coerce_version�prospectivecCs||�|�kSr.�r\�rr�r<rrr�_compare_equal
�zLegacySpecifier._compare_equalcCs||�|�kSr.r�r�rrr�_compare_not_equal
r�z"LegacySpecifier._compare_not_equalcCs||�|�kSr.r�r�rrr�_compare_less_than_equalr�z(LegacySpecifier._compare_less_than_equalcCs||�|�kSr.r�r�rrr�_compare_greater_than_equalsz+LegacySpecifier._compare_greater_than_equalcCs||�|�kSr.r�r�rrr�_compare_less_thanr�z"LegacySpecifier._compare_less_thancCs||�|�kSr.r�r�rrr�_compare_greater_thanr�z%LegacySpecifier._compare_greater_thanrn)rrr�
_regex_str�re�compile�VERBOSE�
IGNORECASEr:r9r1rr4rFrrrr\r�r�r�r�r�r��
__classcell__rrr�rrt�s0� 		��
�rt�fn�	Specifierrc	s,t���dddtdtdtf�fdd��}|S)Nrr�r�r<rcst|t�sdS�|||�Srf)rTrr��r�rr�wrapped"s
z)_require_version_compare.<locals>.wrapped)�	functools�wrapsrsr1r4)r�r�rr�r�_require_version_compares r�c	@s8eZdZdZe�dedejejB�Zdddddd	d
dd�Z	e
d
edede
fdd��Ze
d
edede
fdd��Ze
d
edede
fdd��Ze
d
edede
fdd��Ze
d
edede
fdd��Ze
d
edede
fdd��Ze
d
edede
fdd��Zd
edede
fdd �Zede
fd!d"��Zejd#e
dd$fd%d"��Zd$S)&r�a
        (?P<operator>(~=|==|!=|<=|>=|<|>|===))
        (?P<version>
            (?:
                # The identity operators allow for an escape hatch that will
                # do an exact string match of the version you wish to install.
                # This will not be parsed by PEP 440 and we cannot determine
                # any semantic meaning from it. This operator is discouraged
                # but included entirely as an escape hatch.
                (?<====)  # Only match for the identity operator
                \s*
                [^\s]*    # We just match everything, except for whitespace
                          # since we are only testing for strict identity.
            )
            |
            (?:
                # The (non)equality operators allow for wild card and local
                # versions to be specified so we have to define these two
                # operators separately to enable that.
                (?<===|!=)            # Only match for equals and not equals

                \s*
                v?
                (?:[0-9]+!)?          # epoch
                [0-9]+(?:\.[0-9]+)*   # release
                (?:                   # pre release
                    [-_\.]?
                    (a|b|c|rc|alpha|beta|pre|preview)
                    [-_\.]?
                    [0-9]*
                )?
                (?:                   # post release
                    (?:-[0-9]+)|(?:[-_\.]?(post|rev|r)[-_\.]?[0-9]*)
                )?

                # You cannot use a wild card and a dev or local version
                # together so group them with a | and make them optional.
                (?:
                    (?:[-_\.]?dev[-_\.]?[0-9]*)?         # dev release
                    (?:\+[a-z0-9]+(?:[-_\.][a-z0-9]+)*)? # local
                    |
                    \.\*  # Wild card syntax of .*
                )?
            )
            |
            (?:
                # The compatible operator requires at least two digits in the
                # release segment.
                (?<=~=)               # Only match for the compatible operator

                \s*
                v?
                (?:[0-9]+!)?          # epoch
                [0-9]+(?:\.[0-9]+)+   # release  (We have a + instead of a *)
                (?:                   # pre release
                    [-_\.]?
                    (a|b|c|rc|alpha|beta|pre|preview)
                    [-_\.]?
                    [0-9]*
                )?
                (?:                                   # post release
                    (?:-[0-9]+)|(?:[-_\.]?(post|rev|r)[-_\.]?[0-9]*)
                )?
                (?:[-_\.]?dev[-_\.]?[0-9]*)?          # dev release
            )
            |
            (?:
                # All other operators only allow a sub set of what the
                # (non)equality operators do. Specifically they do not allow
                # local versions to be specified nor do they allow the prefix
                # matching wild cards.
                (?<!==|!=|~=)         # We have special cases for these
                                      # operators so we want to make sure they
                                      # don't match here.

                \s*
                v?
                (?:[0-9]+!)?          # epoch
                [0-9]+(?:\.[0-9]+)*   # release
                (?:                   # pre release
                    [-_\.]?
                    (a|b|c|rc|alpha|beta|pre|preview)
                    [-_\.]?
                    [0-9]*
                )?
                (?:                                   # post release
                    (?:-[0-9]+)|(?:[-_\.]?(post|rev|r)[-_\.]?[0-9]*)
                )?
                (?:[-_\.]?dev[-_\.]?[0-9]*)?          # dev release
            )
        )
        rurv�
compatiblerwrxryrzr{r|�	arbitrary)�~=r}r~rr�rHr��===r�r<rcCsJd�tt�tt|���dd��}|d7}|�d�||�o$|�d�||�S)N�.����.*r�r})�join�list�	itertools�	takewhile�_is_not_suffix�_version_splitrZ)rr�r<�prefixrrr�_compare_compatible�s��zSpecifier._compare_compatiblec	Csv|�d�r+t|j�}t|dd��}tt|��}|dt|��}t||�\}}||kSt|�}|js7t|j�}||kS)Nr����)�endswithr�publicr�r1�len�_pad_version�local)	rr�r<�
split_spec�split_prospective�shortened_prospective�padded_spec�padded_prospective�spec_versionrrrr��s

�
zSpecifier._compare_equalcCs|�||�Sr.)r�r�rrrr��szSpecifier._compare_not_equalcCst|j�t|�kSr.�rr�r�rrrr��sz"Specifier._compare_less_than_equalcCst|j�t|�kSr.r�r�rrrr��sz%Specifier._compare_greater_than_equal�spec_strcCs<t|�}||ks
dS|js|jrt|j�t|j�krdSdS�NFT)rrg�base_version�rr�r�r<rrrr��szSpecifier._compare_less_thancCs^t|�}||ks
dS|js|jrt|j�t|j�krdS|jdur-t|j�t|j�kr-dSdSr�)r�is_postreleaser�r�r�rrrr�s
zSpecifier._compare_greater_thancCst|���t|���kSr.)r1�lowerr�rrr�_compare_arbitrary%szSpecifier._compare_arbitrarycCsR|jdur|jS|j\}}|dvr'|dkr |�d�r |dd�}t|�jr'dSdS)N)r}r�rr�r�r}r�r�TF)rDrCr�rrg)rr>r?rrrr&(s


zSpecifier.prereleasesr'NcCrar.r`r(rrrr&Ar_)rrrr�r�r�r�r�r:r9r�rsr1r4r�r�r�r�r�r�r�rr�rpr&r6rrrrr�+sJ]�'���	z^([0-9]+)((?:a|b|c|rc)[0-9]+)$r?cCs@g}|�d�D]}t�|�}|r|�|���q|�|�q|S)Nr�)�split�
_prefix_regexr@�extend�groupsri)r?�resultr)rErrrr�Is
r��segmentcst�fdd�dD��S)Nc3s�|]}��|�VqdSr.)�
startswith)�.0r��r�rr�	<genexpr>Us�

�z!_is_not_suffix.<locals>.<genexpr>)�dev�a�b�rc�post)�anyr�rr�rr�Ts
�r��left�rightc
Cs�gg}}|�tt�dd�|���|�tt�dd�|���|�|t|d�d��|�|t|d�d��|�ddgtdt|d�t|d���|�ddgtdt|d�t|d���ttj|��ttj|��fS)NcS�|��Sr.��isdigit��xrrr�<lambda>^�z_pad_version.<locals>.<lambda>cSr�r.r�r�rrrr�_r�rr
�0)rir�r�r�r��insert�max�chain)r�r��
left_split�right_splitrrrr�Zs
,,r�c@s$eZdZ	d#dedeeddfdd�Zdefdd	�Zdefd
d�Zde	fdd
�Z
dedefddfdd�Zde
defdd�Zde	fdd�Zdeefdd�Zedeefdd��Zejdeddfdd��Zdedefdd�Z	d$dedeedefdd�Z	d$d eedeedeefd!d"�ZdS)%�SpecifierSetr;N�
specifiersr&rc	Csjdd�|�d�D�}t�}|D]}z	|�t|��Wqty*|�t|��Yqwt|�|_||_dS)NcSsg|]
}|��r|���qSr)rB�r��srrr�
<listcomp>ssz)SpecifierSet.__init__.<locals>.<listcomp>�,)	r��set�addr�rrt�	frozenset�_specsrD)rr�r&�split_specifiers�parsed�	specifierrrrrFms�

zSpecifierSet.__init__cCs.|jdurd|j��nd}dt|��|�d�S)NrGr;z<SpecifierSet(rJ)rDr&r1rLrrrrN�s

��zSpecifierSet.__repr__cCsd�tdd�|jD���S)Nr�css�|]}t|�VqdSr.)r1r�rrrr��s�z'SpecifierSet.__str__.<locals>.<genexpr>)r��sortedr�rrrrr �szSpecifierSet.__str__cCrQr.)rRr�rrrrr"�rSzSpecifierSet.__hash__r#cCs�t|t�r
t|�}nt|t�stSt�}t|j|jB�|_|jdur-|jdur-|j|_|S|jdur=|jdur=|j|_|S|j|jkrI|j|_|Std��)NzFCannot combine SpecifierSets with True and False prerelease overrides.)rTr1r�rUr�r�rD�
ValueError)rr#r�rrr�__and__�s$


�	���zSpecifierSet.__and__cCs6t|ttf�rtt|��}nt|t�stS|j|jkSr.)rTr1r8r�rUr�r$rrrr%�s

zSpecifierSet.__eq__cCrQr.)r�r�rrrr�__len__�rSzSpecifierSet.__len__cCrQr.)�iterr�rrrr�__iter__�rSzSpecifierSet.__iter__cCs.|jdur|jS|js
dStdd�|jD��S)Ncss�|]}|jVqdSr.�r&r�rrrr��s�z+SpecifierSet.prereleases.<locals>.<genexpr>)rDr�r�rrrrr&�s

zSpecifierSet.prereleasesr'cCrar.r`r(rrrr&�r_r)cCrbr.rcrdrrrre�rSzSpecifierSet.__contains__csLt�ttf�st����dur|j��s�jrdSt��fdd�|jD��S)NFc3s�|]
}|j��d�VqdS)r�Nrcr��r)r&rrr��s�z(SpecifierSet.contains.<locals>.<genexpr>)rTrrrr&rg�allr�r*rr�rr+�s
zSpecifierSet.containsr,cCs�|dur|j}|jr|jD]}|j|t|�d�}q
|Sg}g}|D](}t|ttf�s/t|�}n|}t|t�r7q!|jrD|sD|sC|�	|�q!|�	|�q!|sT|rT|durT|S|S)Nr�)
r&r�r-r4rTrrrrgri)rr,r&r<�filteredrkr)rmrrrr-�s,




�zSpecifierSet.filterrnr.)rrrr1rr4rFrNr r2r"rr�r3r%r�rr8r�rpr&r6rrrer+rrr-rrrrr�lsJ���
�	���
�����r�)+r/r�r�r�r��typingrrrrrrrr	r
rr�utilsrr?rrrrsr1rrrr4rqr�r�ABCMetarr8rtr�r�r�r�r�r�r�r�rrrr�<module>s<43
<�
�
.

https://t.me/RX1948 - 2025