|
|
None | __init__ (self, importlib.metadata.Distribution dist, Optional[BasePath] info_location, Optional[BasePath] installed_location) |
| |
| BaseDistribution | from_directory (cls, str directory) |
| |
| BaseDistribution | from_metadata_file_contents (cls, bytes metadata_contents, str filename, str project_name) |
| |
| BaseDistribution | from_wheel (cls, Wheel wheel, str name) |
| |
| Optional[str] | location (self) |
| |
| Optional[str] | info_location (self) |
| |
| Optional[str] | installed_location (self) |
| |
| NormalizedName | canonical_name (self) |
| |
| DistributionVersion | version (self) |
| |
| bool | is_file (self, InfoPath path) |
| |
| Iterator[str] | iter_distutils_script_names (self) |
| |
| str | read_text (self, InfoPath path) |
| |
| Iterable[BaseEntryPoint] | iter_entry_points (self) |
| |
| Iterable[str] | iter_provided_extras (self) |
| |
| bool | is_extra_provided (self, str extra) |
| |
| Iterable[Requirement] | iter_dependencies (self, Collection[str] extras=()) |
| |
|
str | __repr__ (self) |
| |
|
str | __str__ (self) |
| |
| Optional[str] | editable_project_location (self) |
| |
| bool | installed_by_distutils (self) |
| |
| bool | installed_as_egg (self) |
| |
| bool | installed_with_setuptools_egg_info (self) |
| |
| bool | installed_with_dist_info (self) |
| |
| str | setuptools_filename (self) |
| |
| Optional[DirectUrl] | direct_url (self) |
| |
|
str | installer (self) |
| |
|
bool | requested (self) |
| |
|
bool | editable (self) |
| |
| bool | local (self) |
| |
|
bool | in_usersite (self) |
| |
|
bool | in_site_packages (self) |
| |
| email.message.Message | metadata (self) |
| |
| Dict[str, Any] | metadata_dict (self) |
| |
| Optional[str] | metadata_version (self) |
| |
| str | raw_name (self) |
| |
| SpecifierSet | requires_python (self) |
| |
| Optional[Iterator[str]] | iter_declared_entries (self) |
| |
|
|
| _dist |
| |
|
| _info_location |
| |
|
| _installed_location |
| |
|
|
| editable_project_location |
| |
|
| metadata |
| |
|
| raw_name |
| |
◆ _get_dist_name_from_location()
| Optional[str] pip._internal.metadata.importlib._dists.Distribution._get_dist_name_from_location |
( |
|
self | ) |
|
|
protected |
Try to get the name from the metadata directory name.
This is much faster than reading metadata.
◆ _metadata_impl()
| email.message.Message pip._internal.metadata.importlib._dists.Distribution._metadata_impl |
( |
|
self | ) |
|
|
protected |
◆ canonical_name()
| NormalizedName pip._internal.metadata.importlib._dists.Distribution.canonical_name |
( |
|
self | ) |
|
◆ from_directory()
| BaseDistribution pip._internal.metadata.importlib._dists.Distribution.from_directory |
( |
|
cls, |
|
|
str |
directory |
|
) |
| |
◆ from_metadata_file_contents()
| BaseDistribution pip._internal.metadata.importlib._dists.Distribution.from_metadata_file_contents |
( |
|
cls, |
|
|
bytes |
metadata_contents, |
|
|
str |
filename, |
|
|
str |
project_name |
|
) |
| |
Load 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.
Reimplemented from pip._internal.metadata.base.BaseDistribution.
◆ from_wheel()
| BaseDistribution pip._internal.metadata.importlib._dists.Distribution.from_wheel |
( |
|
cls, |
|
|
Wheel |
wheel, |
|
|
str |
name |
|
) |
| |
Load 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.
Reimplemented from pip._internal.metadata.base.BaseDistribution.
◆ info_location()
| Optional[str] pip._internal.metadata.importlib._dists.Distribution.info_location |
( |
|
self | ) |
|
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.
Reimplemented from pip._internal.metadata.base.BaseDistribution.
◆ installed_location()
| Optional[str] pip._internal.metadata.importlib._dists.Distribution.installed_location |
( |
|
self | ) |
|
◆ is_extra_provided()
| bool pip._internal.metadata.importlib._dists.Distribution.is_extra_provided |
( |
|
self, |
|
|
str |
extra |
|
) |
| |
Check whether an extra is provided by this distribution.
This is needed mostly for compatibility issues with pkg_resources not
following the extra normalization rules defined in PEP 685.
Reimplemented from pip._internal.metadata.base.BaseDistribution.
◆ is_file()
| bool pip._internal.metadata.importlib._dists.Distribution.is_file |
( |
|
self, |
|
|
InfoPath |
path |
|
) |
| |
◆ iter_dependencies()
| Iterable[Requirement] pip._internal.metadata.importlib._dists.Distribution.iter_dependencies |
( |
|
self, |
|
|
Collection[str] |
extras = () |
|
) |
| |
◆ iter_distutils_script_names()
| Iterator[str] pip._internal.metadata.importlib._dists.Distribution.iter_distutils_script_names |
( |
|
self | ) |
|
Find distutils 'scripts' entries metadata.
If 'scripts' is supplied in ``setup.py``, distutils records those in the
installed distribution's ``scripts`` directory, a file for each script.
Reimplemented from pip._internal.metadata.base.BaseDistribution.
◆ iter_entry_points()
| Iterable[BaseEntryPoint] pip._internal.metadata.importlib._dists.Distribution.iter_entry_points |
( |
|
self | ) |
|
◆ iter_provided_extras()
| Iterable[str] pip._internal.metadata.importlib._dists.Distribution.iter_provided_extras |
( |
|
self | ) |
|
Extras 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 not particularly useful other than
display purposes due to backward compatibility issues and the extra
names being poorly normalized prior to PEP 685. If you want to perform
logic operations on extras, use :func:`is_extra_provided` instead.
Reimplemented from pip._internal.metadata.base.BaseDistribution.
◆ location()
| Optional[str] pip._internal.metadata.importlib._dists.Distribution.location |
( |
|
self | ) |
|
Where 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.
Reimplemented from pip._internal.metadata.base.BaseDistribution.
◆ read_text()
| str pip._internal.metadata.importlib._dists.Distribution.read_text |
( |
|
self, |
|
|
InfoPath |
path |
|
) |
| |
Read a file in the info directory.
:raise FileNotFoundError: If ``path`` does not exist in the directory.
:raise NoneMetadataError: If ``path`` exists in the info directory, but
cannot be read.
Reimplemented from pip._internal.metadata.base.BaseDistribution.
◆ version()
| DistributionVersion pip._internal.metadata.importlib._dists.Distribution.version |
( |
|
self | ) |
|
The documentation for this class was generated from the following file:
- docs/help/help-venv/lib/python3.12/site-packages/pip/_internal/metadata/importlib/_dists.py