8f dZddlmZddlZddlmZddlZddlZddlZddl m Z m Z ddl m Z mZmZddlmZdd lmZmZdd lmZmZejeZGd d e ZGd de ZGdde ZGdde ZgdZdZ dZ!ej"dZ#ej"dZ$dZ%dZ&dZ'dZ(dZ)dZ*dZ+e*dzZ,d Z-d!Z.e,e.zZ/e0Z1e12e%e12e&e12e(e12e*e12e,e12e/ej"d"Z3d#Z4d$Z5d%e1DZ6d&e67DZ8d'Z9d(Z:d)Z;d*Zd-Z?e@ZAej"d.ZBd8d0ZCGd1d2e@ZDd3ZEd4ZFd5ZGGd6d7e@ZHdS)9zzImplementation of the Metadata for Python packages PEPs. Supports all metadata formats (1.0, 1.1, 1.2, 1.3/2.1 and 2.2). )unicode_literalsN)message_from_file)DistlibException __version__)StringIO string_types text_type) interpret)extract_by_key get_extras) get_schemePEP440_VERSION_REceZdZdZdS)MetadataMissingErrorzA required metadata is missingN__name__ __module__ __qualname____doc__|/builddir/build/BUILD/imunify360-venv-2.3.5/opt/imunify360/venv/lib/python3.11/site-packages/pip/_vendor/distlib/metadata.pyrrs((((rrceZdZdZdS)MetadataConflictErrorz>Attempt to read or write metadata fields that are conflictual.Nrrrrrr sHHHHrrceZdZdZdS) MetadataUnrecognizedVersionErrorz Unknown metadata version number.Nrrrrrr$s****rrceZdZdZdS)MetadataInvalidErrorzA metadata value is invalidNrrrrrr(s%%%%rr)MetadataPKG_INFO_ENCODINGPKG_INFO_PREFERRED_VERSIONutf-81.1z \| ) Metadata-VersionNameVersionPlatformSummary DescriptionKeywords Home-pageAuthor Author-emailLicense)r&r'r(r)Supported-Platformr*r+r,r-r.r/r0 Classifier Download-URL ObsoletesProvidesRequires)r4r5r6r2r3)r&r'r(r)r1r*r+r,r-r.r/ MaintainerMaintainer-emailr0r2r3Obsoletes-Dist Project-URL Provides-Dist Requires-DistRequires-PythonRequires-External)r;r<r=r9r>r7r8r:)r&r'r(r)r1r*r+r,r-r.r/r7r8r0r2r3r9r:r;r<r=r>Private-Version Obsoleted-BySetup-Requires-Dist ExtensionProvides-Extra)r?rCr@rArB)Description-Content-Typer6r5r4)rD)Dynamic License-Filez"extra\s*==\s*("([^"]+)"|'([^']+)')c|dkrtS|dkrtS|dkrtS|dvr&ttdtDzS|dkrt d|dkrt St|) N1.0r$1.2)1.32.1c3,K|]}|tv |VdSN) _345_FIELDS).0fs r z%_version2fieldlist..s,"R"RQk=Q=Q1=Q=Q=Q=Q"R"Rr2.0z+Metadata 2.0 is withdrawn and not supported2.2) _241_FIELDS _314_FIELDSrNtuple _566_FIELDS ValueError _643_FIELDSr)versions r_version2fieldlistr[vs% E   E   N " "U"R"Rk"R"R"RRRRR E  FGGG E   *7 3 33rcd}d|D}gd}|D]w}|tvr4d|vr0|dtd||t vr4d|vr0|dtd||t vr4d|vr0|dtd ||tvr4d |vr0|d td ||tvr:d |vr6|d kr0|d td||tvr4d|vr0|dtd|yt|dkr|dSt|dkr*td|tdd|vo||t}d|vo||t}d |vo||t}d|vo||t}t|t|zt|zt|zdkrtd|s|s|s|st |vrt S|rdS|rdS|rd SdS)z5Detect the best version depending on the fields used.c:tfd|DS)Nc3 K|]}|vV dSrMr)rOmarkerkeyss rrQz5_best_version.._has_marker..s'88f6T>888888r)any)r`markerss` r _has_markerz"_best_version.._has_markers&8888888888rc&g|]\}}|gddfv |S)UNKNOWNNr)rOkeyvalues r z!_best_version..s. W W WJCE"iQUAV4V4VC4V4V4Vr)rHr$rIrJrKrSrHzRemoved 1.0 due to %sr$zRemoved 1.1 due to %srIzRemoved 1.2 due to %srJzRemoved 1.3 due to %srKr+zRemoved 2.1 due to %srSzRemoved 2.2 due to %srrz)Out of options - unknown metadata set: %szUnknown metadata setz,You used incompatible 1.1/1.2/2.1/2.2 fields)itemsrTremoveloggerdebugrUrNrWrYlenr _314_MARKERS _345_MARKERS _566_MARKERS _643_MARKERSintr") fieldsrcr`possible_versionsrfis_1_1is_1_2is_2_1is_2_2s r _best_versionrys=999 X W&,,.. W W WDBBB77 k ! !e/@&@&@  $ $U + + + LL0# 6 6 6 k ! !e/@&@&@  $ $U + + + LL0# 6 6 6 k ! !e/@&@&@  $ $U + + + LL0# 6 6 6 k ! !e/@&@&@  $ $U + + + LL0# 6 6 6 k ! !e/@&@&@m##!((/// 4c::: k ! !e/@&@&@  $ $U + + + LL0# 6 6 6  "" ##   1 $ $ @&III#$:;;;' ' KKKl,K,KF ' ' KKKl,K,KF ' ' KKKl,K,KF ' ' KKKl,K,KF 6{{S[[ 3v;;.Vrs?-1DJJLLc""Drci|]\}}|| Srr)rOattrfields rrrsBBB{tUudBBBr)r<r9r;)r=)r()r)r2r4r6r5r9r;r<r>r:r1rArCrBrF)r:)r,)r.r7r*r+z[^A-Za-z0-9.]+Fc|rJtd|}td|dd}|d|S)zhReturn the distribution name with version. If for_filename is true, return a filename-escaped form.r{ .) _FILESAFEsubr~)rrZ for_filenames r_get_name_and_versionrsT@}}S$''--W__S#%>%>??ddGG $$rceZdZdZ d"dZdZdZdZdZd Z d Z d Z d Z d Z dZd#dZdZdZdZdZd#dZd#dZd$dZdZefdZd#dZd#dZdZdZdZdZd Z d!Z!dS)%LegacyMetadataaoThe legacy metadata of a release. Supports versions 1.0, 1.1, 1.2, 2.0 and 1.3/2.1 (auto-detected). You can instantiate the class with one of these arguments (or none): - *path*, the path to a metadata file - *fileobj* give a file-like object with metadata as content - *mapping* is a dict-like object - *scheme* is a version scheme name NdefaultcR|||gddkrtdi|_g|_d|_||_|||dS|||dS|+||| dSdS)N'path, fileobj and mapping are exclusive) count TypeError_fieldsrequires_files _dependenciesschemeread read_fileupdateset_metadata_version)selfpathfileobjmappingrs r__init__zLegacyMetadata.__init__s '7 # ) )$ / /! 3 3EFF F  !   IIdOOOOO  NN7 # # # # #  KK  % % ' ' ' ' '! rc>t|j|jd<dSNr&)ryrrs rrz#LegacyMetadata.set_metadata_versions+8+F+F '(((rc<||d|ddS)Nz:  )write)rrrrgs r _write_fieldzLegacyMetadata._write_fields' DDD%%%011111rc,||SrM)getrrs r __getitem__zLegacyMetadata.__getitem__sxx~~rc.|||SrM)set)rrrgs r __setitem__zLegacyMetadata.__setitem__sxxe$$$rc|||} |j|=dS#t$rt|wxYwrM) _convert_namerKeyError)rr field_names r __delitem__zLegacyMetadata.__delitem__sQ''--  ! Z((( ! ! !4..  !s!;cL||jvp|||jvSrM)rrrs r __contains__zLegacyMetadata.__contains__$s. $9""4((DL8 :rc|tvr|S|dd}t||S)Nr{r|) _ALL_FIELDSr~r} _ATTR2FIELDrrs rrzLegacyMetadata._convert_name(sE ;  K||C%%++--tT***rc.|tvs |tvrgSdS)Nre) _LISTFIELDS_ELEMENTSFIELDrs r_default_valuezLegacyMetadata._default_value.s! ;  $."8"8Iyrc|jdvrtd|Std|S)NrHr$r)metadata_version_LINE_PREFIX_PRE_1_2r_LINE_PREFIX_1_2rrgs r_remove_line_prefixz"LegacyMetadata._remove_line_prefix3s<  N 2 2'++D%88 8#''e44 4rcB|tvr||St|rM)rAttributeErrorrs r __getattr__zLegacyMetadata.__getattr__9s% ;  : T"""rFc<t|d|d|S)zhReturn the distribution name with version. If filesafe is true, return a filename-escaped form.r'r()r)rfilesafes r get_fullnamezLegacyMetadata.get_fullnameDs%T&\4 ?HMMMrc>||}|tvS)z+return True if name is a valid metadata key)rrrs ris_fieldzLegacyMetadata.is_fieldJs !!$''{""rc>||}|tvSrM)rrrs ris_multi_fieldzLegacyMetadata.is_multi_fieldOs !!$''{""rctj|dd} |||dS#|wxYw)z*Read the metadata values from a file path.rr#encodingN)codecsopenrclose)rfilepathfps rrzLegacyMetadata.readSsR [3 9 9 9  NN2    HHJJJJJBHHJJJJs AAct|}|d|jd<tD]y}||vr|tvrC||}|t vr| d|D}|||S||}||dkr|||z|}|r|n|d|d<dS)z,Read the metadata values from a file object.zmetadata-versionr&NcRg|]$}t|d%S,)rVsplitrOrgs rrhz,LegacyMetadata.read_file..hs,JJJ%eEKK$4$455JJJrrer+)rrrrget_all_LISTTUPLEFIELDSr get_payload)rfileobmsgrvaluesrgbodys rrzLegacyMetadata.read_file[s''+./A+B '(! + +EC ##U++,,,1CJJ6JJJF''''E $)););HHUE***  &*Cdd]0C]rctj|dd} ||||dS#|wxYw)z&Write the metadata fields to filepath.wr#rN)rr write_filer)rr skip_unknownrs rrzLegacyMetadata.writewsT [3 9 9 9  OOB - - - HHJJJJJBHHJJJJs AAc|t|dD]}||}|r |dgdgfvr"|tvr+|||d|V|t vr?|dkr6|jdvr|dd}n|dd}|g}|tvr d |D}|D]}||||d S) z0Write the PKG-INFO format data to a file object.r&rerr+rrr%z |c8g|]}d|Srjoinrs rrhz-LegacyMetadata.write_file..s">>>e#((5//>>>rN) rr[rrrrrrr~r)r fileobjectrrrrgs rrzLegacyMetadata.write_files; !!###'-?(@AA < >!'l!C!C!'l!C!C (((>>v>>> < <!!*eU;;;; <% < ._setsIk!!e!++C00%88888"!!!rr`N)hasattrr`ri)rotherkwargsrkvs` rrzLegacyMetadata.updates 9 9 9 9 9   UF # # ZZ\\ " "Qa!!!! "  1Q     1Q     rc||}|tvs|dkrTt|ttfs8t|t r d|dD}nCg}n@|tvr7t|ttfst|t r|g}ng}t tj r|d}t|j }|tvrS|Q|D]M}||ddstd|||Nn{|t"vr5|3||std |||n=|t&vr4|2||std ||||t*vr|d kr||}||j|<dS) z"Control then set a metadata field.r)c6g|]}|Sr)strip)rOrs rrhz&LegacyMetadata.set..s ===q===rrr'N;rz$'%s': '%s' is not valid (field '%s')z.'%s': '%s' is not a valid version (field '%s')r+)rr isinstancelistrVr rrrk isEnabledForloggingWARNINGrr_PREDICATE_FIELDSis_valid_matcherwarning_VERSIONS_FIELDSis_valid_constraint_list_VERSION_FIELDSis_valid_version_UNICODEFIELDSrr)rrrg project_namerrs rrzLegacyMetadata.sets"!!$'' ^ # #tz'9'954-00(:%.. ==EKK,<,<===k!!UT5M22"%..    w / / >33A!221773<<?CC3B(!T3333)))e.?66u==>NN#S#/>>>((U->..u55>NN#S#/>>> > ! !}$$0077" Trc||}||jvr |tur||}|S|tvr|j|}|S|t vr\|j|}|gSg}|D]D}|t vr||!||d|dfE|S|tvr7|j|}t|tr| dS|j|S)zGet a metadata field.Nrrr) rr_MISSINGrrrrappendrrr r)rrrrgresvals rrzLegacyMetadata.gets$!!$'' t| # #(""--d33N > ! !L&EL [ L&E} C 1 1///JJsOOOOJJAA/0000J ^ # #L&E%.. ({{3'''|D!!rc> |gg}}dD]}||vr|||r-|gkr'dd|z}t|dD]}||vr|||ddkr||fSt |j fd}t |ft jft j ffD]H\}}|D]@} | | d} | &|| s|d | d | AI||fS) zkCheck if the metadata is compliant. If strict is True then raise if no Name or Version are provided)r'r(zmissing required metadata: %s, )r-r.r&rIct|D]3}|ddsdS4dS)NrrFT)rr)rgrrs rare_valid_constraintsz3LegacyMetadata.check..are_valid_constraintssG ! !..qwws||A??! 55!4rNzWrong value for 'z': ) rrrrrrrrrrrr) rstrictmissingwarningsrrrrs controllerrrgrs @rcheckzLegacyMetadata.checks !!###' % %D4t$$$  ,gmm1DIIg4F4FFC&s++ ++ % %D4t$$$ " #u , ,H$ $DK((      %67L#M$4$*$C$E$3$*$;$=#> Q Q FJ   Q Q--$ZZ->->$OOO%%%$OPPP Q   rc|t|d}i}|D]A}|r ||jvr4t|}|dkr ||||<,d||D||<B|S)aReturn fields as a dict. Field names will be converted to use the underscore-lowercase style instead of hyphen-mixed case (i.e. home_page instead of Home-page). This is as per https://www.python.org/dev/peps/pep-0566/#id17. r& project_urlc8g|]}d|Srr)rOus rrhz)LegacyMetadata.todict..<s" G G G! G G Gr)rr[r _FIELD2ATTR)r skip_missingrsdatarrfs rtodictzLegacyMetadata.todict)s !!####D);$<==  H HJ H:#=#=!*--'' $Z 0DII G Gd:6F G G GDI rcV|ddkr dD] }||vr||= |dxx|z cc<dS)Nr&r$)r4r6r5r<r)r requirementsrs radd_requirementszLegacyMetadata.add_requirements@sU " #u , ,> $ $D==U  _-rcFtt|dSr)rr[rs rr`zLegacyMetadata.keysKs&t,>'?@@AAArc#@K|D]}|VdSrMr`)rrfs r__iter__zLegacyMetadata.__iter__Ns299;;  CIIII  rcDfdDS)Nc g|] }| SrrrOrfrs rrhz)LegacyMetadata.values..Ss111cS 111rr!rs`rrzLegacyMetadata.valuesRs%1111TYY[[1111rcDfdDS)Nc$g|] }||f Srrr%s rrhz(LegacyMetadata.items..Vs"888Sd3i 888rr!rs`rrizLegacyMetadata.itemsUs%8888DIIKK8888rcBd|jjd|jd|jdS)N) __class__rrrZrs r__repr__zLegacyMetadata.__repr__Xs-#~666 #|||- -rNNNrFrM)"rrrrrrrrrrrrrrrrrrrrrrrrrrrrrr`r"rrir,rrrrrs9=!(((( GGG222%%%!!!:::+++  555 ###NNNN ### ###DDD8<<<<28*#*#*#X!)"""":*!*!*!*!X....BBB222999-----rrz pydist.jsonz metadata.jsonMETADATAc^eZdZdZejdZejdejZejdejZ e Z ejdZ dZ dezZddd d Zd Zd Zedfed fe d fe d fe d fd ZdZ d8dZedZdefZdefZdefdefeeedefeeeedefddd Z[[dZd9dZdZe dZ!e dZ"e"j#dZ"d:d Z$e d!Z%e d"Z&e&j#d#Z&d$Z'd%Z(d&Z)d'Z*d(d)d*d+d,d-d.d/d0dd1 Z+d2Z,d;d5Z-d6Z.d7Z/dS)>>>>! $ $ $$2(4..9?$A$A$ADLMMOOOOOO $s7A##4BB2CCC84E..AF32F3)rrZlicensekeywordsr2r<rArCr2)r3N)r&N) run_requiresbuild_requires dev_requires test_requires meta_requiresextrasmodules namespacesexportscommands classifiers source_urlrct|d}t|d}||vr<||\}}|jr.||dn |}nt|j|}nX|dn |}|dvr|j||}n)t}|}|jd} | r|dkr| d|}n}|dkr.| d} | r| ||}nI| d } | s|jd } | r| ||}||ur|}n\||vrt||}n<|jr|j|}n|j|}|S) N common_keys mapped_keysrLrKrIrJrM extensionsrLpython.commandsrMpython.detailspython.exports)object__getattribute__r4rr5) rrfcommonmappedlkmakerresultrgsentinelds rrXzMetadata.__getattribute__s((}==((}== &==s IB| ':%*]TTFF!\--b11FF % 5577...!Z^^C77FF &xxH%F |44A ;*,,%&UU+s0 < +,1DL ) ) )%*DJz " " "rc |jr|}ng}t|pg|j}|D]q}d|vrd|vrd}nGd|vrd}n|d|v}|r'|d}|rt ||}|r||drdD]i}d|z} | |vr^|| |jd|zg}|||||j|S) a Base method to get dependencies, given a set of extras to satisfy and an optional environment context. :param reqts: A list of sometimes-wanted dependencies, perhaps dependent on extras and environment. :param extras: A list of optional components being requested. :param env: An optional environment for marker evaluation. extra environmentTrequires)builddevtestz:%s:z %s_requires)rHenv) r4r rHrr extendrjr5get_requirements) rreqtsrHr|r]r_includer_rfes rr~zMetadata.get_requirementsEs` < BFFF "dk::F 1 1!## Q(>(>"GGa''"&"#%%..F":=!"}!5!5!=&/&<&CCEMM$"7"7f.process_entriessEEE 9 9geeM***  9 9A 9u 9 ! !# =%4u%>BBFTcD||gddkrtd||rW|jr|j}n|}|r|||dS|||dS|jr|}n|j}|rtj ||ddddStj |dd5}tj ||dddddddS#1swxYwYdS) Nrz)Exactly one of path and fileobj is needed)rTr) ensure_asciiindent sort_keysrr#) rrXr;r4rrrrr5r?dumprr)rrrr1r legacy_mdr_rPs rrzMetadata.writes '?  & &! + +HII I   .| . L  OO--  I<@@@@@$$W<$HHHHH| %%''J . !W4$(******[sG44.Iaa(,......................s.DDDcR|jr|j|dS|jdg}d}|D]}d|vrd|vr|}n|d|i}|d|dSt |dt |z}t ||d<dS)NrCrwrvrxr)r4rr5rjinsertrr)rrrCalwaysentryrsets rrzMetadata.add_requirementss < 2 L ) ), 7 7 7 7 7:00DDLF%   --'2F2F"FE~%|5##Av.....6*-..\1B1BB%+D\\z"""rc b|jpd}|jpd}d|jjd|jd|d|d S)Nz (no name)z no versionr)rrqz)>)rrZr+rr)rrrZs rr,zMetadata.__repr__(sNy'K,.,$(N$;$;$;$($9$9$9444J Jrr-rM)NN)NNFT)0rrrrrecompileMETADATA_VERSION_MATCHERI NAME_MATCHERFIELDNAME_MATCHERrVERSION_MATCHERSUMMARY_MATCHERr<rr=rrrrb __slots__rrrPr none_listdict none_dictrQrXrgrkpropertyrnrpsetterr~rrr:r;rrrrrrr,rrrr r bs" *rz*:;;2:A24HHL" #A24HH'O bj--O,IN !J/O 6r:{+#[1#[1%{3 /I8<!+$+$+$+$Z#KLLKt It I)$/0$7!""#T*$d+,6K 9)))VJJJJ%(%(%(NDDXDX_++_+ ((((TX DDXD %%% / / /<<<<5>$BMAIBP$9E  N000d....4222"JJJJJrr r.)Ir __future__rrrrr?rrrrrcompatrr r rbr utilr r rZrr getLoggerrrkrrrr__all__r!r"rrrrTrUrnrNro _426_FIELDS _426_MARKERSrWrprqrYrrrEXTRA_REr[ryrrirrrrrrrrrWrrrrMETADATA_FILENAMEWHEEL_METADATA_FILENAMELEGACY_METADATA_FILENAMEr rrrrs (''''' ######  ,+++++++5555555555,,,,,,,,22222222  8 $ $)))))+)))IIIII,III+++++'7+++&&&&&+&&& J I I#2:n--!rz,// '  7 3 ! 4 BB - * L( cee ; ; ; ; ; ; 2:? @ @444$DDDP5@ CBk.?.?.A.ABBB H'> $C 688 BJ' ( (  % % % %e-e-e-e-e-Ve-e-e-P ")%JJJJJJJJJJvJJJJJJJJJJr