Skip to content

Commit 0e062f2

Browse files
committed
fix(tests): CIBW test fixes from b-pass→vectorcall branch
- Install multiple-interpreter test modules into wheel (CMakeLists.txt) The mod_per_interpreter_gil, mod_shared_interpreter_gil, and mod_per_interpreter_gil_with_singleton modules were being built but not installed into the wheel when using scikit-build-core. - Pin numpy 2.4.0 for Python 3.14 CI tests (requirements.txt) NumPy 2.4.0 is the first version with official Python 3.14 wheels. - Add IOS platform constant to tests/env.py - Skip subinterpreter tests on iOS (test_multiple_interpreters.py) Subinterpreters are not supported in the iOS simulator environment. - Enable pytest timeout of 120s for CIBW tests (pyproject.toml) Provides a safety net to catch hanging tests before CI job timeout. - Disable pytest-timeout for Pyodide (no signal.setitimer) Pyodide runs in WebAssembly without POSIX signals. - Add -v flag for verbose pytest output in CIBW tests
1 parent 8dabcd9 commit 0e062f2

File tree

5 files changed

+15
-1
lines changed

5 files changed

+15
-1
lines changed

tests/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -602,6 +602,12 @@ if(NOT PYBIND11_CUDA_TESTS)
602602
endif()
603603
endforeach()
604604

605+
if(SKBUILD)
606+
foreach(mod IN LISTS PYBIND11_MULTIPLE_INTERPRETERS_TEST_MODULES)
607+
install(TARGETS "${mod}" LIBRARY DESTINATION .)
608+
endforeach()
609+
endif()
610+
605611
if(PYBIND11_TEST_SMART_HOLDER)
606612
foreach(mod IN LISTS PYBIND11_MULTIPLE_INTERPRETERS_TEST_MODULES)
607613
target_compile_definitions(

tests/env.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import sysconfig
66

77
ANDROID = sys.platform.startswith("android")
8+
IOS = sys.platform.startswith("ios")
89
LINUX = sys.platform.startswith("linux")
910
MACOS = sys.platform.startswith("darwin")
1011
WIN = sys.platform.startswith("win32") or sys.platform.startswith("cygwin")

tests/pyproject.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ PYBIND11_FINDPYTHON = true
2727

2828
[tool.cibuildwheel]
2929
test-sources = ["tests", "pyproject.toml"]
30-
test-command = "python -m pytest -o timeout=0 -p no:cacheprovider tests"
30+
test-command = "python -m pytest -v -o timeout=120 -p no:cacheprovider tests"
31+
# Pyodide doesn't have signal.setitimer, so pytest-timeout can't work with timeout > 0
32+
pyodide.test-command = "python -m pytest -v -o timeout=0 -p no:cacheprovider tests"
3133
environment.PIP_ONLY_BINARY = "numpy"
3234
environment.PIP_PREFER_BINARY = "1"
3335

tests/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ numpy~=1.22.2; platform_python_implementation=="CPython" and python_version=="3.
1010
numpy~=1.26.0; platform_python_implementation=="CPython" and python_version>="3.11" and python_version<"3.13" and platform_machine!="ARM64"
1111
numpy~=2.3.0; platform_python_implementation=="CPython" and python_version>="3.11" and platform_machine=="ARM64"
1212
numpy~=2.2.0; platform_python_implementation=="CPython" and python_version=="3.13" and platform_machine!="ARM64"
13+
numpy==2.4.0; platform_python_implementation=="CPython" and python_version>="3.14"
1314
pytest>=6
1415
pytest-timeout
1516
scipy~=1.5.4; platform_python_implementation=="CPython" and python_version<"3.10"

tests/test_multiple_interpreters.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,12 @@
99

1010
import pytest
1111

12+
import env
1213
import pybind11_tests
1314

15+
if env.IOS:
16+
pytest.skip("Subinterpreters not supported on iOS", allow_module_level=True)
17+
1418
# 3.14.0b3+, though sys.implementation.supports_isolated_interpreters is being added in b4
1519
# Can be simplified when we drop support for the first three betas
1620
CONCURRENT_INTERPRETERS_SUPPORT = (

0 commit comments

Comments
 (0)