summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTyler Reddy <tyler.je.reddy@gmail.com>2020-05-24 17:42:50 -0600
committerGitHub <noreply@github.com>2020-05-24 17:42:50 -0600
commitda0d66baff4731e13017e7e0802eded966b85664 (patch)
tree58a9d703fe84515fd6a9a87d687a60a0807b653c
parentdaffccfa95251024a814139a622feb367e7c74c0 (diff)
parent18c41a11319f8d8c8cfec5c8c98fb07c52f0a3e9 (diff)
downloadnumpy-da0d66baff4731e13017e7e0802eded966b85664.tar.gz
Merge pull request #16362 from charris/update-download-wheels
MAINT: Streamline download-wheels.
-rw-r--r--tools/download-wheels.py8
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)}")