Skip to content

Commit 9d1d254

Browse files
committed
MAINT: verify importing numpy does not re-enable the GIL in CI
1 parent 1ee327c commit 9d1d254

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

.github/workflows/linux.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,16 @@ jobs:
310310
- name: Install nightly Cython
311311
run: |
312312
pip install git+https://github.com/cython/cython
313+
# Set PYTHON_GIL=0 to force GIL off during tests and then manually verify
314+
# importing numpy does not enable the GIL. When f2py grows the ability to
315+
# declare GIL-disabled support we can just run the tests without the
316+
# environment variable
313317
- uses: ./.github/meson_actions
314318
env:
315-
# needed until f2py grows a config flag for GIL-disabled support
316319
PYTHON_GIL: 0
320+
- name: Verify import does not re-enable GIL
321+
run: |
322+
if [[ $(python -c "import numpy" 2>&1) == "*The global interpreter lock (GIL) has been enabled*" ]]; then
323+
echo "Error: Importing NumPy re-enables the GIL in the free-threaded build"
324+
exit 1
325+
fi

0 commit comments

Comments
 (0)