diff --git a/ci-repair-wheel.sh b/ci-repair-wheel.sh index 8eeee730..6b2f4209 100755 --- a/ci-repair-wheel.sh +++ b/ci-repair-wheel.sh @@ -33,10 +33,19 @@ with zipfile.ZipFile(whl, 'a') as z: python3 -c " import sys, zipfile, pathlib, glob whl = next(pathlib.Path(sys.argv[1]).glob('*.whl')) -with zipfile.ZipFile(whl, 'a') as z: - for f in glob.glob('*/lib/libgfortran*'): - z.write(f) - " "$1" +patched = {f: pathlib.Path(f).read_bytes() for f in glob.glob('*/lib/libgfortran*')} + +# Read all original entries, replacing patched one +entries = {} +with zipfile.ZipFile(whl, 'r') as z: + for item in z.infolist(): + entries[item] = patched.get(item.filename, z.read(item.filename)) + +# Rewrite the archive +with zipfile.ZipFile(whl, 'w', compression=zipfile.ZIP_DEFLATED) as z: + for item, data in entries.items(): + z.writestr(item, data) +" "$1" mkdir -p /output # copy libs/openblas*.tar.gz to dist/ cp libs/openblas*.tar.gz /output/ diff --git a/pyproject.toml b/pyproject.toml index c5bad071..643edf9f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,7 +9,7 @@ build-backend = "setuptools.build_meta" [project] name = "scipy-openblas64" # v0.3.31-126-g55b16e59 -version = "0.3.31.126.0" +version = "0.3.31.126.1" requires-python = ">=3.7" description = "Provides OpenBLAS for python packaging" readme = "README.md"