python (3.11.7)

(root)/
lib/
python3.11/
site-packages/
pip/
_internal/
distributions/
wheel.py
       1  from pip._vendor.packaging.utils import canonicalize_name
       2  
       3  from pip._internal.distributions.base import AbstractDistribution
       4  from pip._internal.index.package_finder import PackageFinder
       5  from pip._internal.metadata import (
       6      BaseDistribution,
       7      FilesystemWheel,
       8      get_wheel_distribution,
       9  )
      10  
      11  
      12  class ESC[4;38;5;81mWheelDistribution(ESC[4;38;5;149mAbstractDistribution):
      13      """Represents a wheel distribution.
      14  
      15      This does not need any preparation as wheels can be directly unpacked.
      16      """
      17  
      18      def get_metadata_distribution(self) -> BaseDistribution:
      19          """Loads the metadata from the wheel file into memory and returns a
      20          Distribution that uses it, not relying on the wheel file or
      21          requirement.
      22          """
      23          assert self.req.local_file_path, "Set as part of preparation during download"
      24          assert self.req.name, "Wheels are never unnamed"
      25          wheel = FilesystemWheel(self.req.local_file_path)
      26          return get_wheel_distribution(wheel, canonicalize_name(self.req.name))
      27  
      28      def prepare_distribution_metadata(
      29          self,
      30          finder: PackageFinder,
      31          build_isolation: bool,
      32          check_build_deps: bool,
      33      ) -> None:
      34          pass