m2m模型翻译
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
842 B

6 months ago
  1. from typing import Optional
  2. from pip._internal.distributions.base import AbstractDistribution
  3. from pip._internal.index.package_finder import PackageFinder
  4. from pip._internal.metadata import BaseDistribution
  5. class InstalledDistribution(AbstractDistribution):
  6. """Represents an installed package.
  7. This does not need any preparation as the required information has already
  8. been computed.
  9. """
  10. @property
  11. def build_tracker_id(self) -> Optional[str]:
  12. return None
  13. def get_metadata_distribution(self) -> BaseDistribution:
  14. assert self.req.satisfied_by is not None, "not actually installed"
  15. return self.req.satisfied_by
  16. def prepare_distribution_metadata(
  17. self,
  18. finder: PackageFinder,
  19. build_isolation: bool,
  20. check_build_deps: bool,
  21. ) -> None:
  22. pass