h ddlZddlZddlmZmZmZmZmZddl m Z m Z Gdde Z GddeZdejjd eefd Zd ejjd eeeeeffd Zd ejjd e fd ZdS)N)AnyOptionalProtocolTuplecast)NormalizedNamecanonicalize_namecBeZdZdejjdeddfdZdefdZdS) BadMetadatadistreasonreturnNc"||_||_dSNr r )selfr r s /builddir/build/BUILD/imunify360-venv-2.5.2/opt/imunify360/venv/lib/python3.11/site-packages/pip/_internal/metadata/importlib/_compat.py__init__zBadMetadata.__init__ s  c(d|jd|jdS)NzBad metadata in z ()rrs r__str__zBadMetadata.__str__ s=$)==t{====r) __name__ __module__ __qualname__ importlibmetadata Distributionstrrrrrr r s_Y/<QU>>>>>>>rr cFeZdZdZedefdZeddZdS)BasePathaA protocol that various path objects conform. This exists because importlib.metadata uses both ``pathlib.Path`` and ``zipfile.Path``, and we need a common base for type hints (Union does not work well since ``zipfile.Path`` is too new for our linter setup). This does not mean to be exhaustive, but only contains things that present in both classes *that we need*. rctrNotImplementedErrorrs rnamez BasePath.name!###rctrr%rs rparentzBasePath.parent r(rN)rr#)rrr__doc__propertyr r'r*r!rrr#r#se$c$$$X$$$$X$$$rr#drc$t|ddS)aFind the path to the distribution's metadata directory. HACK: This relies on importlib.metadata's private ``_path`` attribute. Not all distributions exist on disk, so importlib.metadata is correct to not expose the attribute as public. But pip's code base is old and not as clean, so we do this to avoid having to rewrite too many things. Hopefully we can eliminate this some day. _pathN)getattr)r-s rget_info_locationr1%s 1gt $ $$rr ct|}|dStj|j\}}|dkr|d\}}}|r||fS|dkr |ddd}|dfSdS)zzGet a name and version from the metadata directory name. This is much faster than reading distribution metadata. N)NNz .dist-info-z .egg-infor)r1ospathsplitextr' partitionsplit)r info_locationstemsuffixr'sepversions r*parse_name_and_version_from_info_directoryr?1s&d++Mz7##M$677LD& !^^C00c7  !=  zz#q!!!$Tz :rct|dx}rt|Stt|j}t |t st|dt|S)zGet the distribution's normalized name. The ``name`` attribute is only available in Python 3.10 or later. We are targeting exactly that, but Mypy does not know this. rzinvalid metadata entry 'name')r )r?r rrr' isinstancer r )r r's rget_dist_canonical_namerBIsq :$??BBt' &&& T?? D dC H$'FGGGG T " ""r)importlib.metadatarr5typingrrrrrpip._vendor.packaging.utilsrr ValueErrorr r#rrr1r r?rBr!rrrGsK 77777777777777IIIIIIII>>>>>*>>>$$$$$x$$$( %+8 %Xh=O % % % %   ) 8C=(3- '(0 #)"4"A #n # # # # # #r