From c1ccc9a81f98a0a05e7af0b5a52e0c9435f125be Mon Sep 17 00:00:00 2001 From: Tobias Ahrens Date: Wed, 4 Oct 2023 09:03:02 +0200 Subject: [PATCH] test --- .github/workflows/wheels.yml | 2 +- buildutils/bundle.py | 10 +++------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 9a4c46a..50c9224 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -48,7 +48,7 @@ jobs: # Used to host cibuildwheel - uses: actions/setup-python@v4 with: - python-version: '3.12' + python-version: '3.11' - name: Install cibuildwheel run: python -m pip install cibuildwheel==2.16.1 diff --git a/buildutils/bundle.py b/buildutils/bundle.py index a29fce0..b7af0df 100644 --- a/buildutils/bundle.py +++ b/buildutils/bundle.py @@ -50,13 +50,8 @@ def localpath(*args): return os.path.abspath(pjoin(*plist)) -def fetch_archive(savedir, url, force=False): +def fetch_archive(savedir, url, fname, force=False): """download an archive to a specific location""" - req = urlopen(url) - # Lookup filename - fname = req.info().get_filename() - if not fname: - fname = os.path.basename(url) dest = pjoin(savedir, fname) if os.path.exists(dest) and not force: print("already have %s" % fname) @@ -64,6 +59,7 @@ def fetch_archive(savedir, url, force=False): print("fetching %s into %s" % (url, savedir)) if not os.path.exists(savedir): os.makedirs(savedir) + req = urlopen(url) with open(dest, "wb") as f: f.write(req.read()) return dest @@ -84,7 +80,7 @@ def fetch_libcapnp(savedir, url=None): if os.path.exists(dest): print("already have %s" % dest) return - fname = fetch_archive(savedir, url) + fname = fetch_archive(savedir, url, libcapnp_name) tf = tarfile.open(fname) with_version = pjoin(savedir, tf.firstmember.path) tf.extractall(savedir)