MCPcopy Create free account
hub / github.com/numpy/numpy / download_wheels

Function download_wheels

tools/download-wheels.py:67–91  ·  view source on GitHub ↗

Download release wheels. The release wheels for the given NumPy version are downloaded into the given directory. Parameters ---------- version : str The release version. For instance, "1.18.3". wheelhouse : str Directory in which to download the wheels.

(version, wheelhouse)

Source from the content-addressed store, hash-verified

65
66
67def download_wheels(version, wheelhouse):
68 """Download release wheels.
69
70 The release wheels for the given NumPy version are downloaded
71 into the given directory.
72
73 Parameters
74 ----------
75 version : str
76 The release version. For instance, "1.18.3".
77 wheelhouse : str
78 Directory in which to download the wheels.
79
80 """
81 http = urllib3.PoolManager(cert_reqs="CERT_REQUIRED")
82 wheel_names = get_wheel_names(version)
83
84 for i, wheel_name in enumerate(wheel_names):
85 wheel_url = f"{STAGING_URL}/{version}/download/{wheel_name}"
86 wheel_path = os.path.join(wheelhouse, wheel_name)
87 with open(wheel_path, "wb") as f:
88 with http.request("GET", wheel_url, preload_content=False,) as r:
89 print(f"{i + 1:<4}{wheel_name}")
90 shutil.copyfileobj(r, f)
91 print(f"\nTotal files downloaded: {len(wheel_names)}")
92
93
94if __name__ == "__main__":

Callers 1

download-wheels.pyFile · 0.85

Calls 4

get_wheel_namesFunction · 0.85
openFunction · 0.85
printFunction · 0.85
joinMethod · 0.45

Tested by

no test coverage detected