idZddlZddlmZmZmZmZGddeZGddeZ dej j dee fd Z d ej j de fd ZdS) N)AnyOptionalProtocolcastcBeZdZdejjdeddfdZdefdZdS) BadMetadatadistreasonreturnNc"||_||_dSNr r )selfr r s ]/opt/cloudlinux/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 Distributionstrrrrrrrs_Y/<QU>>>>>>>rrcFeZdZdZedefdZeddZdS)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*. r ctr NotImplementedErrorrs rnamez BasePath.name!###rctr r"rs rparentzBasePath.parentr%rN)r r )rrr__doc__propertyrr$r'rrrr r se$c$$$X$$$$X$$$rr dr c$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_locationr."s 1gt $ $$rr ctt|j}t|tst |d|S)zGet the distribution's project name. The ``name`` attribute is only available in Python 3.10 or later. We are targeting exactly that, but Mypy does not know this. zinvalid metadata entry 'name')r )rrr$ isinstancerr)r r$s r get_dist_namer1.s@ T?? D dC H$'FGGGG Kr)importlib.metadatartypingrrrr ValueErrorrr rrr.rr1rrrr5s000000000000>>>>>*>>>$$$$$x$$$( %+8 %Xh=O % % % %  *7 C      r