Skip to content

Commit 4f7139b

Browse files
authored
Merge pull request #257 from mattip/fix-zip
fix bad re-zip: use 'w' not 'a'
2 parents a82f2d0 + 5d42cb4 commit 4f7139b

2 files changed

Lines changed: 14 additions & 5 deletions

File tree

ci-repair-wheel.sh

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,19 @@ with zipfile.ZipFile(whl, 'a') as z:
3333
python3 -c "
3434
import sys, zipfile, pathlib, glob
3535
whl = next(pathlib.Path(sys.argv[1]).glob('*.whl'))
36-
with zipfile.ZipFile(whl, 'a') as z:
37-
for f in glob.glob('*/lib/libgfortran*'):
38-
z.write(f)
39-
" "$1"
36+
patched = {f: pathlib.Path(f).read_bytes() for f in glob.glob('*/lib/libgfortran*')}
37+
38+
# Read all original entries, replacing patched one
39+
entries = {}
40+
with zipfile.ZipFile(whl, 'r') as z:
41+
for item in z.infolist():
42+
entries[item] = patched.get(item.filename, z.read(item.filename))
43+
44+
# Rewrite the archive
45+
with zipfile.ZipFile(whl, 'w', compression=zipfile.ZIP_DEFLATED) as z:
46+
for item, data in entries.items():
47+
z.writestr(item, data)
48+
" "$1"
4049
mkdir -p /output
4150
# copy libs/openblas*.tar.gz to dist/
4251
cp libs/openblas*.tar.gz /output/

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ build-backend = "setuptools.build_meta"
99
[project]
1010
name = "scipy-openblas64"
1111
# v0.3.31-126-g55b16e59
12-
version = "0.3.31.126.0"
12+
version = "0.3.31.126.1"
1313
requires-python = ">=3.7"
1414
description = "Provides OpenBLAS for python packaging"
1515
readme = "README.md"

0 commit comments

Comments
 (0)