Let us walk on the 3-isogeny graph
Loading...
Searching...
No Matches
pip._internal.network.lazy_wheel Namespace Reference

Data Structures

class  HTTPRangeRequestUnsupported
 
class  LazyZipOverHTTP
 

Functions

BaseDistribution dist_from_wheel_url (str name, str url, PipSession session)
 

Detailed Description

Lazy ZIP over HTTP

Function Documentation

◆ dist_from_wheel_url()

BaseDistribution dist_from_wheel_url ( str  name,
str  url,
PipSession  session 
)
Return a distribution object from the given wheel URL.

This uses HTTP range requests to only fetch the portion of the wheel
containing metadata, just enough for the object to be constructed.
If such requests are not supported, HTTPRangeRequestUnsupported
is raised.

Definition at line 23 of file lazy_wheel.py.

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 # For read-only ZIP files, ZipFile only needs methods read,
33 # seek, seekable and tell, not the whole IO protocol.
34 wheel = MemoryWheel(zf.name, zf) # type: ignore
35 # After context manager exit, wheel.name
36 # is an invalid file by intention.
37 return get_wheel_distribution(wheel, canonicalize_name(name))
38
39
for i