NotFoundDistribution
- class NotFoundDistribution[source]
Distribution of package which couldn’t be found.
This class is used not to repeat the try-except pattern over and over again. If a package isn’t found an instance of this class is returned by
get_distribution()and the parts of the API which are used byverbose_version_infoare kept intact for the way they are used.See also
get_distributionAttributes Summary
entry_pointsfilesList of files in this distribution.
metadataReturn the parsed metadata for this Distribution.
nameReturn the 'Name' metadata for the distribution package.
requiresList of generated requirements specified for this Distribution.
versionUser set string if no version was found.
Methods Summary
Return a Distribution for the indicated metadata path
Return an iterable of Distribution objects for all packages.
Return the Distribution for the given package name.
Given a path to a file in this distribution, return a path to it.
Attempt to load metadata file given by the name.
Methods Documentation
- static at(path)
Return a Distribution for the indicated metadata path
- Parameters:
path – a string or path-like object
- Returns:
a concrete Distribution instance for the path
- classmethod discover(**kwargs)
Return an iterable of Distribution objects for all packages.
Pass a
contextor pass keyword arguments for constructing a context.- Context:
A
DistributionFinder.Contextobject.- Returns:
Iterable of Distribution objects for all packages.
- classmethod from_name(name)
Return the Distribution for the given package name.
- Parameters:
name – The name of the distribution package to search for.
- Returns:
The Distribution instance (or subclass thereof) for the named package, if found.
- Raises:
PackageNotFoundError – When the named package’s distribution metadata cannot be found.
- locate_file(path: PathLike | str) PathLike[source]
Given a path to a file in this distribution, return a path to it.
Just added to satisfy mypy, since the superclass one is an
abstractmethod.- Parameters:
path (PathLike | str) – Path to a file.
- Returns:
Just the initial
pathensure to be typePathLike.- Return type:
PathLike