HEX
Server: Apache
System: Linux srv1.prosuiteplus.com 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User: prosuiteplus (1001)
PHP: 8.3.20
Disabled: NONE
Upload Files
File: //usr/lib/python3/dist-packages/packaging/__pycache__/specifiers.cpython-38.pyc
U

��]Rz�@sLddlmZmZmZddlZddlZddlZddlZddlm	Z	m
Z
ddlmZddl
mZmZmZer�ddlmZmZmZmZmZmZmZmZmZeeefZeeeefZeeegefZGdd	�d	e �Z!Gd
d�de
ej"e#��Z$Gdd
�d
e$�Z%Gdd�de%�Z&dd�Z'Gdd�de%�Z(e�)d�Z*dd�Z+dd�Z,Gdd�de$�Z-dS)�)�absolute_import�division�print_functionN�)�string_types�with_metaclass)�MYPY_CHECK_RUNNING)�Version�
LegacyVersion�parse)	�List�Dict�Union�Iterable�Iterator�Optional�Callable�Tuple�	FrozenSetc@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�eZdZejdd��Zejdd��Zejdd��Zejdd��Zej	d	d
��Z
e
jdd
��Z
ejdd
d��Zejddd��Z
dS)�
BaseSpecifiercCsdS)z�
        Returns the str representation of this Specifier like object. This
        should be representative of the Specifier itself.
        Nr��selfrrr�__str__(szBaseSpecifier.__str__cCsdS)zF
        Returns a hash value for this Specifier like object.
        Nrrrrr�__hash__0szBaseSpecifier.__hash__cCsdS)zq
        Returns a boolean representing whether or not the two Specifier like
        objects are equal.
        Nr�r�otherrrr�__eq__7szBaseSpecifier.__eq__cCsdS)zu
        Returns a boolean representing whether or not the two Specifier like
        objects are not equal.
        Nrr!rrr�__ne__?szBaseSpecifier.__ne__cCsdS)zg
        Returns whether or not pre-releases as a whole are allowed by this
        specifier.
        Nrrrrr�prereleasesGszBaseSpecifier.prereleasescCsdS)zd
        Sets whether or not pre-releases as a whole are allowed by this
        specifier.
        Nr�r�valuerrrr%OsNcCsdS)zR
        Determines if the given item is contained within this specifier.
        Nr�r�itemr%rrr�containsWszBaseSpecifier.containscCsdS)z�
        Takes an iterable of items and filters them so that only items which
        are contained within this specifier are allowed in it.
        Nr)r�iterabler%rrr�filter^szBaseSpecifier.filter)N)N)rrr�abc�abstractmethodrr r#r$�abstractpropertyr%�setterr*r,rrrrr's 





rc@s�eZdZiZd dd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zedd��Z
edd��Zedd��Zejdd��Zdd�Zd!dd�Zd"dd�ZdS)#�_IndividualSpecifier�NcCsF|j�|�}|std�|���|�d���|�d���f|_||_dS)NzInvalid specifier: '{0}'�operator�version)�_regex�searchr�format�group�strip�_spec�_prereleases)r�specr%�matchrrr�__init__ks�z_IndividualSpecifier.__init__cCs0|jdk	rd�|j�nd}d�|jjt|�|�S)N�, prereleases={0!r}r2z<{0}({1!r}{2})>)r;r7r%�	__class__r�str�rZprerrr�__repr__ys
��z_IndividualSpecifier.__repr__cCsdj|j�S)Nz{0}{1})r7r:rrrrr�sz_IndividualSpecifier.__str__cCs
t|j�S�N)�hashr:rrrrr �sz_IndividualSpecifier.__hash__cCsTt|t�r8z|�t|��}WqHtk
r4tYSXnt||j�sHtS|j|jkSrD��
isinstancerr@rAr�NotImplementedr:r!rrrr#�s
z_IndividualSpecifier.__eq__cCsTt|t�r8z|�t|��}WqHtk
r4tYSXnt||j�sHtS|j|jkSrDrFr!rrrr$�s
z_IndividualSpecifier.__ne__cCst|d�|j|��}|S)Nz_compare_{0})�getattrr7�
_operators)r�op�operator_callablerrr�
_get_operator�s
�z"_IndividualSpecifier._get_operatorcCst|ttf�st|�}|SrD)rGr
r	r�rr4rrr�_coerce_version�sz$_IndividualSpecifier._coerce_versioncCs
|jdS)Nr�r:rrrrr3�sz_IndividualSpecifier.operatorcCs
|jdS)NrrPrrrrr4�sz_IndividualSpecifier.versioncCs|jSrD�r;rrrrr%�sz _IndividualSpecifier.prereleasescCs
||_dSrDrQr&rrrr%�scCs
|�|�SrD�r*�rr)rrr�__contains__�sz!_IndividualSpecifier.__contains__cCs>|dkr|j}|�|�}|jr&|s&dS|�|j�}|||j�S�NF)r%rO�
is_prereleaserMr3r4)rr)r%Znormalized_itemrLrrrr*�s

z_IndividualSpecifier.containsccs�d}g}d|dk	r|ndi}|D]B}|�|�}|j|f|�r |jrX|sX|jsX|�|�q d}|Vq |s||r||D]
}|VqpdS)NFr%T)rOr*rVr%�append)rr+r%�yielded�found_prereleases�kwr4�parsed_versionrrrr,�s"
��z_IndividualSpecifier.filter)r2N)N)N)rrrrJr>rCrr r#r$rMrO�propertyr3r4r%r0rTr*r,rrrrr1gs(






r1c@sveZdZdZe�dedejejB�Zdddddd	d
�Z	dd�Z
d
d�Zdd�Zdd�Z
dd�Zdd�Zdd�ZdS)�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)�==�!=�<=�>=�<�>cCst|t�stt|��}|SrD)rGr
rArNrrrrOs
zLegacySpecifier._coerce_versioncCs||�|�kSrD�rO�r�prospectiver<rrr�_compare_equal szLegacySpecifier._compare_equalcCs||�|�kSrDrlrmrrr�_compare_not_equal$sz"LegacySpecifier._compare_not_equalcCs||�|�kSrDrlrmrrr�_compare_less_than_equal(sz(LegacySpecifier._compare_less_than_equalcCs||�|�kSrDrlrmrrr�_compare_greater_than_equal,sz+LegacySpecifier._compare_greater_than_equalcCs||�|�kSrDrlrmrrr�_compare_less_than0sz"LegacySpecifier._compare_less_thancCs||�|�kSrDrlrmrrr�_compare_greater_than4sz%LegacySpecifier._compare_greater_thanN)rrr�
_regex_str�re�compile�VERBOSE�
IGNORECASEr5rJrOrorprqrrrsrtrrrrr]s �	r]cst����fdd��}|S)Ncst|t�sdS�|||�SrU)rGr	rm��fnrr�wrapped=s
z)_require_version_compare.<locals>.wrapped)�	functools�wraps)r{r|rrzr�_require_version_compare9src	@s�eZdZdZe�dedejejB�Zdddddd	d
dd�Z	e
d
d��Ze
dd��Ze
dd��Z
e
dd��Ze
dd��Ze
dd��Ze
dd��Zdd�Zedd��Zejdd��Zd S)!�	Specifiera
        (?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
            )
        )
        r^r_Z
compatibler`rarbrcrdreZ	arbitrary)�~=rfrgrhrirjrk�===cCsNd�tt�dd�t|���dd��}|d7}|�d�||�oL|�d�||�S)N�.cSs|�d�o|�d�S)NZpostZdev)�
startswith��xrrr�<lambda>��z/Specifier._compare_compatible.<locals>.<lambda>����.*rirf)�join�list�	itertools�	takewhile�_version_splitrM)rrnr<�prefixrrr�_compare_compatible�s
����
�zSpecifier._compare_compatiblec	Csz|�d�rVt|j�}t|dd��}tt|��}|dt|��}t||�\}}||kSt|�}|jsnt|j�}||kSdS)Nr����)�endswithr	Zpublicr�rA�len�_pad_version�local)	rrnr<Z
split_specZsplit_prospectiveZshortened_prospectiveZpadded_specZpadded_prospectiveZspec_versionrrrro�s

�
zSpecifier._compare_equalcCs|�||�SrD)rormrrrrp�szSpecifier._compare_not_equalcCs|t|�kSrD�r	rmrrrrq�sz"Specifier._compare_less_than_equalcCs|t|�kSrDr�rmrrrrrsz%Specifier._compare_greater_than_equalcCs<t|�}||ksdS|js8|jr8t|j�t|j�kr8dSdS�NFT)r	rV�base_version�rrnZspec_strr<rrrrsszSpecifier._compare_less_thancCs^t|�}||ksdS|js8|jr8t|j�t|j�kr8dS|jdk	rZt|j�t|j�krZdSdSr�)r	Zis_postreleaser�r�r�rrrrt#s
zSpecifier._compare_greater_thancCst|���t|���kSrD)rA�lowerrmrrr�_compare_arbitraryDszSpecifier._compare_arbitrarycCsR|jdk	r|jS|j\}}|dkrN|dkr@|�d�r@|dd�}t|�jrNdSdS)N)rfrirhr�r�rfr�r�TF)r;r:r�rrV)rr3r4rrrr%Hs


zSpecifier.prereleasescCs
||_dSrDrQr&rrrr%bsN)rrrrurvrwrxryr5rJrr�rorprqrrrsrtr�r\r%r0rrrrr�Gs<]�

(




 
r�z^([0-9]+)((?:a|b|c|rc)[0-9]+)$cCs@g}|�d�D],}t�|�}|r0|�|���q|�|�q|S)Nr�)�split�
_prefix_regexr6�extend�groupsrW)r4�resultr)r=rrrr�ks
r�c
Cs�gg}}|�tt�dd�|���|�tt�dd�|���|�|t|d�d��|�|t|d�d��|�ddgtdt|d�t|d���|�ddgtdt|d�t|d���ttj|��ttj|��fS)NcSs|��SrD��isdigitr�rrrr�|r�z_pad_version.<locals>.<lambda>cSs|��SrDr�r�rrrr�}r�rr�0)rWr�r�r�r��insert�max�chain)�left�rightZ
left_splitZright_splitrrrr�ws
,,r�c@s�eZdZddd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Zdd�Z	dd�Z
dd�Zedd��Z
e
jdd��Z
dd�Zddd�Zd dd�ZdS)!�SpecifierSetr2Nc	Csndd�|�d�D�}t�}|D]:}z|�t|��Wqtk
rV|�t|��YqXqt|�|_||_dS)NcSsg|]}|��r|���qSr)r9��.0�srrr�
<listcomp>�sz)SpecifierSet.__init__.<locals>.<listcomp>�,)	r��set�addr�rr]�	frozenset�_specsr;)rZ
specifiersr%Zsplit_specifiersZparsed�	specifierrrrr>�s
zSpecifierSet.__init__cCs*|jdk	rd�|j�nd}d�t|�|�S)Nr?r2z<SpecifierSet({0!r}{1})>)r;r7r%rArBrrrrC�s
��zSpecifierSet.__repr__cCsd�tdd�|jD���S)Nr�css|]}t|�VqdSrD)rAr�rrr�	<genexpr>�sz'SpecifierSet.__str__.<locals>.<genexpr>)r��sortedr�rrrrr�szSpecifierSet.__str__cCs
t|j�SrD)rEr�rrrrr �szSpecifierSet.__hash__cCs�t|t�rt|�}nt|t�s"tSt�}t|j|jB�|_|jdkrX|jdk	rX|j|_n<|jdk	rv|jdkrv|j|_n|j|jkr�|j|_ntd��|S)NzFCannot combine SpecifierSets with True and False prerelease overrides.)rGrr�rHr�r�r;�
ValueError)rr"r�rrr�__and__�s 





�zSpecifierSet.__and__cCs6t|ttf�rtt|��}nt|t�s*tS|j|jkSrD�rGrr1r�rArHr�r!rrrr#�s

zSpecifierSet.__eq__cCs6t|ttf�rtt|��}nt|t�s*tS|j|jkSrDr�r!rrrr$�s

zSpecifierSet.__ne__cCs
t|j�SrD)r�r�rrrr�__len__�szSpecifierSet.__len__cCs
t|j�SrD)�iterr�rrrr�__iter__�szSpecifierSet.__iter__cCs.|jdk	r|jS|jsdStdd�|jD��S)Ncss|]}|jVqdSrD�r%r�rrrr��sz+SpecifierSet.prereleases.<locals>.<genexpr>)r;r��anyrrrrr%�s

zSpecifierSet.prereleasescCs
||_dSrDrQr&rrrr%�scCs
|�|�SrDrRrSrrrrT�szSpecifierSet.__contains__csLt�ttf�st����dkr$|j��s2�jr2dSt��fdd�|jD��S)NFc3s|]}|j��d�VqdS)r�NrRr��r)r%rrr�sz(SpecifierSet.contains.<locals>.<genexpr>)rGr
r	rr%rV�allr�r(rr�rr*s
zSpecifierSet.containscCs�|dkr|j}|jr6|jD]}|j|t|�d�}q|Sg}g}|D]P}t|ttf�s^t|�}n|}t|t�rnqB|jr�|s�|s�|�	|�qB|�	|�qB|s�|r�|dkr�|S|SdS)Nr�)
r%r�r,�boolrGr
r	rrVrW)rr+r%r<ZfilteredrYr)r[rrrr,s*




zSpecifierSet.filter)r2N)N)N)rrrr>rCrr r�r#r$r�r�r\r%r0rTr*r,rrrrr��s"

		


�r�).Z
__future__rrrr-r}r�rvZ_compatrrZ_typingrr4r	r
r�typingrr
rrrrrrrZ
ParsedVersionrAZUnparsedVersionr�ZCallableOperatorr�r�ABCMeta�objectrr1r]rr�rwr�r�r�r�rrrr�<module>s2,@8#