Path: blob/main/test/lib/python3.9/site-packages/pip/_internal/distributions/wheel.py
4806 views
from pip._vendor.packaging.utils import canonicalize_name12from pip._internal.distributions.base import AbstractDistribution3from pip._internal.index.package_finder import PackageFinder4from pip._internal.metadata import (5BaseDistribution,6FilesystemWheel,7get_wheel_distribution,8)91011class WheelDistribution(AbstractDistribution):12"""Represents a wheel distribution.1314This does not need any preparation as wheels can be directly unpacked.15"""1617def get_metadata_distribution(self) -> BaseDistribution:18"""Loads the metadata from the wheel file into memory and returns a19Distribution that uses it, not relying on the wheel file or20requirement.21"""22assert self.req.local_file_path, "Set as part of preparation during download"23assert self.req.name, "Wheels are never unnamed"24wheel = FilesystemWheel(self.req.local_file_path)25return get_wheel_distribution(wheel, canonicalize_name(self.req.name))2627def prepare_distribution_metadata(28self,29finder: PackageFinder,30build_isolation: bool,31check_build_deps: bool,32) -> None:33pass343536