26 lines
761 B
Python
Raw Normal View History

2022-08-10 20:32:35 -04:00
from pip._internal.distributions.base import AbstractDistribution
2022-08-12 01:34:18 -04:00
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
if MYPY_CHECK_RUNNING:
from typing import Optional
from pip._vendor.pkg_resources import Distribution
from pip._internal.index.package_finder import PackageFinder
2022-08-10 20:32:35 -04:00
class InstalledDistribution(AbstractDistribution):
"""Represents an installed package.
This does not need any preparation as the required information has already
been computed.
"""
def get_pkg_resources_distribution(self):
2022-08-12 01:34:18 -04:00
# type: () -> Optional[Distribution]
2022-08-10 20:32:35 -04:00
return self.req.satisfied_by
def prepare_distribution_metadata(self, finder, build_isolation):
2022-08-12 01:34:18 -04:00
# type: (PackageFinder, bool) -> None
2022-08-10 20:32:35 -04:00
pass