GddeZ?Gdde?Z@Gdd e?ZAy)") annotationsN) Collection ContainerIterableIterator)IOAny NamedTupleProtocolUnion) Requirement)InvalidSpecifier SpecifierSet)NormalizedNamecanonicalize_name)Version)NoneMetadataError) site_packages user_site)DIRECT_URL_METADATA_NAME DirectUrlDirectUrlValidationError) stdlib_pkgs)egg_link_path_from_sys_path)is_localnormalize_path) url_to_path) msg_to_jsoncBeZdZeddZeddZeddZy)BaseEntryPointctNNotImplementedErrorselfs g/mnt/ssd/data/python-lab/DaemonControl/venv/lib/python3.12/site-packages/pip/_internal/metadata/base.pynamezBaseEntryPoint.name- !##ctr#r$r&s r(valuezBaseEntryPoint.value1r*r+ctr#r$r&s r(groupzBaseEntryPoint.group5r*r+Nreturnstr)__name__ __module__ __qualname__propertyr)r-r/r+r(r!r!,s< $$$$$$r+r!c|r-|ddk(r%|r|ddk(r|dz }n|dd}|dd}|r |ddk(r%ttjg||S)aConvert a legacy installed-files.txt path into modern RECORD path. The legacy format stores paths relative to the info directory, while the modern format stores paths relative to the package root, e.g. the site-packages directory. :param entry: Path parts of the installed-files.txt entry. :param info: Path parts of the egg-info directory relative to package root. :returns: The converted entry. For best compatibility with symlinks, this does not use ``abspath()`` or ``Path.resolve()``, but tries to work with path parts: 1. While ``entry`` starts with ``..``, remove the equal amounts of parts from ``info``; if ``info`` is empty, start appending ``..`` instead. 2. Join the two directly. r..)r9Nrr2pathlibPath)entryinfos r(_convert_installed_files_pathr@:sm* E!H$tBx4' GOD9Dab  E!H$ w||*T*E* ++r+c,eZdZUded<ded<ded<y) RequiresEntryr2 requirementextramarkerN)r3r4r5__annotations__r7r+r(rBrBXs J Kr+rBceZdZed.dZe d/dZed0dZd1dZd1dZe d2dZ e d2dZ e d2dZ e d2d Z e d3d Ze d3d Ze d3d Ze d3d Ze d4dZe d5dZe d1dZe d1dZe d6dZe d1dZe d3dZe d3dZe d3dZe d3dZe d3dZd7dZd8dZd9dZd:dZ d;dZ!e"jFd;dZ$e dd?d#Z)d@d$Z*dAd%Z+dBd&Z,dBd'Z-dBd(Z.dCd)Z/d@d*Z0d@d+Z1dDd,Z2y-)EBaseDistributionct)zLoad the distribution from a metadata directory. :param directory: Path to a metadata directory, e.g. ``.dist-info``. r$)cls directorys r(from_directoryzBaseDistribution.from_directory_ "##r+ct)aLoad the distribution from the contents of a METADATA file. This is used to implement PEP 658 by generating a "shallow" dist object that can be used for resolution without downloading or building the actual dist yet. :param metadata_contents: The contents of a METADATA file. :param filename: File name for the dist with this metadata. :param project_name: Name of the project this dist represents. r$)rJmetadata_contentsfilename project_names r(from_metadata_file_contentsz,BaseDistribution.from_metadata_file_contentsgs "##r+ct)aLoad the distribution from a given wheel. :param wheel: A concrete wheel definition. :param name: File name of the wheel. :raises InvalidWheel: Whenever loading of the wheel causes a :py:exc:`zipfile.BadZipFile` exception to be thrown. :raises UnsupportedWheel: If the wheel is a valid zip, but malformed internally. r$)rJwheelr)s r( from_wheelzBaseDistribution.from_wheely "##r+cT|jd|jd|jdS)N z ())raw_name raw_versionlocationr&s r(__repr__zBaseDistribution.__repr__s*--$"2"2!32dmm_AFFr+c8|jd|jS)NrX)rZr[r&s r(__str__zBaseDistribution.__str__s--$"2"2!344r+ct)aWhere the distribution is loaded from. A string value is not necessarily a filesystem path, since distributions can be loaded from other sources, e.g. arbitrary zip archives. ``None`` means the distribution is created in-memory. Do not canonicalize this value with e.g. ``pathlib.Path.resolve()``. If this is a symbolic link, we want to preserve the relative path between it and files in the distribution. r$r&s r(r\zBaseDistribution.locationrVr+c|j}|r&|jrt|jSyt |j }|r |j Sy)zThe project location for editable distributions. This is the directory where pyproject.toml or setup.py is located. None if the distribution is not installed in editable mode. N) direct_urlis_local_editablerurlrrZr\)r'rb egg_link_paths r(editable_project_locationz*BaseDistribution.editable_project_locationsR__ ++-":>>22 8 FM}}$r+ct)aThe distribution's "installed" location. This should generally be a ``site-packages`` directory. This is usually ``dist.location``, except for legacy develop-installed packages, where ``dist.location`` is the source code location, and this is where the ``.egg-link`` file is. The returned location is normalized (in particular, with symlinks removed). r$r&s r(installed_locationz#BaseDistribution.installed_locations "##r+ct)a/Location of the .[egg|dist]-info directory or file. Similarly to ``location``, a string value is not necessarily a filesystem path. ``None`` means the distribution is created in-memory. For a modern .dist-info installation on disk, this should be something like ``{location}/{raw_name}-{version}.dist-info``. Do not canonicalize this value with e.g. ``pathlib.Path.resolve()``. If this is a symbolic link, we want to preserve the relative path between it and other files in the distribution. r$r&s r( info_locationzBaseDistribution.info_locations "##r+cf|j}|sytj|jS)aWhether this distribution is installed with legacy distutils format. A distribution installed with "raw" distutils not patched by setuptools uses one single file at ``info_location`` to store metadata. We need to treat this specially on uninstallation. F)rjr<r=is_filer'rjs r(installed_by_distutilsz'BaseDistribution.installed_by_distutilss-** ||M*2244r+cd|j}|sytj|jdk(S)zWhether this distribution is installed as an egg. This usually indicates the distribution was installed by (older versions of) easy_install. Fz.egg)r\r<r=suffixr'r\s r(installed_as_eggz!BaseDistribution.installed_as_eggs/==||H%,,66r+c|j}|sy|jdsytj|j S)aWhether this distribution is installed with the ``.egg-info`` format. This usually indicates the distribution was installed with setuptools with an old pip version or with ``single-version-externally-managed``. Note that this ensure the metadata store is a directory. distutils can also installs an ``.egg-info``, but as a file, not a directory. This property is *False* for that case. Also see ``installed_by_distutils``. Fz .egg-inforjendswithr<r=is_dirrms r("installed_with_setuptools_egg_infoz3BaseDistribution.installed_with_setuptools_egg_infos>** %%k2||M*1133r+c|j}|sy|jdsytj|j S)aaWhether this distribution is installed with the "modern format". This indicates a "modern" installation, e.g. storing metadata in the ``.dist-info`` directory. This applies to installations made by setuptools (but through pip, not directly), or anything using the standardized build backend interface (PEP 517). Fz .dist-infortrms r(installed_with_dist_infoz)BaseDistribution.installed_with_dist_infos>** %%l3||M*1133r+ctr#r$r&s r(canonical_namezBaseDistribution.canonical_name r*r+ctr#r$r&s r(versionzBaseDistribution.versionr*r+ctr#r$r&s r(r[zBaseDistribution.raw_versionr*r+c:|jjddS)zConvert a project name to its setuptools-compatible filename. This is a copy of ``pkg_resources.to_filename()`` for compatibility. -_)rZreplacer&s r(setuptools_filenamez$BaseDistribution.setuptools_filenames }}$$S#..r+c |jt} tj|S#t$rYywxYw#t t jtf$r0}tjdt|j|Yd}~yd}~wwxYw)zObtain a DirectUrl from this distribution. Returns None if the distribution has no `direct_url.json` metadata, or if `direct_url.json` is invalid. NzError parsing %s for %s: %s) read_textrFileNotFoundErrorr from_jsonUnicodeDecodeErrorjsonJSONDecodeErrorrloggerwarningr{)r'contentes r(rbzBaseDistribution.direct_urls nn%=>G &&w/ /!     $  NN-(##    s!-< 99B &BB c |jd}|j D]}|j }|s|cSy#tttf$rYywxYw)N INSTALLER)rOSError ValueErrorr splitlinesstrip)r'installer_textline cleaned_lines r( installerzBaseDistribution.installer9sd !^^K8N#--/ $D:: ! "E +D    "EG NN7DMM1 5> ! "s? A?,A:4A?:A?ct)zDependencies of this distribution. For modern .dist-info distributions, this is the collection of "Requires-Dist:" entries in distribution metadata. r$)r'extrass r(iter_dependenciesz"BaseDistribution.iter_dependenciesrMr+c:|jjdgS)zRaw Requires-Dist metadata. Requires-Dist)rget_allr&s r(iter_raw_dependenciesz&BaseDistribution.iter_raw_dependenciess}}$$_b99r+ct)ajExtras provided by this distribution. For modern .dist-info distributions, this is the collection of "Provides-Extra:" entries in distribution metadata. The return value of this function is expected to be normalised names, per PEP 685, with the returned value being handled appropriately by `iter_dependencies`. r$r&s r(iter_provided_extrasz%BaseDistribution.iter_provided_extrass "##r+c |jd}dtj|j DS#t$rYywxYw)NRECORDc3^K|]%}ttj|d'yw)rNr;).0rows r( zFBaseDistribution._iter_declared_entries_from_record..s"ScGLLQ()Ss+-)rrcsvreaderr)r'texts r("_iter_declared_entries_from_recordz3BaseDistribution._iter_declared_entries_from_recordsG >>(+DTSZZ@Q5RSS!  s= A A cR |jd}d|jdD}|j}|j}|||S t j |j|js|Sfd|DS#t$rYywxYw#t$r|cYSwxYw)Nzinstalled-files.txtc3&K|] }|s| ywr#r7)rps r(rzFBaseDistribution._iter_declared_entries_from_legacy..sAqqAsF)keependsc3K|]7}ttj|jj9ywr#)r@r<r=parts)rrinfo_rels r(rzFBaseDistribution._iter_declared_entries_from_legacy..s2  *',,q/*?*? P s=A) rrrr\rjr<r= relative_torr)r'rpathsrootr?rs @r("_iter_declared_entries_from_legacyz3BaseDistribution._iter_declared_entries_from_legacys >>"78DBDOOUO;A}}!! <4<L ||D)55d;H~~L   !   L s#B $B BB B&%B&cF|jxs|jS)aIterate through file entries declared in this distribution. For modern .dist-info distributions, this is the files listed in the ``RECORD`` metadata file. For legacy setuptools distributions, this comes from ``installed-files.txt``, with entries normalized to be compatible with the format used by ``RECORD``. :return: An iterator for listed entries, or None if the distribution contains neither ``RECORD`` nor ``installed-files.txt``. )rrr&s r(iter_declared_entriesz&BaseDistribution.iter_declared_entriess&  3 3 5 9668 r+c#vK |jd}dx}}|jD]}}|j}|r|j dr'|j dr6|j dr%|jdj d\}}}nt||| y#t$rYywxYww) aParse a ``requires.txt`` in an egg-info directory. This is an INI-ish format where an egg-info stores dependencies. A section name describes extra other environment markers, while each entry is an arbitrary string (not a key-value pair) representing a dependency as a requirement string (no markers). There is a construct in ``importlib.metadata`` called ``Sectioned`` that does mostly the same, but the format is currently considered private. z requires.txtNr#[]z[]:)rCrDrE)rrrrrru partitionrB)r'rrDrErrs r(_iter_requires_txt_entriesz+BaseDistribution._iter_requires_txt_entriess nn^4G&&( ND::rDs r(_iter_egg_info_extrasz&BaseDistribution._iter_egg_info_extrassQt 446 E%ekk2E $   U #K  sA A c#4K|jD]}t|j}|r |jrd|jd|d}n$|rd|d}n|jr |j}nd}|r|jd|t|jyw)aGet distribution dependencies from the egg-info directory. To ease parsing, this converts a legacy dependency entry into a PEP 508 requirement string. Like ``_iter_requires_txt_entries()``, there is code in ``importlib.metadata`` that does mostly the same, but not do exactly what we need. Namely, ``importlib.metadata`` does not normalize the extra name before putting it into the requirement string, which causes marker comparison to fail because the dist-info format do normalize. This is consistent in all currently available PEP 517 backends, although not standardized. (z) and extra == ""z extra == "rz ; N)rrrDrErC)r'r>rDrEs r(_iter_egg_info_dependenciesz,BaseDistribution._iter_egg_info_dependenciess446 (E%ekk2EU\\N*:5'C%eWA.**+3vh77''' (sBBc|jds|jD]}||d< |jds|jD]}||d< yy)z6Add egg-info requires.txt information to the metadata.rzProvides-ExtraN)rrr)r'rdeprDs r(rz'BaseDistribution._add_egg_info_requires9si0779 0,/) 0 01335 3-2)* 32r+N)rKr2r1rH)rObytesrPr2rQr2r1rH)rTWheelr)r2r1rHr0)r1z str | None)r1r)r1r)r1r)r1zDirectUrl | None)rInfoPathr1r)r1z Iterator[str])rrr1r2)r1zIterable[BaseEntryPoint])r1email.message.Message)r1zdict[str, Any])r1r)r7)rzCollection[str]r1zIterable[Requirement])r1z Iterable[str])r1zIterable[NormalizedName])r1zIterator[str] | None)r1zIterator[RequiresEntry])rrr1None)3r3r4r5 classmethodrLrRrUr]r_r6r\rfrhrjrnrrrwryr{r}r[rrbrrrrrrrlrrrr functoolscached_propertyrrrrZrrrrrrrrrrrr7r+r(rHrH^s$$$ $$ $  $$" $ $G5 $ $* $ $ $ $ 5 5 7 744" 4 4$$$$$$//2  ))4411MM QQ $$$$$  **55>> $$: $T * N2(83r+rHcveZdZdZed dZed dZd dZddZddZ de dddf dd Z y )BaseEnvironmentz6An environment containing distributions to introspect.ctr#r$)rJs r(defaultzBaseEnvironment.defaultFr*r+ctr#r$)rJrs r( from_pathszBaseEnvironment.from_pathsJr*r+ct)zGiven a requirement name, return the installed distributions. The name may not be normalized. The implementation must canonicalize it for lookup. r$)r'r)s r(get_distributionz BaseEnvironment.get_distributionNrMr+ct)aIterate through installed distributions. This function should be implemented by subclass, but never called directly. Use the public ``iter_distribution()`` instead, which implements additional logic to make sure the distributions are valid. r$r&s r(_iter_distributionsz#BaseEnvironment._iter_distributionsVrr+c#K|jD]d}tjd|jtj}|s,t j d|j|ja|fyw)zBIterate through all installed distributions without any filtering.z)^([A-Z0-9]|[A-Z0-9][A-Z0-9._-]*[A-Z0-9])$)flagsz%Ignoring invalid distribution %s (%s)N)rrematchr{ IGNORECASErrr\)r'distproject_name_valids r(iter_all_distributionsz&BaseEnvironment.iter_all_distributions_sp,,. D "$<##mm"  &;''MM J# sA9A;TFc|j}|r d|D}|s d|D}|r d|D}|r d|D}fd|DS)a/Return a list of installed distributions. This is based on ``iter_all_distributions()`` with additional filtering options. Note that ``iter_installed_distributions()`` without arguments is *not* equal to ``iter_all_distributions()``, since some of the configurations exclude packages by default. :param local_only: If True (default), only return installations local to the current virtualenv, if in a virtualenv. :param skip: An iterable of canonicalized project names to ignore; defaults to ``stdlib_pkgs``. :param include_editables: If False, don't report editables. :param editables_only: If True, only report editables. :param user_only: If True, only report installations in the user site directory. c3:K|]}|js|ywr#)rrds r(rz?BaseEnvironment.iter_installed_distributions..s+177!+c3:K|]}|jr|ywr#rrs r(rz?BaseEnvironment.iter_installed_distributions..s2qzz!2rc3:K|]}|js|ywr#rrs r(rz?BaseEnvironment.iter_installed_distributions..s.1::!.rc3:K|]}|js|ywr#)rrs r(rz?BaseEnvironment.iter_installed_distributions..s11==!1rc3@K|]}|jvs|ywr#)r{)rrskips r(rz?BaseEnvironment.iter_installed_distributions..s>a!1!1!=>s)r )r' local_onlyrinclude_editableseditables_only user_onlyits ` r(iter_installed_distributionsz,BaseEnvironment.iter_installed_distributionstsR0 ( ( * +R+B 2R2B .R.B 1R1B>2>>r+N)r1r)rzlist[str] | Noner1r)r)r2r1zBaseDistribution | None)r1Iterator[BaseDistribution]) rrrzContainer[str]rrrrrrr1r) r3r4r5__doc__rrrrrr rrr7r+r(rrCs@$$$$$$. *"&$ !?!?!? !?  !?  !? $!?r+rc eZdZUded<ddZy)rr2r\ctr#r$r&s r( as_zipfilezWheel.as_zipfilerr+Nr1zzipfile.ZipFile)r3r4r5rFr"r7r+r(rrs M$r+rceZdZddZddZy)FilesystemWheelc||_yr#)r\rqs r(__init__zFilesystemWheel.__init__s   r+cDtj|jdSNT) allowZip64)zipfileZipFiler\r&s r(r"zFilesystemWheel.as_zipfilest}}>>r+N)r\r2r1rr#r3r4r5r'r"r7r+r(r%r%s !?r+r%ceZdZddZddZy) MemoryWheelc ||_||_yr#)r\stream)r'r\r1s r(r'zMemoryWheel.__init__s   r+cDtj|jdSr))r+r,r1r&s r(r"zMemoryWheel.as_zipfilest{{t<tuple[str, ...]r?r3r1r2)B __future__rr email.messageemailrrloggingr<rr+collections.abcrrrrtypingrr r r r "pip._vendor.packaging.requirementsr pip._vendor.packaging.specifiersrrpip._vendor.packaging.utilsrrpip._vendor.packaging.versionrpip._internal.exceptionsrpip._internal.locationsrrpip._internal.models.direct_urlrrrpip._internal.utils.compatrpip._internal.utils.egg_linkrpip._internal.utils.miscrrpip._internal.utils.urlsr_jsonrr2PurePathr getLoggerr3rr!r@rBrHrrr%r/r7r+r(rHs"   EE;KI16< 3D=0 g&&& '   8 $ $X $, , , ,<J b3xb3JR?R?j$H$?e?=%=r+