23def dist_from_wheel_url(name: str, url: str, session: PipSession) -> BaseDistribution:
24 """Return a distribution object from the given wheel URL.
25
26 This uses HTTP range requests to only fetch the portion of the wheel
27 containing metadata, just enough for the object to be constructed.
28 If such requests are not supported, HTTPRangeRequestUnsupported
29 is raised.
30 """
31 with LazyZipOverHTTP(url, session) as zf:
32
33
34 wheel = MemoryWheel(
zf.name, zf)
35
36
37 return get_wheel_distribution(wheel, canonicalize_name(name))
38
39