Skip to content

Commit 28b98f2

Browse files
authored
ci: update cibuildwheel to v4.1 and pyodide to 314 (#6095)
* ci: update cibuildwheel to v4.1 and pyodide to 314 Bump pypa/cibuildwheel from v3.4 to v4.1 across the Pyodide, iOS, and Android jobs. Move the Pyodide build to cp314-pyodide_wasm32 (pyodide 314.0.0). Drop the iOS CIBW_SKIP: cp314-* workaround now that pypa/cibuildwheel#2494 is resolved. Assisted-by: ClaudeCode:claude-opus-4.8 * test: xfail array resize on numpy<2.4 + Python 3.14 Removing the cp314 iOS skip surfaced a pre-existing numpy bug, not a cibuildwheel regression: numpy<2.4 has a resize(refcheck=True) regression on Python 3.14 where the reference held by the bound function isn't detected, so a resize that should raise instead succeeds and the later reshape rejects the non-square size. Fixed in numpy>=2.4, but the iOS test environment has no numpy wheel newer than 2.3.5.post1, so xfail the test for that specific combination. Assisted-by: ClaudeCode:claude-opus-4.8 * test: link numpy resize aliasing issue and trim comment iOS numpy wheels updated to 2.5.0, so the xfail is a general numpy<2.4 + Python 3.14 guard rather than iOS-specific. Reference numpy/numpy#30265. Assisted-by: ClaudeCode:claude-opus-4.8
1 parent 7ca651c commit 28b98f2

2 files changed

Lines changed: 13 additions & 2 deletions

File tree

.github/workflows/tests-cibw.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
PYODIDE_BUILD_EXPORTS: whole_archive
3131
with:
3232
package-dir: tests
33-
only: cp312-pyodide_wasm32
33+
only: cp314-pyodide_wasm32
3434

3535
build-ios:
3636
name: iOS wheel ${{ matrix.runs-on }}
@@ -51,7 +51,6 @@ jobs:
5151
- uses: pypa/cibuildwheel@v4.1
5252
env:
5353
CIBW_PLATFORM: ios
54-
CIBW_SKIP: cp314-* # https://github.com/pypa/cibuildwheel/issues/2494
5554
with:
5655
package-dir: tests
5756

tests/test_numpy_array.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,20 @@
11
from __future__ import annotations
22

3+
import sys
4+
35
import pytest
46

57
import env # noqa: F401
68
from pybind11_tests import numpy_array as m
79

810
np = pytest.importorskip("numpy")
911

12+
# numpy < 2.4 fails to detect aliasing in ndarray.resize on Python 3.14, so a
13+
# resize that should raise instead succeeds: numpy/numpy#30265 (fixed in 2.4.0).
14+
NUMPY_RESIZE_REFCHECK_BROKEN = sys.version_info >= (3, 14) and tuple(
15+
int(x) for x in np.__version__.split(".")[:2]
16+
) < (2, 4)
17+
1018

1119
def test_dtypes():
1220
# See issue #1328.
@@ -485,6 +493,10 @@ def test_initializer_list():
485493
assert m.array_initializer_list4().shape == (1, 2, 3, 4)
486494

487495

496+
@pytest.mark.xfail(
497+
NUMPY_RESIZE_REFCHECK_BROKEN,
498+
reason="numpy<2.4 resize(refcheck) regression on Python 3.14",
499+
)
488500
def test_array_resize():
489501
a = np.array([1, 2, 3, 4, 5, 6, 7, 8, 9], dtype="float64")
490502
m.array_reshape2(a)

0 commit comments

Comments
 (0)