Re8ddlZddlZddlZddlZddlmZmZmZmZm Z m Z m Z ddl m Z mZmZmZgdZe eefZe ee eeffZe eeefZe ee e ee eefe eeffdffZe ee edfeeeefZe ee edffZee eefe eefgefZejdgdZd ed e d fd ZGd deZ GddZ!Gdde!Z"ej#dej$Z%ddddddZ&ded eefdZ'd ed efdZ(dZ)Gdde!Z*dede ee+e fd ee eeffd Z,ej#d!Z-d"ed eefd#Z.d$ed%e edfd&ee eefd'ee eefd(ee eefd"ee ed efd)Z/dS)*N)CallableIteratorListOptional SupportsIntTupleUnion)Infinity InfinityTypeNegativeInfinityNegativeInfinityType)parseVersion LegacyVersionInvalidVersionVERSION_PATTERN._Version)epochreleasedevprepostlocalversionreturn)rrc` t|S#t$rt|cYSwxYw)z Parse the given version string and return either a :class:`Version` object or a :class:`LegacyVersion` object depending on if the given version is a valid PEP 440 version or a legacy version. )rrr)rs /builddir/build/BUILDROOT/alt-python311-pip-21.3.1-3.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/pip/_vendor/packaging/version.pyrr*sD &w &&&W%%%%%&s --ceZdZdZdS)rzF An invalid version was found, users should refer to PEP 440. N)__name__ __module__ __qualname____doc__rrr6sr%rceZdZUeeefed<defdZddde fdZ ddde fdZ de de fdZ ddde fdZddde fd Zde de fd Zd S) _BaseVersion_keyrc*t|jSN)hashr(selfs r__hash__z_BaseVersion.__hash__?sDIr%othercZt|tstS|j|jkSr* isinstancer'NotImplementedr(r-r/s r__lt__z_BaseVersion.__lt__E)%.. "! !y5:%%r%cZt|tstS|j|jkSr*r1r4s r__le__z_BaseVersion.__le__K)%.. "! !yEJ&&r%cZt|tstS|j|jkSr*r1r4s r__eq__z_BaseVersion.__eq__Qr9r%cZt|tstS|j|jkSr*r1r4s r__ge__z_BaseVersion.__ge__Wr9r%cZt|tstS|j|jkSr*r1r4s r__gt__z_BaseVersion.__gt__]r6r%cZt|tstS|j|jkSr*r1r4s r__ne__z_BaseVersion.__ne__cr9r%N)r r!r"r CmpKey LegacyCmpKey__annotations__intr.boolr5r8objectr;r=r?rAr$r%rr'r'<s  $ %%%%# &N&t&&&& 'N't'''' 'F't'''' 'N't'''' &N&t&&&& 'F't''''''r%r'cVeZdZdeddfdZdefdZdefdZedefdZedefdZ ede fd Z edd Z edd Z edd Zedd ZeddZedefdZedefdZedefdZdS)rrrNc`t||_t|j|_dSr*)str_version_legacy_cmpkeyr()r-rs r__init__zLegacyVersion.__init__ks$G  "4=11 r%c|jSr*rKr,s r__str__zLegacyVersion.__str__ps }r%cd|dS)Nzr$r,s r__repr__zLegacyVersion.__repr__ss+$++++r%c|jSr*rOr,s rpubliczLegacyVersion.publicv }r%c|jSr*rOr,s r base_versionzLegacyVersion.base_versionzrVr%cdS)Nr$r,s rrzLegacyVersion.epoch~srr%cdSr*r$r,s rrzLegacyVersion.releasetr%cdSr*r$r,s rrzLegacyVersion.prer\r%cdSr*r$r,s rrzLegacyVersion.postr\r%cdSr*r$r,s rrzLegacyVersion.devr\r%cdSr*r$r,s rrzLegacyVersion.localr\r%cdSNFr$r,s r is_prereleasezLegacyVersion.is_prereleaseur%cdSrbr$r,s ris_postreleasezLegacyVersion.is_postreleaserdr%cdSrbr$r,s r is_devreleasezLegacyVersion.is_devreleaserdr%)rN)r r!r"rJrMrPrSpropertyrUrXrErrrrrrrFrcrfrhr$r%rrrjs222222 ,#,,,,XcXsXXXXXXtXXtXr%rz(\d+ | [a-z]+ | \.| -)czfinal-@)rpreview-rcrsc#Kt|D]Q}t||}|r|dkr&|dddvr|dVJd|zVRdVdS)N.r 0123456789**final)_legacy_version_component_resplit_legacy_version_replacement_mapgetzfill)roparts r_parse_version_partsr|s,22155  .224>> ts{{  8| # #**Q--    *     NNNNNr%cd}g}t|D]}|drf|dkr0|r.|ddkr"||r |ddk"|r.|ddkr"||r |ddk"|||t |fS)NrZrtruz*final-00000000)r|lower startswithpopappendtuple)rrpartsr{s rrLrLs EE$W]]__55   ??3   h b Y 6 6IIKKK b Y 6 6 E"I33  E"I33  T %,, r%a v? (?: (?:(?P[0-9]+)!)? # epoch (?P[0-9]+(?:\.[0-9]+)*) # release segment (?P
                                          # pre-release
            [-_\.]?
            (?P(a|b|c|rc|alpha|beta|pre|preview))
            [-_\.]?
            (?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
cVeZdZejdezdzejejzZde	ddfdZ
de	fdZde	fdZe
defd	Ze
deed
ffdZe
deee	effdZe
deefd
Ze
deefdZe
dee	fdZe
de	fdZe
de	fdZe
defdZe
defdZe
defdZe
defdZe
defdZe
defdZdS)rz^\s*z\s*$rrNc|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)NzInvalid version: ''rrc34K|]}t|VdSr*)rE.0is  r	z#Version.__init__..
s(LLQ#a&&LLLLLLr%rrqpre_lpre_npost_lpost_n1post_n2dev_ldev_nr)rrrrrr)_regexsearchrrgrouprErrw_parse_letter_version_parse_local_versionrK_cmpkeyrrrrrrr()r-rmatchs   rrMzVersion.__init__s""7++	B !@g!@!@!@AAA!/4{{7/C/CJ#ekk'**+++LL%++i*@*@*F*Fs*K*KLLLLL%ekk'&:&:EKK.((;;c!ff;;;;;;r%c34K|]}t|VdSr*rrs  rrz"Version.__str__..,s( : :AQ : : : : : :r%z.postz.dev+)rrjoinrrrrrr-rs  rrPzVersion.__str__ s :??LLDJ)))***	SXX;;dl;;;;;<<<8LL : : : : :::;;;9 LL,,,---8LL***+++:!LL)TZ))***wwu~~r%c|jj}|Sr*)rKr)r-_epochs  rrz
Version.epoch<sm)
r%.c|jj}|Sr*)rKr)r-_releases  rrzVersion.releaseAs$(M$9r%c|jj}|Sr*)rKr)r-_pres  rrzVersion.preFs*.-*;r%cB|jjr|jjdndSNr
)rKrr,s rrzVersion.postKs!(,
(:Dt}!!$$Dr%cB|jjr|jjdndSr)rKrr,s rrzVersion.devOs!'+}'8Bt} ##dBr%cp|jjr)dd|jjDSdS)Nrqc34K|]}t|VdSr*rrs  rrz Version.local..Vs(@@qCFF@@@@@@r%)rKrrr,s rrz
Version.localSs:=	88@@DM,?@@@@@@4r%cTt|dddS)Nrr
r)rJrwr,s rrUzVersion.publicZs!4yysA&&q))r%cg}|jdkr||jd|dd|jDd|S)Nrrrqc34K|]}t|VdSr*rrs  rrz'Version.base_version..grr%r)rrrrrs  rrXzVersion.base_version^sr:??LLDJ)))***	SXX;;dl;;;;;<<<wwu~~r%c&|jdup|jduSr*)rrr,s rrczVersion.is_prereleaseksxt#;txt';;r%c|jduSr*)rr,s rrfzVersion.is_postreleaseosy$$r%c|jduSr*)rr,s rrhzVersion.is_devreleasessxt##r%cPt|jdkr
|jdndS)Nr
rlenrr,s rmajorz
Version.majorw&"%dl"3"3q"8"8t|Aa?r%cPt|jdkr
|jdndS)Nr
rrr,s rminorz
Version.minor{rr%cPt|jdkr
|jdndS)Nrrrr,s rmicroz
Version.microrr%) r r!r"recompilerVERBOSE
IGNORECASErrJrMrSrPrirErrrrrrrrrUrXrFrcrfrhrrrr$r%rrrs
RZ/1G;RZ"-=W
X
XF





:&#&&&&8sXsCxXXeCHo.XEhsmEEEXECXc]CCCXCx}X****X*
c


X
F
WFF
v

FF
.
.
.FF
|
#
#Fs6{{""#f#s6{{""4r%z[\._-]rcl|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_separatorsrw)rs rrrsM


177>>




	
4r%rrrrrcPttttjdt|}||
|t
}n|t}n|}|t
}n|}|t}	n|}	|t
}
ntd|D}
|||||	|
fS)Nc|dkS)Nrr$)rs rz_cmpkey..s
AFr%c3ZK|]&}t|tr|dfnt|fV'dS)rN)r2rEr
rs  rrz_cmpkey..sP

IJz!S))DQGG0@!/D





r%)rreversedlist	itertools	dropwhiler
r)rrrrrrrr_post_dev_locals           rrrsi)*:*:HWrs*
				PPPPPPPPPPPPPPPPPPWWWWWWWWWWWW
T
T
Tl$889
}eCHo56]C,-	
,#$&45
7	

		


	
sCx...)S
S%S/)*"
6< %(<"=>D";!CCC
	&3	&5!;<	&	&	&	&Z+'+'+'+'+'+'+'+'\66666L666r *rz*CRZPP	

##CHSM"CL:@E@E@E@E@E@lE@E@E@P!!sE;67!
eCHo!!!!H'BJy11		(;				<6<6
38_<6
%S/	"<65c?
#	<6

%S/	"<6E,'(
<6<6<6<6<6<6<6r%