diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2020-05-24 08:04:27 -0600 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2020-05-24 08:04:27 -0600 |
commit | 18c41a11319f8d8c8cfec5c8c98fb07c52f0a3e9 (patch) | |
tree | 58a9d703fe84515fd6a9a87d687a60a0807b653c /tools/download-wheels.py | |
parent | daffccfa95251024a814139a622feb367e7c74c0 (diff) | |
download | numpy-18c41a11319f8d8c8cfec5c8c98fb07c52f0a3e9.tar.gz |
MAINT: Streamline download-wheels.
- Makes specifying name patterns simpler
- Makes name pattern reject dev versions unless specified.
- Makes progress printing aligned and more concise.
Diffstat (limited to 'tools/download-wheels.py')
-rw-r--r-- | tools/download-wheels.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tools/download-wheels.py b/tools/download-wheels.py index 1e26e0e63..941440ca9 100644 --- a/tools/download-wheels.py +++ b/tools/download-wheels.py @@ -16,7 +16,7 @@ __version__ = '0.1' # Edit these for other projects. STAGING_URL = 'https://anaconda.org/multibuild-wheels-staging/numpy' -PREFIX = '^.*numpy-' +PREFIX = 'numpy' def get_wheel_names(version): """ Get wheel names from Anaconda HTML directory. @@ -31,8 +31,8 @@ def get_wheel_names(version): """ http = urllib3.PoolManager(cert_reqs='CERT_REQUIRED') - tmpl = re.compile(rf"{PREFIX}{version}.*\.whl$") - index_url = f"{STAGING_URL}/files" + tmpl = re.compile(rf"^.*{PREFIX}-{version}-.*\.whl$") + index_url = f"{STAGING_URL}/files" index_html = http.request('GET', index_url) soup = BeautifulSoup(index_html.data, 'html.parser') return soup.findAll(text=tmpl) @@ -60,7 +60,7 @@ def download_wheels(version, wheelhouse): wheel_path = os.path.join(wheelhouse, wheel_name) with open(wheel_path, 'wb') as f: with http.request('GET', wheel_url, preload_content=False,) as r: - print(f"Downloading wheel {i + 1}, name: {wheel_name}") + print(f"{i + 1:<4}{wheel_name}") shutil.copyfileobj(r, f) print(f"\nTotal files downloaded: {len(wheel_names)}") |