]>
jfr.im git - dlqueue.git/blob - venv/lib/python3.11/site-packages/pip/_internal/distributions/wheel.py
1 from pip
._vendor
.packaging
.utils
import canonicalize_name
3 from pip
._internal
.distributions
.base
import AbstractDistribution
4 from pip
._internal
.index
.package_finder
import PackageFinder
5 from pip
._internal
.metadata
import (
8 get_wheel_distribution
,
12 class WheelDistribution(AbstractDistribution
):
13 """Represents a wheel distribution.
15 This does not need any preparation as wheels can be directly unpacked.
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
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
))
28 def prepare_distribution_metadata(
30 finder
: PackageFinder
,
31 build_isolation
: bool,
32 check_build_deps
: bool,