fddlmZddlZddlmZmZmZmZddlm Z m Z ddl m Z m Z eedeeeffZedeZGd d eZGd d eZGd deZej,dej.Zej,dZej,dZej,dZddddZddZdd ddZ ddZd dZ y)!) annotationsN)NewTypeTupleUnioncast)Tag parse_tag)InvalidVersionVersionNormalizedNameceZdZdZy) InvalidNamezW An invalid distribution name; users should refer to the packaging user guide. N__name__ __module__ __qualname____doc__r X/var/lib/jenkins/workspace/mettalog/venv/lib/python3.12/site-packages/packaging/utils.pyrrrrceZdZdZy)InvalidWheelFilenamezM An invalid wheel filename was found, users should refer to PEP 427. Nrr rrrrrrrceZdZdZy)InvalidSdistFilenamez^ An invalid sdist filename was found, users should refer to the packaging user guide. Nrr rrrrrrrz)^([A-Z0-9]|[A-Z0-9][A-Z0-9._-]*[A-Z0-9])$z[-_.]+z/^([a-z0-9]|[a-z0-9]([a-z0-9-](?!--))*[a-z0-9])$z (\d+)(.*)F)validatec|r#tj|std|tj d|j }t t|S)Nzname is invalid: -)_validate_regexmatchr_canonicalize_regexsublowerrr)namervalues rcanonicalize_namer'-sM--d3-dX677  # #C . 4 4 6E  &&rc0tj|duSN)_normalized_regexr!)r%s ris_normalized_namer+5s  " "4 ( 44rT)strip_trailing_zeroct|tr t|}n|}g}|jdk7r|j |jddj d|jD}|rtjdd|}|j ||j1|j dj d|jD|j|j d|j|j|j d |j|j|j d |jdj |S#t$r|cYSwxYw) z This is very similar to Version.__str__, but has one subtle difference with the way it handles the release segment. r!.c32K|]}t|ywr)str.0xs r z'canonicalize_version..Ps>!s1v>z(\.0)+$c32K|]}t|ywr)r1r3s rr6z'canonicalize_version..Xs8SV8r7z.postz.dev+) isinstancer2r r epochappendjoinreleaserer#prepostdevlocal)versionr,parsedpartsrelease_segments rcanonicalize_versionrI9sB'3 W%F  E||q  ~Q'(hh>v~~>>O&&RA LL!zz RWW8VZZ889{{ uV[[M*+zz tFJJ<()|| q'( 775>G N s E'' E54E5c|jdstd||dd}|jd}|dvrtd||jd|dz }|d}d |vs%t j d |tj td |t|} t|d }|dk(rh|d}tj |}|td|d|dttt|jd |jdf} nd} t|d} ||| | fS#t$r}td ||d}~wwxYw)Nz.whlz3Invalid wheel filename (extension must be '.whl'): r)z0Invalid wheel filename (wrong number of parts): r__z ^[\w\d._]*$zInvalid project name: rz*Invalid wheel filename (invalid version): rMzInvalid build number: z in ''r )endswithrcountsplitr@r!UNICODEr'r r _build_tag_regexrBuildTagintgroupr ) filenamedashesrG name_partr%rEe build_part build_matchbuildtagss rparse_wheel_filenamerbis   V $"A( L  }H ^^C F V">xj I   NN3 +EaI yBHH^Y KS"%;H:#FGG Y 'D%(# {1X &,,Z8  &( E(1E XK$5$5a$8 9;;L;LQ;OPQ U2Y D '5$ ''! "8 C  s%D66 E?EEcb|jdr|dtd }n/|jdr|dtd }ntd||jd\}}}|std|t |} t |}||fS#t $r}td||d}~wwxYw)Nz.tar.gzz.zipz@Invalid sdist filename (extension must be '.tar.gz' or '.zip'): rzInvalid sdist filename: z*Invalid sdist filename (invalid version): )rRlenr rpartitionr'r r )rZ file_stemr\sep version_partr%rEr]s rparse_sdist_filenameris#.I/   6 "^F |, "z   $-#7#7#< IsL "%=hZ#HII Y 'D,' '? "8 C  s B B.B))B.)r%r2rboolreturnr)r%r2rkrj)rEz Version | strr,rjrkr2)rZr2rkz8tuple[NormalizedName, Version, BuildTag, frozenset[Tag]])rZr2rkztuple[NormalizedName, Version])! __future__rr@typingrrrrrar r rEr r rXr2rWr ValueErrorrrrcompile IGNORECASEr r"r*rVr'r+rIrbrir rrrqs # .. , rE#s(O+ ,)3/* : :"**0"--!bjj+BJJQR2::l+6;'5 <@- -48--`((((=((Vr