Reh ddlZddlmZmZmZmZmZddlmZm Z ddl m Z m Z eedee effZedeZGdd eZGd d eZejd Zejd ZdedefdZdee efdefdZdedeee eeeffdZdedeee ffdZdS)N) FrozenSetNewTypeTupleUnioncast)Tag parse_tag)InvalidVersionVersionNormalizedNameceZdZdZdS)InvalidWheelFilenamezM An invalid wheel filename was found, users should refer to PEP 427. N__name__ __module__ __qualname____doc__r /builddir/build/BUILDROOT/alt-python311-pip-21.3.1-3.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/pip/_vendor/packaging/utils.pyrrrrceZdZdZdS)InvalidSdistFilenamez^ An invalid sdist filename was found, users should refer to the packaging user guide. Nrr rrrrrrrz[-_.]+z (\d+)(.*)namereturnctd|}tt|S)N-)_canonicalize_regexsublowerrr)rvalues rcanonicalize_namer# s3  # #C . . 4 4 6 6E  & &&rversionc t|tr# t|}n#t$r|cYSwxYw|}g}|jdkr||jd|t jdddd|j D|j 7|dd|j D|j |d |j |j |d |j |j |d |j d|S) z This is very similar to Version.__str__, but has one subtle difference with the way it handles the release segment. r!z(\.0)+$.c34K|]}t|VdSNstr.0xs r z'canonicalize_version..<s(0P0PAQ0P0P0P0P0P0PrNc34K|]}t|VdSr*r+r-s rr0z'canonicalize_version..@s(88SVV888888rz.postz.dev+) isinstancer,r r epochappendrer joinreleaseprepostdevlocal)r$parsedpartss rcanonicalize_versionr?&s '3 W%%FF   NNN  E|q  '''((( LL B0P0P0P0P0P(P(PQQRRRz RWW88VZ88888999{ *V[**+++z (FJ(()))| '''((( 775>>s ' 66filenamec|dstd||dd}|d}|dvrtd||d|dz }|d}d |vs t jd |tjtd |t|}t|d }|d kr|d}t|}|td|d|dttt| d | df}nd}t|d} |||| fS)Nz.whlz3Invalid wheel filename (extension must be '.whl'): r)z0Invalid wheel filename (wrong number of parts): r__z ^[\w\d._]*$zInvalid project name: rrDzInvalid build number: z in ''r )endswithrcountsplitr6matchUNICODEr#r _build_tag_regexrBuildTagintgroupr ) r@dashesr> name_partrr$ build_part build_matchbuildtagss rparse_wheel_filenamerXQs   V $ $ " L( L L   }H ^^C F V" Ix I I    NN3 + +EaI yBH^Y KKS"#FH#F#FGGG Y ' 'DeAhG {{1X &,,Z88  &EEE(EEE XK$5$5a$8$8 9 9;;L;LQ;O;OPQQ U2Y  D '5$ ''rc||dr|dtd }n@|dr|dtd }ntd||d\}}}|std|t |}t |}||fS)Nz.tar.gzz.zipz@Invalid sdist filename (extension must be '.tar.gz' or '.zip'): rzInvalid sdist filename: )rIlenr rpartitionr#r )r@ file_stemrSsep version_partrr$s rparse_sdist_filenamer_us## .I./   6 " " ^F |^, "      $-#7#7#<#< IsL J"#Hh#H#HIII Y ' 'Dl##G '?r)r6typingrrrrrrWr r r$r r rPr,rOr ValueErrorrrcompilerrNr#r?rXr_r rrrcs  99999999999999 ,,,,,,,, rE#s(O+ ,)3//: : !bj++2:l++'C'N'''' (% "5(#((((V!(!( >7Hin <=!(!(!(!(H351H+Ir