Add no-GIL interpreter support

Add `pytest-run-parallel` as dependency, test no-GIL interpreters in CI, and
mark Cython module as safe for freethreaded interpreters.
This commit is contained in:
Charlie Lin 2025-07-20 11:33:23 -04:00
parent 42f056f3cf
commit 6ced817616
7 changed files with 59 additions and 7 deletions

View file

@ -10,7 +10,7 @@ jobs:
strategy:
matrix:
os: ["ubuntu-latest", "windows-latest", "macos-latest"]
py: ["3.14-dev", "3.13", "3.12", "3.11", "3.10", "3.9", "3.8"]
py: ["3.14", "3.14t", "3.13", "3.13t", "3.12", "3.11", "3.10", "3.9", "3.8"]
runs-on: ${{ matrix.os }}
name: Run test with Python ${{ matrix.py }} on ${{ matrix.os }}
@ -41,12 +41,12 @@ jobs:
- name: Test (C extension)
shell: bash
run: |
pytest -v test
PYTHON_GIL=0 pytest -v test
- name: Test (pure Python fallback)
shell: bash
run: |
MSGPACK_PUREPYTHON=1 pytest -v test
PYTHON_GIL=0 MSGPACK_PUREPYTHON=1 pytest -v test
- name: build packages
shell: bash

View file

@ -32,8 +32,9 @@ jobs:
uses: pypa/cibuildwheel@v2.23.3
env:
CIBW_TEST_REQUIRES: "pytest"
CIBW_TEST_COMMAND: "pytest {package}/test"
CIBW_TEST_COMMAND: "PYTHON_GIL=0 pytest {package}/test"
CIBW_SKIP: "pp* cp38-macosx_*"
CIBW_ENABLE: cpython-freerelease
- name: Build sdist
if: runner.os == 'Linux' && runner.arch == 'X64'