Skip to content

Commit b808899

Browse files
leofangclaude
andcommitted
Strip numpy cibuildwheel config; build without BLAS
numpy 2.4.x ships [tool.cibuildwheel] config (OpenBLAS scripts, cpython-freethreading, ILP64 settings) incompatible with cibuildwheel v4.0. Strip the entire section from the sdist and build with -Dallow-noblas=true — we only need numpy for testing, not optimized linear algebra. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 3f1f3c0 commit b808899

1 file changed

Lines changed: 13 additions & 4 deletions

File tree

.github/workflows/build-wheel.yml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -262,10 +262,17 @@ jobs:
262262
run: |
263263
pip download --no-binary numpy --no-deps "numpy>=1.21.1" -d numpy-sdist/
264264
cd numpy-sdist && tar xf numpy-*.tar.gz && rm numpy-*.tar.gz
265-
# WAR: numpy 2.4.x ships enable=["cpython-freethreading", ...] which
266-
# is invalid in cibuildwheel v4.0 (freethreading is now on by default).
267-
# Fixed on numpy main (a5df4859) but not yet released.
268-
sed -i 's/"cpython-freethreading", //' numpy-*/pyproject.toml
265+
# WAR: numpy 2.4.x ships [tool.cibuildwheel] config that is
266+
# incompatible with cibuildwheel v4.0 (cpython-freethreading enable
267+
# group, OpenBLAS before-build scripts, etc.). Strip the entire
268+
# section — we only need a basic numpy wheel for testing.
269+
python -c "
270+
import glob, re
271+
for f in glob.glob('numpy-*/pyproject.toml'):
272+
txt = open(f).read()
273+
txt = re.sub(r'\n\[tool\.cibuildwheel\].*', '', txt, flags=re.DOTALL)
274+
open(f, 'w').write(txt)
275+
"
269276
echo "NUMPY_SRC_DIR=$(pwd)/$(ls -d numpy-*/)" >> $GITHUB_ENV
270277
271278
- name: Build numpy wheel (pre-release Python)
@@ -275,6 +282,8 @@ jobs:
275282
CIBW_BUILD: ${{ env.CIBW_BUILD }}
276283
CIBW_ARCHS_LINUX: "native"
277284
CIBW_BUILD_VERBOSITY: 1
285+
CIBW_CONFIG_SETTINGS: "setup-args=-Dallow-noblas=true"
286+
CIBW_CONFIG_SETTINGS_WINDOWS: "setup-args=--vsenv setup-args=-Dallow-noblas=true"
278287
CIBW_BEFORE_BUILD_WINDOWS: "pip install delvewheel"
279288
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: "delvewheel repair -w {dest_dir} {wheel}"
280289
CIBW_ENABLE: "cpython-prerelease"

0 commit comments

Comments
 (0)