]>
jfr.im git - dlqueue.git/blob - venv/lib/python3.11/site-packages/pip/_internal/distributions/base.py
3 from pip
._internal
.index
.package_finder
import PackageFinder
4 from pip
._internal
.metadata
.base
import BaseDistribution
5 from pip
._internal
.req
import InstallRequirement
8 class AbstractDistribution(metaclass
=abc
.ABCMeta
):
9 """A base class for handling installable artifacts.
11 The requirements for anything installable are as follows:
13 - we must be able to determine the requirement name
14 (or we can't correctly handle the non-upgrade case).
16 - for packages with setup requirements, we must also be able
17 to determine their requirements without installing additional
18 packages (for the same reason as run-time dependencies)
20 - we must be able to create a Distribution object exposing the
24 def __init__(self
, req
: InstallRequirement
) -> None:
29 def get_metadata_distribution(self
) -> BaseDistribution
:
30 raise NotImplementedError()
33 def prepare_distribution_metadata(
35 finder
: PackageFinder
,
36 build_isolation
: bool,
37 check_build_deps
: bool,
39 raise NotImplementedError()