From 540800682b86bfaad9aa77889ff76d59c62634e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edgar=20Ram=C3=ADrez-Mondrag=C3=B3n?= Date: Fri, 27 Sep 2024 00:02:07 -0600 Subject: [PATCH] Test with free-threaded Python 3.13 --- .github/workflows/publish.yaml | 1 + .github/workflows/tests.yaml | 11 ++++++++++- tox.ini | 1 + 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index f6b765af..b6605448 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -59,6 +59,7 @@ jobs: CIBW_ARCHS_LINUX: auto aarch64 CIBW_ARCHS_MACOS: auto universal2 CIBW_BUILD_FRONTEND: build + CIBW_FREE_THREADED_SUPPORT: 1 - uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6 with: name: build-wheels-${{ matrix.os }} diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 4a755422..d8b0c556 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -22,6 +22,7 @@ jobs: matrix: include: - {python: '3.13'} + - {name: 'Free-threaded', python: '3.13', free-threaded: true} - {python: '3.12'} - {name: Windows, python: '3.12', os: windows-latest} - {name: Mac, python: '3.12', os: macos-latest} @@ -33,13 +34,21 @@ jobs: steps: - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5.1.1 + if: ${{ !matrix.free-threaded }} with: python-version: ${{ matrix.python }} allow-prereleases: true cache: pip cache-dependency-path: requirements*/*.txt + - uses: deadsnakes/action@e640ac8743173a67cca4d7d77cd837e514bf98e8 # v3.2.0 + if: ${{ matrix.free-threaded }} + with: + python-version: ${{ matrix.python }} + nogil: true - run: pip install tox - - run: tox run -e ${{ matrix.tox || format('py{0}', matrix.python) }} + - env: + PYTHON_GIL: ${{ matrix.free-threaded && '0' || '1' }} + run: tox run -e ${{ matrix.tox || format('py{0}', matrix.python) }} typing: runs-on: ubuntu-latest steps: diff --git a/tox.ini b/tox.ini index 1daab3da..ba3c4148 100644 --- a/tox.ini +++ b/tox.ini @@ -9,6 +9,7 @@ skip_missing_interpreters = true [testenv] package = wheel +pass_env = PYTHON_GIL constrain_package_deps = true use_frozen_constraints = true deps = -r requirements/tests.txt