Path: blob/master/venv/Lib/site-packages/pip/_internal/distributions/wheel.py
811 views
from zipfile import ZipFile12from pip._internal.distributions.base import AbstractDistribution3from pip._internal.utils.typing import MYPY_CHECK_RUNNING4from pip._internal.utils.wheel import pkg_resources_distribution_for_wheel56if MYPY_CHECK_RUNNING:7from pip._vendor.pkg_resources import Distribution8from pip._internal.index.package_finder import PackageFinder91011class WheelDistribution(AbstractDistribution):12"""Represents a wheel distribution.1314This does not need any preparation as wheels can be directly unpacked.15"""1617def get_pkg_resources_distribution(self):18# type: () -> Distribution19"""Loads the metadata from the wheel file into memory and returns a20Distribution that uses it, not relying on the wheel file or21requirement.22"""23# Set as part of preparation during download.24assert self.req.local_file_path25# Wheels are never unnamed.26assert self.req.name2728with ZipFile(self.req.local_file_path, allowZip64=True) as z:29return pkg_resources_distribution_for_wheel(30z, self.req.name, self.req.local_file_path31)3233def prepare_distribution_metadata(self, finder, build_isolation):34# type: (PackageFinder, bool) -> None35pass363738