8fR? dZddlmZddlZddlZddlmZmZmZm Z m Z m Z ddl m Z mZmZmZgdZe e eefdfZe eee eeffZe ee e e eefe ee eefffdffZe ee edfeeeefZeeegefZGd d eZd)dZGddeZGddZdZeZ GddeZ!d*dZ"ej#dZ$d+dZ%d,d(Z&dS)-zN .. testsetup:: from pip._vendor.packaging.version import parse, Version ) annotationsN)AnyCallable NamedTuple SupportsIntTupleUnion)Infinity InfinityTypeNegativeInfinityNegativeInfinityType)VERSION_PATTERNparseVersionInvalidVersion.cLeZdZUded<ded<ded<ded<ded<d ed <d S) _Versionintepochtuple[int, ...]releasetuple[str, int] | NonedevprepostLocalType | NonelocalN)__name__ __module__ __qualname____annotations__}/builddir/build/BUILD/imunify360-venv-2.3.5/opt/imunify360/venv/lib/python3.11/site-packages/pip/_vendor/packaging/version.pyrr&sWJJJ    r$rversionstrreturnrc t|S)zParse the given version string. >>> parse('1.0.dev1') :param version: The version string to parse. :raises InvalidVersion: When the version string is not a valid version. )r)r&s r%rr/s 7  r$ceZdZdZdS)rzRaised when a version string is not a valid version. >>> Version("invalid") Traceback (most recent call last): ... packaging.version.InvalidVersion: Invalid version: 'invalid' N)rr r!__doc__r#r$r%rr;sr$rcReZdZUded<ddZddZdd Zdd Zdd Zdd Z ddZ dS) _BaseVersionztuple[Any, ...]_keyr(rc*t|jSN)hashr.selfs r%__hash__z_BaseVersion.__hash__HsDIr$otherboolcZt|tstS|j|jkSr0 isinstancer-NotImplementedr.r3r5s r%__lt__z_BaseVersion.__lt__N)%.. "! !y5:%%r$cZt|tstS|j|jkSr0r8r;s r%__le__z_BaseVersion.__le__T)%.. "! !yEJ&&r$objectcZt|tstS|j|jkSr0r8r;s r%__eq__z_BaseVersion.__eq__Zr@r$cZt|tstS|j|jkSr0r8r;s r%__ge__z_BaseVersion.__ge__`r@r$cZt|tstS|j|jkSr0r8r;s r%__gt__z_BaseVersion.__gt__fr=r$cZt|tstS|j|jkSr0r8r;s r%__ne__z_BaseVersion.__ne__lr@r$Nr(r)r5r-r(r6)r5rAr(r6) rr r!r"r4r<r?rCrErGrIr#r$r%r-r-Es &&&& '''' '''' '''' &&&& ''''''r$r-a v? (?: (?:(?P[0-9]+)!)? # epoch (?P[0-9]+(?:\.[0-9]+)*) # release segment (?P
                                          # pre-release
            [-_\.]?
            (?Palpha|a|beta|b|preview|pre|c|rc)
            [-_\.]?
            (?P[0-9]+)?
        )?
        (?P                                         # post release
            (?:-(?P[0-9]+))
            |
            (?:
                [-_\.]?
                (?Ppost|rev|r)
                [-_\.]?
                (?P[0-9]+)?
            )
        )?
        (?P                                          # dev release
            [-_\.]?
            (?Pdev)
            [-_\.]?
            (?P[0-9]+)?
        )?
    )
    (?:\+(?P[a-z0-9]+(?:[-_\.][a-z0-9]+)*))?       # local version
ceZdZUdZejdezdzejejzZ	de
d<d"d
Zd#dZd#dZ
ed$dZed%dZed&dZed'dZed'dZed(dZed#dZed#dZed)dZed)dZed)dZed$dZed$dZed$d Zd!S)*raThis class abstracts handling of a project's versions.

    A :class:`Version` instance is comparison aware and can be compared and
    sorted using the standard Python interfaces.

    >>> v1 = Version("1.0a5")
    >>> v2 = Version("1.0")
    >>> v1
    
    >>> v2
    
    >>> v1 < v2
    True
    >>> v1 == v2
    False
    >>> v1 > v2
    False
    >>> v1 >= v2
    False
    >>> v1 <= v2
    True
    z^\s*z\s*$CmpKeyr.r&r'r(Nonec|j|}|std|dt|dr"t|dndt
d|ddDt|d|d	t|d
|dp|dt|d
|dt|d|_
t|j
j|j
j
|j
j|j
j|j
j|j
j|_dS)aCInitialize a Version object.

        :param version:
            The string representation of a version which will be parsed and normalized
            before use.
        :raises InvalidVersion:
            If the ``version`` does not conform to PEP 440 in any way then this
            exception will be raised.
        zInvalid version: ''rrc34K|]}t|VdSr0)r.0is  r%	z#Version.__init__..s(LLQ#a&&LLLLLLr$r.pre_lpre_npost_lpost_n1post_n2dev_ldev_nr)rrrrrrN)_regexsearchrrgrouprtuplesplit_parse_letter_version_parse_local_version_version_cmpkeyrrrrrrr.)r3r&matchs   r%__init__zVersion.__init__s""7++	B !@g!@!@!@AAA!/4{{7/C/CJ#ekk'**+++LL%++i*@*@*F*Fs*K*KLLLLL%ekk'&:&:EKK>> Version('1.0.0')
        
        z
r#r2s r%__repr__zVersion.__repr__s&D%%%%r$cBg}|jdkr||jd|dd|jD|j7|dd|jD|j|d|j|j|d	|j|j|d
|jd|S)zA string representation of the version that can be rounded-tripped.

        >>> str(Version("1.0a5"))
        '1.0a5'
        r!rUc34K|]}t|VdSr0r'rRxs  r%rTz"Version.__str__..(;;c!ff;;;;;;r$Nc34K|]}t|VdSr0rmrns  r%rTz"Version.__str__..s( : :AQ : : : : : :r$z.postz.dev+)rappendjoinrrrrrr3partss  r%__str__zVersion.__str__s":??LLDJ)))***	SXX;;dl;;;;;<<<8LL : : : : :::;;;9 LL,,,---8LL***+++:!LL)TZ))***wwu~~r$rc|jjS)zThe epoch of the version.

        >>> Version("2.0.0").epoch
        0
        >>> Version("1!2.0.0").epoch
        1
        )rdrr2s r%rz
Version.epochs}""r$rc|jjS)adThe components of the "release" segment of the version.

        >>> Version("1.2.3").release
        (1, 2, 3)
        >>> Version("2.0.0").release
        (2, 0, 0)
        >>> Version("1!2.0.0.post0").release
        (2, 0, 0)

        Includes trailing zeroes but not the epoch or any pre-release / development /
        post-release suffixes.
        )rdrr2s r%rzVersion.releases}$$r$rc|jjS)aThe pre-release segment of the version.

        >>> print(Version("1.2.3").pre)
        None
        >>> Version("1.2.3a1").pre
        ('a', 1)
        >>> Version("1.2.3b1").pre
        ('b', 1)
        >>> Version("1.2.3rc1").pre
        ('rc', 1)
        )rdrr2s r%rzVersion.pre&s}  r$
int | NonecB|jjr|jjdndS)zThe post-release number of the version.

        >>> print(Version("1.2.3").post)
        None
        >>> Version("1.2.3.post1").post
        1
        r
N)rdrr2s r%rzVersion.post5s#)-
(:Dt}!!$$Dr$cB|jjr|jjdndS)zThe development number of the version.

        >>> print(Version("1.2.3").dev)
        None
        >>> Version("1.2.3.dev1").dev
        1
        r
N)rdrr2s r%rzVersion.dev@s#(,}'8Bt} ##dBr$
str | Nonecp|jjr)dd|jjDSdS)zThe local version segment of the version.

        >>> print(Version("1.2.3").local)
        None
        >>> Version("1.2.3+abc").local
        'abc'
        rUc34K|]}t|VdSr0rmrns  r%rTz Version.local..Us(@@qCFF@@@@@@r$N)rdrrur2s r%rz
Version.localKs<=	88@@DM,?@@@@@@4r$cTt|dddS)zThe public portion of the version.

        >>> Version("1.2.3").public
        '1.2.3'
        >>> Version("1.2.3+abc").public
        '1.2.3'
        >>> Version("1.2.3+abc.dev1").public
        '1.2.3'
        rsr
r)r'rar2s r%publiczVersion.publicYs#4yysA&&q))r$cg}|jdkr||jd|dd|jDd|S)a]The "base version" of the version.

        >>> Version("1.2.3").base_version
        '1.2.3'
        >>> Version("1.2.3+abc").base_version
        '1.2.3'
        >>> Version("1!1.2.3+abc.dev1").base_version
        '1!1.2.3'

        The "base version" is the public version of the project without any pre or post
        release markers.
        rrkrUc34K|]}t|VdSr0rmrns  r%rTz'Version.base_version..{rpr$rq)rrtrurrvs  r%base_versionzVersion.base_versionfst:??LLDJ)))***	SXX;;dl;;;;;<<<wwu~~r$r6c&|jdup|jduS)aTWhether this version is a pre-release.

        >>> Version("1.2.3").is_prerelease
        False
        >>> Version("1.2.3a1").is_prerelease
        True
        >>> Version("1.2.3b1").is_prerelease
        True
        >>> Version("1.2.3rc1").is_prerelease
        True
        >>> Version("1.2.3dev1").is_prerelease
        True
        N)rrr2s r%
is_prereleasezVersion.is_prereleasesxt#;txt';;r$c|jduS)zWhether this version is a post-release.

        >>> Version("1.2.3").is_postrelease
        False
        >>> Version("1.2.3.post1").is_postrelease
        True
        N)rr2s r%is_postreleasezVersion.is_postreleasesy$$r$c|jduS)zWhether this version is a development release.

        >>> Version("1.2.3").is_devrelease
        False
        >>> Version("1.2.3.dev1").is_devrelease
        True
        N)rr2s r%
is_devreleasezVersion.is_devreleasesxt##r$cPt|jdkr
|jdndS)zqThe first item of :attr:`release` or ``0`` if unavailable.

        >>> Version("1.2.3").major
        1
        r
rlenrr2s r%majorz
Version.majors(#&dl"3"3q"8"8t|Aa?r$cPt|jdkr
|jdndS)zThe second item of :attr:`release` or ``0`` if unavailable.

        >>> Version("1.2.3").minor
        2
        >>> Version("1").minor
        0
        r
rrr2s r%minorz
Version.minor(#&dl"3"3q"8"8t|Aa?r$cPt|jdkr
|jdndS)zThe third item of :attr:`release` or ``0`` if unavailable.

        >>> Version("1.2.3").micro
        3
        >>> Version("1").micro
        0
        rrrr2s r%microz
Version.microrr$N)r&r'r(rM)r(r'rJ)r(r)r(r)r(r|)r(r)r(r6)rr r!r+recompilerVERBOSE
IGNORECASEr]r"rgrirxpropertyrrrrrrrrrrrrrrr#r$r%rrse.RZ/1G;RZ"-=W
X
XFLLL$
$
$
$
L&&&&B###X#
%
%
%X
%!!!X!EEEXECCCXCX
*
*
*X
*X0<<<X< %%%X%$$$X$@@@X@@@@X@@@@X@@@r$letterrnumber str | bytes | SupportsInt | Nonerc|rH|d}|}|dkrd}n|dkrd}n
|dvrd}n|dvrd	}|t|fS|s|rd	}|t|fSdS)
Nralphaabetab)crpreviewrc)revrr)lowerr)rrs  r%rbrbs#>F
WFF
v

FF
.
.
.FF
|
#
#Fs6{{""#f#s6{{""4r$z[\._-]rrcl|1tdt|DSdS)zR
    Takes a string like abc.1.twelve and turns it into ("abc", 1, "twelve").
    Nc3K|];}|s|nt|V.sU

!%=DJJLLLCII





r$)r`_local_version_separatorsra)rs r%rcrcsM


177>>




	
4r$rrrrrrrrLcPttttjdt|}||
|t
}n|t}n|}|t
}n|}|t}	n|}	|t
}
ntd|D}
|||||	|
fS)Nc|dkS)Nrr#)ros r%z_cmpkey..s
AFr$c3ZK|]&}t|tr|dfnt|fV'dS)rqN)r9rr
rQs  r%rTz_cmpkey../sP

IJz!S))DQGG0@!/D





r$)r`reversedlist	itertools	dropwhiler
r)rrrrrr_release_pre_post_dev_locals           r%reresi)*:*:HWrs#"""""				GGGGGGGGGGGGGGGGWWWWWWWWWWWW
C
C
C%S/3&'	,(#	b@b@b@b@b@lb@b@b@J	    F'BJy11				;6;6;6;6;6;6r$