class documentation

A Python distribution package.

Class Method discover Return an iterable of Distribution objects for all packages.
Class Method from_name Return the Distribution for the given package name.
Static Method at Return a Distribution for the indicated metadata path
Method locate_file Given a path to a file in this distribution, return a path to it.
Method read_text Attempt to load metadata file given by the name.
Property entry_points Undocumented
Property files Files in this distribution.
Property metadata Return the parsed metadata for this Distribution.
Property name Return the 'Name' metadata for the distribution package.
Property requires Generated requirements specified for this Distribution
Property version Return the 'Version' metadata for the distribution package.
Class Method _deps_from_requires_text Undocumented
Static Method _convert_egg_info_reqs_to_simple_reqs Historically, setuptools would solicit and store 'extra' requirements, including those with environment markers, in separate sections. More modern tools expect each dependency to be defined separately, with any relevant extras and environment markers attached directly to that requirement...
Static Method _discover_resolvers Search the meta_path for resolvers.
Method _read_dist_info_reqs Undocumented
Method _read_egg_info_reqs Undocumented
Method _read_files_distinfo Read the lines of RECORD
Method _read_files_egginfo SOURCES.txt might contain literal commas, so wrap each line in quotes.
Property _normalized_name Return a normalized version of the name.
@classmethod
def discover(cls, **kwargs): (source)

Return an iterable of Distribution objects for all packages. Pass a ``context`` or pass keyword arguments for constructing a context. :context: A ``DistributionFinder.Context`` object. :return: Iterable of Distribution objects for all packages.

@classmethod
def from_name(cls, name: str): (source)

Return the Distribution for the given package name. :param name: The name of the distribution package to search for. :return: The Distribution instance (or subclass thereof) for the named package, if found. :raises PackageNotFoundError: When the named package's distribution metadata cannot be found. :raises ValueError: When an invalid value is supplied for name.

Return a Distribution for the indicated metadata path :param path: a string or path-like object :return: a concrete Distribution instance for the path

@abc.abstractmethod
def locate_file(self, path): (source)

Given a path to a file in this distribution, return a path to it.

@abc.abstractmethod
def read_text(self, filename): (source)

Attempt to load metadata file given by the name. :param filename: The name of the file in the distribution info. :return: The text if found, otherwise None.

@property
entry_points = (source)

Undocumented

Files in this distribution. :return: List of PackagePath for this distribution or None Result is `None` if the metadata file that enumerates files (i.e. RECORD for dist-info or SOURCES.txt for egg-info) is missing. Result may be empty if the metadata exists but is empty.

Return the parsed metadata for this Distribution. The returned object will have keys that name the various bits of metadata. See PEP 566 for details.

Return the 'Name' metadata for the distribution package.

Generated requirements specified for this Distribution

Return the 'Version' metadata for the distribution package.

@classmethod
def _deps_from_requires_text(cls, source): (source)

Undocumented

@staticmethod
def _convert_egg_info_reqs_to_simple_reqs(sections): (source)

Historically, setuptools would solicit and store 'extra' requirements, including those with environment markers, in separate sections. More modern tools expect each dependency to be defined separately, with any relevant extras and environment markers attached directly to that requirement. This method converts the former to the latter. See _test_deps_from_requires_text for an example.

@staticmethod
def _discover_resolvers(): (source)

Search the meta_path for resolvers.

def _read_dist_info_reqs(self): (source)

Undocumented

def _read_egg_info_reqs(self): (source)

Undocumented

def _read_files_distinfo(self): (source)

Read the lines of RECORD

def _read_files_egginfo(self): (source)

SOURCES.txt might contain literal commas, so wrap each line in quotes.

@property
_normalized_name = (source)

Return a normalized version of the name.