8f]~ ddlmZddlZddlZddlZddlZddlZddlZddlm Z m Z m Z m Z m Z mZddlmZmZmZddlmZejdZ eeZn#e$rGdd eZYnwxYwGd d eZGd d e dZhdZhdZdhZdMdZ dNdZ!dOdZ"iddd d!d"d#d$d$d%d&d'd(d)d)d*d+d,d,d-d-d.d.d/d0d1d2d3d3d4d4d5d6d7d8dd9d:d;dd?d@dAdBdC Z#dDe#$DZ%dPdFZ&e'Z(gdGZ)e dGZ*e+gdHZ,GdIdJe eZ-GdKdLZ.dS)Q) annotationsN)AnyCallableGenericLiteral TypedDictcast) requirements specifiersutils)versionTc8eZdZUdZded<ded<d dZd d Zd S) ExceptionGroupzA minimal implementation of :external:exc:`ExceptionGroup` from Python 3.11. If :external:exc:`ExceptionGroup` is already defined by Python itself, that version is used instead. strmessagelist[Exception] exceptionsreturnNonec"||_||_dSN)rr)selfrrs ~/builddir/build/BUILD/imunify360-venv-2.3.5/opt/imunify360/venv/lib/python3.11/site-packages/pip/_vendor/packaging/metadata.py__init__zExceptionGroup.__init__&s"DL(DOOOc@|jjd|jd|jdS)N(z, )) __class____name__rr)rs r__repr__zExceptionGroup.__repr__*s*n-VV VV$/VVV VrN)rrrrrr)rr)r" __module__ __qualname____doc____annotations__rr#rrrrse   #### ) ) ) ) W W W W W Wrrc2eZdZUdZded< dfd ZxZS) InvalidMetadataz'A metadata field contains invalid data.rfieldrrrcX||_t|dSr)r+superr)rr+rr!s rrzInvalidMetadata.__init__7s(  !!!!!r)r+rrrrr)r"r$r%r&r'r __classcell__)r!s@rr*r*1sQ11JJJ;""""""""""rr*c,eZdZUdZded<ded<ded<ded<ded<ded <ded <ded <ded <ded <ded<ded<ded<ded<ded<ded<ded<ded<ded<ded<ded<ded<ded<ded<ded<ded<ded<ded <d!S)" RawMetadataaA dictionary of raw core metadata. Each field in core metadata maps to a key of this dictionary (when data is provided). The key is lower-case and underscores are used instead of dashes compared to the equivalent core metadata field. Any core metadata field that can be specified multiple times or can hold multiple values in a single field have a key with a plural name. See :class:`Metadata` whose attributes match the keys of this dictionary. Core metadata fields that can be specified multiple times are stored as a list or dict depending on which is appropriate for the field. Any fields which hold multiple values in a single field are stored as a list. rmetadata_versionnamer list[str] platformssummary descriptionkeywords home_pageauthor author_emaillicensesupported_platforms download_url classifiersrequiresprovides obsoletes maintainermaintainer_email requires_dist provides_distobsoletes_distrequires_pythonrequires_externaldict[str, str] project_urlsdescription_content_typeprovides_extradynamicN)r"r$r%r&r'r(rrr0r0@sa    IIILLLLLLNNNKKKLLL#"""OOO        "!!!rr0F)total>r2r9r;r5rr8rBr6r:r=rGrCr1rK> rMr@r?rAr4r>rErDrFrLrHr<rJdatarrr3c@d|dDS)zCSplit a string of comma-separate keyboards into a list of keywords.c6g|]}|Sr(strip).0ks r z#_parse_keywords..s / / /!AGGII / / /r,)split)rOs r_parse_keywordsrYs / /tzz# / / //rrIc i}|D]v}d|ddD}|dgtddt|z z|\}}||vrt d|||<w|S)z?Parse a list of label/URL string pairings separated by a comma.c6g|]}|Sr(rR)rTps rrVz'_parse_project_urls..s 777q777rrWr rz duplicate labels in project urls)rXextendmaxlenKeyError)rOurlspairpartslabelurls r_parse_project_urlsrhs D  $87DJJsA$6$6777 bTSAE N334555 s D===>> >U Krmsgemail.message.Messagesource bytes | strct|tr|}|S|d} |ddS#t$rt dwxYw)zGet the body of the message.Tdecodeutf8strictzpayload in an invalid encoding) isinstancer get_payloadroUnicodeDecodeError ValueError)rirkpayloadbpayloads r _get_payloadrxs&# ?((///66 ???6844 4! ? ? ?=>> > ?s AA3r9z author-emailr: classifierr>r6zdescription-content-typerKz download-urlr=rMz home-pager8r7r;rBzmaintainer-emailrCmetadata-versionr1r2rAzobsoletes-distrFplatformr4r@rErLr?rDrHrGr5r<r) z project-urlr@z provides-distzprovides-extrar?z requires-distzrequires-externalzrequires-pythonr5zsupported-platformrci|]\}}|| Sr(r()rTemailraws r rsTTT seTTTr(tuple[RawMetadata, dict[str, list[str]]]c i}i}t|trCtjtjj|}nBtjtjj |}t| D]}| }| |pg}g}d}|D] }t|tjjtfsJt|tjjrg} tj|D]J\} } | ddd} n#t$$rd} d}YnwxYw| | | fK|ttj| || |s|||<Jt*|} | |||<m| t.vr t1|dkr |d || <| t2vr||| <| d kr-t1|dkrt5|d || <| d kr+ t7||| <#t8$r |||<YwxYw|||< t;||} | r}d |vrTt=t|d }| d g!|| gnd |vr|d | nf| |d <n`#tD$rS| d g|#t|tH YnwxYwt=tJ||fS)a Parse a distribution's metadata stored as email headers (e.g. from ``METADATA``). This function returns a two-item tuple of dicts. The first dict is of recognized fields from the core metadata specification. Fields that can be parsed and translated into Python's built-in types are converted appropriately. All other fields are left as-is. Fields that are allowed to appear multiple times are stored as lists. The second dict contains all other fields from the metadata. This includes any unrecognized fields. It also includes any fields which are expected to be parsed into a built-in type but were not formatted appropriately. Finally, any fields that are expected to appear only once but are repeated are included in this dict. )policyTrprqlatin1FNr rr7rJr6rn)&rrrr}parserParserrcompat32parsestr BytesParser parsebytes frozensetkeyslowerget_allheaderHeader decode_headerrortappend make_header_EMAIL_TO_RAW_MAPPINGget_STRING_FIELDSra _LIST_FIELDSrYrhrbrxr pop setdefaultr_rursbytesr0)rOr~unparsedparsedr2headersvaluevalid_encodinghchunksbinencodingraw_namervdescription_headers r parse_emailrs/ 8:C%'H$Y$$EL,A$BBKKDQQ))1F)GGRRSWXX &++--((t#t#zz|| ..&&,"# # Aa%,"5s!;<< < <<!U\011 :<%*\%?%?%B%B 3 3MC* 68444 $* .///#+)./ MM3/2222  S!9!9&!A!ABBCCCC Q  "HTN (,,T22  #HTN  ~ % %#e**//!!HCMM % %!CMM  # #E a+E!H55CMM ' ' ' 3E : :H  ' ' '!& ' #HTNN -vt,,  -##%)#sww}/E/E%F%F"##M266=='1(**'..w7777%,M"!    M2..55   ju&=&=  > >      ,  S ! !8 ++s7%E>>F F J44KKM""AN?>N?)1.01.11.22.12.2z2.3)r1r2rceZdZUdZded<ded<ded<ddd(d Zd)dZd*dZ d+d,dZd-dZ d.dZ d/dZ d.dZ d.dZ d0d!Zd1d#Zd2d%Zd3d'ZdS)4 _ValidatoravValidate a metadata field. All _process_*() methods correspond to a core metadata field. The method is called with the field's raw value. If the raw value is valid it is returned in its "enriched" form (e.g. ``version.Version`` for the ``Version`` field). If the raw value is invalid, :exc:`InvalidMetadata` is raised (with a cause as appropriate). rr2r_MetadataVersionaddedrrrrc||_dSrr)rrs rrz_Validator.__init__s  r_ownerMetadatac8||_t||_dSr)r2_RAW_TO_EMAIL_MAPPINGr)rrr2s r __set_name__z_Validator.__set_name__s -d3 rinstancetype[Metadata]rcT|j}|j|j}|jtvs|5 t |d|j}||}n#t $rYnwxYw|||j< |j|j=n#t$rYnwxYwtt|S)N _process_) __dict___rawrr2_REQUIRED_ATTRSgetattrAttributeErrorrbr r)rrrcacher converters r__get__z_Validator.__get__s! !!$),, 9 ' '5+< )07>U$)>U>U0V0V " %(("     !di  di((    D Au~~s#A A)(A)7 B BBNricauseException | Noner*c t|j|dt|ji}||_|S)Nr+)r*r format_maprepr __cause__)rrirexcs r_invalid_metadataz_Validator._invalid_metadatasC M3>>7D4G4G*HII    rrcn|tvr||dtt|S)Nz is not a valid metadata version)_VALID_METADATA_VERSIONSrr rrrs r_process_metadata_versionz$_Validator._process_metadata_version s< 0 0 0((E)U)U)UVV V$e,,,rc|s|d tj|d|S#tj$r}||d|d}~wwxYw)N{field} is a required fieldTvalidate is invalid for {field}r)rr canonicalize_name InvalidNamerrrs r _process_namez_Validator._process_names H(()FGG G   #ED 9 9 9 9 L     ((555S)  s1AAAversion_module.Versionc|s|d tj|S#tj$r}||d|d}~wwxYw)Nrrr)rversion_moduleparseInvalidVersionrs r_process_versionz_Validator._process_versions H(()FGG G !'.. .,   ((555S)  s-AAAc8d|vr|d|S)z%Check the field contains no newlines. z{field} must be a single line)rrs r_process_summaryz_Validator._process_summary(s% 5==(()HII I rcXhd}tj}||d<||dj}}||vs||vr(|dt|d||dd}|dkr%|dt|dd h}|d d}|d kr,||vr(|d t|d||S) N> text/plain text/x-rst text/markdownz content-typez{field} must be one of z, not charsetzUTF-8z0{field} can only specify the UTF-8 charset, not GFM CommonMarkvariantrz(valid Markdown variants for {field} are ) r}r EmailMessageget_content_typerparamsrlistr) rr content_typesr content_type parametersrmarkdown_variantsrs r!_process_description_content_typez,_Validator._process_description_content_type.spEEE -,,.."'  $ $ & & , , . . N # *!  } , , EKKMM0Q0Q((PD,?,?PPuPP ..G44 g  ((TT']]TT #L1..E22 ? * *w>O/O/O((#TBS=T=T####  rr3cttj|D]?}|dvr||d|tvr||d@t ttj|S)N>r2rrzz" is not allowed as a dynamic fieldz is not a valid dynamic field)maprrrrr)rr dynamic_fields r_process_dynamicz_Validator._process_dynamicNs E22 X XM GGG,,BBB&;;;,,-V-V-VWWW<C 5))***rlist[utils.NormalizedName]cg} |D]+}|tj|d, |S#tj$r}||d|d}~wwxYw)NTrrr)rr rrr)rrnormalized_namesr2rs r_process_provides_extraz"_Validator._process_provides_extraXs $ V V ''(?t(T(T(TUUUU V$ #     ((444C)  s.5A#AA#specifiers.SpecifierSetc tj|S#tj$r}||d|d}~wwxYwNrr)r SpecifierSetInvalidSpecifierrrs r_process_requires_pythonz#_Validator._process_requires_pythongse *511 1*   ((555S)  sA?Alist[requirements.Requirement]cg} |D])}|tj|* |S#tj$r}||d|d}~wwxYwr)rr RequirementInvalidRequirementr)rrreqsreqrs r_process_requires_distz!_Validator._process_requires_distos  ; ; L4S99:::: ; K. Y Y Y((C)L)L)LTW(XX X Ys,3A!AA!)rrrr)rrr2rrr)rrrrrrr)rirrrrr*)rrrr)rrrr)rrrr)rr3rr3)rr3rr)rrrr)rr3rr)r"r$r%r&r'rrrrrrrrrrrrrr(rrrrs^IIIMMM #(4444837----     @++++ $ $ $ $      rrceZdZUdZded<eddd8d Zeddd9d ZeZ d ed< eZ ded< eZ ded< edZ ded< eZ ded< edZded< eZded< eZded< edZded< eZded< eZded < edZded!< eZded"< eZded#< ed$Zded%< ed$Zded&< eZded'< edZded(< ed$Zd)ed*< ed$Zd+ed,< ed$Zded-< ed$Zd.ed/< edZd0ed1< ed$Z ded2< ed$Z!ded3< edZ"ded4< edZ#ded5< edZ$ded6<d7S):raJRepresentation of distribution metadata. Compared to :class:`RawMetadata`, this class provides objects representing metadata fields instead of only using built-in types. Any invalid metadata will cause :exc:`InvalidMetadata` to be raised (with a :py:attr:`~BaseException.__cause__` attribute as appropriate). r0rTrrOrboolrc&|}||_|rjg} |j}t|}n.#t $r!}||d}Yd}~nd}~wwxYwt|jtz}|dhz}|D]} |r |j | j } n8#t$r+t | d| } || YMwxYwt| } | |kr3t| } t | d} || t|| #t $r} || Yd} ~ d} ~ wwxYw|rtd||S)zCreate an instance from :class:`RawMetadata`. If *validate* is true, all metadata will be validated. All exceptions related to validation will be gathered and raised as an :class:`ExceptionGroup`. Nr1unrecognized field: zW{field} introduced in metadata version {field_metadata_version}, not {metadata_version}zinvalid metadata)copyrr1rindexr*rrrrrrbrrr)clsrOrinsrr1 metadata_agemetadata_version_excfields_to_checkkeyfield_metadata_versionr field_ager+s rfrom_rawzMetadata.from_rawscee99;; + E*,J (# 7==>NOO " ( ( (!!"6777#'       ( (11OCO  23 3O& + ++'%%58\#5F5L22'%%%"1#7Uc7U7U"V"VC&--c222$H%%=$B$B2%% %|33$9#$>E"1 %!S##C '--c222$C%%%%&+++%%c********+ E$%7DDD sZ!A A7A22A7!E$B76E72C,)E+C,,AEE E<E77E<rlcJt|\}}|rPg}|D]9}|tvr|d}nd|}|t||:|rt d| |||S#t$r}t d|jdd}~wwxYw)zParse metadata from email headers. If *validate* is true, the metadata will be validated. All exceptions related to validation will be gathered and raised as an :class:`ExceptionGroup`. z has invalid datar rrzinvalid or unparsed metadataN)rrrr*rrr) r rOrr~rr unparsed_keyr exc_groups r from_emailzMetadata.from_emails$D)) X  =*,J ( J J #888!-BBBGGE\EEG!!/,"H"HIIII =$Z<<< <<h<77 7    . 0D  s&A== B"BB"z_Validator[_MetadataVersion]r1z_Validator[str]r2z"_Validator[version_module.Version]rrrz_Validator[list[str] | None]rMr4rr<z_Validator[str | None]r5r6rrKr7r8r=r9r:rrBrCr;r>z1_Validator[list[requirements.Requirement] | None]rDz*_Validator[specifiers.SpecifierSet | None]rGrHz!_Validator[dict[str, str] | None]rJz-_Validator[list[utils.NormalizedName] | None]rLrErFr?r@rAN)rOr0rrrr)rOrlrrrr)%r"r$r%r&r' classmethodrrrr1r2rrMr4r<r5r6rKr7r8r=r9r:rBrCr;r>rDrGrHrJrLrErFr?r@rAr(rrrr}s2=A66666[6p?C[66@Z\\AAAA<&JLLD((((3=*,,G>>>>:,6J---GD.8jllI::::08B 8O8O8OOOOO:&0jllG2222R*4*,,K666637Az7N7N7NNNNNL-7Z\\H99990(2 I44441+5:E+B+B+BLBBBB4%/Z\\F1111.+5:<r)s"""""" .---------''''''FN3$N*$NN)WWWWWWWWWWWWWW."""""j"""=====)5====H"     0000 %%%%P????: hN-=   :  N y y,** F &!" #$"$&$,(/9<UT6K6Q6Q6S6STTTm,m,m,m,`VXX FEECD)CCCDDllllllll^g%g%g%g%g%g%g%g%g%g%sAA+*A+