hW NddlZddlZddlZddlZddlmZddlm Z m Z m Z m Z m Z mZmZmZmZddlmZddlmZmZddlmZddlmZddlmZmZdd lmZm Z m!Z!m"Z"dd l#m$Z$dd l%m&Z&dd l'm(Z(dd l)m*Z*m+Z+ddl,m-Z-m.Z.m/Z/Gddej0j1Z2GddeZ1dS)N)PathLike) CollectionDictIterableIteratorMappingOptionalSequenceUnioncast) Requirement)NormalizedNamecanonicalize_name)Version)parse) InvalidWheelUnsupportedWheel)BaseDistributionBaseEntryPointInfoPathWheel)normalize_path)get_requirement) TempDirectory) parse_wheelread_wheel_metadata_file)BasePathget_dist_canonical_name*parse_name_and_version_from_info_directoryc eZdZdZdeejefdejddfdZe de j de d e ddfd Z d edeejfd Zd e dee fdZd ee dfdejfdZdS)WheelDistributionaAn ``importlib.metadata.Distribution`` read from a wheel. Although ``importlib.metadata.PathDistribution`` accepts ``zipfile.Path``, its implementation is too "lazy" for pip's needs (we can't keep the ZipFile handle open for the entire lifetime of the distribution object). This implementation eagerly reads the entire metadata directory into the memory instead, and operates from that. files info_locationreturnNc"||_||_dSN)_filesr$)selfr#r$s /builddir/build/BUILD/imunify360-venv-2.5.2/opt/imunify360/venv/lib/python3.11/site-packages/pip/_internal/metadata/importlib/_dists.py__init__zWheelDistribution.__init__5s  *zfnamelocationct|\}fdD}fd|D}tj|}|||S)Nc3K|]L}|d|tj|dddfVMdS)/rN) startswithpathlib PurePosixPathsplit).0r.info_dirs r* z1WheelDistribution.from_zipfile..Esr  (~~~.. 7(C););B)?@@ A      r,c8i|]\}}|t|S)r)r8fullpathrelpathr-s r* z2WheelDistribution.from_zipfile..Js:   !' -b(;;   r,)rnamelistr5r6) clsr-r.r/_pathsr#r$r9s ` @r* from_zipfilezWheelDistribution.from_zipfile=s""d++ !             %*    -hAA s5-(((r,pathctjt||jvrt |jSt |r')r5r6strr(iterFileNotFoundErrorr)rEs r*iterdirzWheelDistribution.iterdirQs>  T + +t{ : : $$ $%%%r,filenamec  |jtj|}n#t$rYdSwxYw |d}n9#t $r,}|jj}d|d|d|d}t|d}~wwxYw|S)Nzutf-8zError decoding metadata for z: z in z file) r(r5r6KeyErrordecodeUnicodeDecodeErrorr$parentr)r)rLdatatextewheelerrors r* read_textzWheelDistribution.read_textWs ;w4X>>?DD   44  *;;w''DD! * * *&-ER5RRARR8RRRE"5)) ) * s#" 00A B'A;;Bz PathLike[str]ctr')NotImplementedErrorrJs r* locate_filezWheelDistribution.locate_fileds "!r,)__name__ __module__ __qualname____doc__rr5r6bytesr+ classmethodzipfileZipFilerGrDrrrKr rWr PathrZr<r,r*r"r"*s$+w,e34+,+  ++++) O)) )  )))[)&&H&'2G)H&&&& # (3-    "c?&: ;" """"""r,r"c <eZdZdejjdeedeeddfdZe de de fdZ e d e d e d e de fd Ze d ede de fdZedee fdZedee fdZedee fdZedefdZedefdZede fdZdedefdZdee fdZdede fdZde e!fdZ"de#j$j%fdZ&de efdZ'd de(e de e)fdZ*dS)! Distributiondistr$installed_locationr%Nc0||_||_||_dSr')_dist_info_location_installed_location)r)rfr$rgs r*r+zDistribution.__init__ks!  +#5   r, directoryctj|}tjj|}||||jSr')r5rc importlibmetadatareatrQ)rArlr$rfs r*from_directoryzDistribution.from_directoryusA Y// !.11-@@s4 (<===r,metadata_contentsrL project_namectjtddj}|dz }||t jj|j }|||j dS)NroT)kindglobally_managedMETADATA) r5rcrrE write_bytesrnrorerprQ)rArrrLrstemp_dir metadata_pathrfs r*from_metadata_file_contentsz(Distribution.from_metadata_file_contents{s|< zD A A A F  !:- !!"3444!.11-2FGGs4-t444r,rUr.cL |5}t|||j}dddn #1swxYwYn-#tj$r}t |j||d}~wwxYw|||jtj |jSr') as_zipfiler"rDr/ra BadZipFilerr$r5r6)rArUr.r-rfrTs r* from_wheelzDistribution.from_wheels <!!## Pr(55b$OO P P P P P P P P P P P P P P P! < < <u~t44! ; <s4+W-B5>-R-RSSSs9A"A AAA A AA:A55A:cF|jdSt|jjSr')rjrGrQr)s r*r/zDistribution.locations$   &44&-...r,c<|jdSt|jSr')rjrGrs r*r$zDistribution.info_locations!   &44&'''r,cV|jdStt|jSr')rkrrGrs r*rgzDistribution.installed_locations)  # +4c$":;;<<???r,cLd|jdgDS)Nc,g|]}t|Sr<)r)r8extras r* z5Distribution.iter_provided_extras..s0    e $ $   r,zProvides-Extra)roget_allrs r*iter_provided_extrasz!Distribution.iter_provided_extrass6  ../?DD    r,r<extrasc#>Kd|D}|jdgD]q}t|jsV/|s!jddirVRt fd|DrVrdS)Ncg|]}d|iS)rr<)r8rTs r*rz2Distribution.iter_dependencies..s-K-K-Kqwl-K-K-Kr,z Requires-Distrc3LK|]}j|VdSr')markerevaluate)r8contextreqs r*r:z1Distribution.iter_dependencies..s3JJgSZ((11JJJJJJr,)rorrstriprrany)r)rcontexts req_stringrs @r*iter_dependencieszDistribution.iter_dependenciess-K-KF-K-K-K-//DD  J"*"2"2"4"455C:    3 3WbM B B  JJJJJJJJJ    r,)r<)+r[r\r]rnrorer rr+r`rGrrqr_r{rrpropertyr/r$rgrrrrrrboolrrrrWrrrrrrrrrr rr<r,r*rerejs6 -6 )6%X. 6  6666>s>/?>>>[> 5 55 5  555[5 TuTCT4DTTT[T/(3-///X/ (x}(((X( =HSM===X= 3333X31111X1 "S"""X";H;;;;;Xc]h3 '8N#;''''@ 5@@@@ h~&>      3 +AV      r,re)3 email.messagerimportlib.metadatarnr5raosrtypingrrrrrr r r r "pip._vendor.packaging.requirementsr pip._vendor.packaging.utilsrrpip._vendor.packaging.versionrrrpip._internal.exceptionsrrpip._internal.metadata.baserrrrpip._internal.utils.miscrpip._internal.utils.packagingrpip._internal.utils.temp_dirrpip._internal.utils.wheelrr_compatrrr rorer"r<r,r*rsE                      ;:::::IIIIIIII111111@@@@@@CCCCCCCC 433333999999666666KKKKKKKK="="="="=" *7="="="@zzzzz#zzzzzr,