From 6ded77f7a0d6434f188b73c961d4facaa9f2e7fd Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Sun, 9 Nov 2025 09:03:22 +0100 Subject: [PATCH 1/4] Set Py_MOD_GIL_NOT_USED --- cairo/cairomodule.c | 3 +++ tests/cmodule/cmodule.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/cairo/cairomodule.c b/cairo/cairomodule.c index c180695c..804f69f9 100644 --- a/cairo/cairomodule.c +++ b/cairo/cairomodule.c @@ -594,6 +594,9 @@ static int exec_cairo(PyObject *m) static PyModuleDef_Slot cairo_slots[] = { {Py_mod_exec, (void*)exec_cairo}, +#if PY_VERSION_HEX >= 0x030D0000 + {Py_mod_gil, Py_MOD_GIL_NOT_USED}, +#endif {0, NULL}, }; diff --git a/tests/cmodule/cmodule.c b/tests/cmodule/cmodule.c index 728e6b02..8c9a77ec 100644 --- a/tests/cmodule/cmodule.c +++ b/tests/cmodule/cmodule.c @@ -25,6 +25,9 @@ static int exec_cmod(PyObject *m) static PyModuleDef_Slot cmod_slots[] = { {Py_mod_exec, exec_cmod}, +#if PY_VERSION_HEX >= 0x030D0000 + {Py_mod_gil, Py_MOD_GIL_NOT_USED}, +#endif {0, NULL}}; static struct PyModuleDef cmod_module = { From bcab310753fd53fb78e2e526fe195e55aae098ce Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Sun, 9 Nov 2025 09:05:48 +0100 Subject: [PATCH 2/4] CI: Update all actions --- .github/workflows/test.yml | 20 ++++++++++---------- .github/workflows/wheels.yml | 12 ++++++------ 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index edbcbc7b..77bea728 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -18,7 +18,7 @@ jobs: pkgprefix: mingw-w64-clang-x86_64 steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v5 - name: setup-msys2 uses: msys2/setup-msys2@v2 @@ -61,7 +61,7 @@ jobs: poetry run coverage xml -i - name: Upload coverage to Codecov - uses: codecov/codecov-action@v4 + uses: codecov/codecov-action@v5 ubuntu: runs-on: ubuntu-latest @@ -70,10 +70,10 @@ jobs: matrix: python-version: ['3.10', '3.11', '3.12', '3.13', '3.14', 'pypy-3.11'] steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 + uses: actions/setup-python@v6 with: python-version: ${{ matrix.python-version }} allow-prereleases: true @@ -107,7 +107,7 @@ jobs: poetry run coverage xml -i - name: Upload coverage to Codecov - uses: codecov/codecov-action@v4 + uses: codecov/codecov-action@v5 - name: Run linters if: ${{ !contains(matrix.python-version, 'pypy') }} @@ -140,11 +140,11 @@ jobs: architecture: 'arm64' os: 'windows-11-arm' steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Set up Python ${{ matrix.python-version }} id: setup-python - uses: actions/setup-python@v5 + uses: actions/setup-python@v6 with: python-version: ${{ matrix.python-version }} architecture: ${{ matrix.architecture }} @@ -191,14 +191,14 @@ jobs: poetry run coverage xml -i - name: Upload coverage to Codecov - uses: codecov/codecov-action@v4 + uses: codecov/codecov-action@v5 macos: runs-on: macos-latest steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v5 - name: Install dependencies run: | @@ -221,4 +221,4 @@ jobs: poetry run coverage xml -i - name: Upload coverage to Codecov - uses: codecov/codecov-action@v4 + uses: codecov/codecov-action@v5 diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 4013a339..d1b77bd1 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -8,10 +8,10 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Set up Python - uses: actions/setup-python@v5 + uses: actions/setup-python@v6 with: python-version: '3.11' @@ -24,7 +24,7 @@ jobs: - name: Build sdist run: python -m build --sdist - - uses: actions/upload-artifact@v4 + - uses: actions/upload-artifact@v5 with: name: sdist path: ./dist/*.tar.gz @@ -47,7 +47,7 @@ jobs: arch: arm64 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Setup MSVC uses: ilammy/msvc-dev-cmd@v1.13.0 @@ -55,7 +55,7 @@ jobs: arch : ${{ matrix.arch }} - name: Build wheels - uses: pypa/cibuildwheel@v3.1.0 + uses: pypa/cibuildwheel@v3.2.1 env: CFLAGS: "-DCAIRO_WIN32_STATIC_BUILD=1" CIBW_BEFORE_BUILD: "python {package}/.ci/download-cairo-win32.py ${{ matrix.arch }}" @@ -64,7 +64,7 @@ jobs: CIBW_TEST_COMMAND: bash {package}/.ci/test-wheels.sh {package} CIBW_ENVIRONMENT_WINDOWS: PKG_CONFIG_PATH='${{ github.workspace }}/cairo-prebuild/lib/pkgconfig' PKG_CONFIG='${{ github.workspace }}/cairo-prebuild/bin/pkgconf.exe' - - uses: actions/upload-artifact@v4 + - uses: actions/upload-artifact@v5 with: name: "wheel-${{ matrix.arch }}" path: ./wheelhouse/*.whl From 85dec8a39bb42ece8be3c2e4d27635ef764fc40d Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Sun, 9 Nov 2025 09:08:45 +0100 Subject: [PATCH 3/4] CI: enable 314t tests + wheels --- .github/workflows/test.yml | 4 ++-- .github/workflows/wheels.yml | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 77bea728..a401f4ee 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -68,7 +68,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ['3.10', '3.11', '3.12', '3.13', '3.14', 'pypy-3.11'] + python-version: ['3.10', '3.11', '3.12', '3.13', '3.14', '3.14t', 'pypy-3.11'] steps: - uses: actions/checkout@v5 @@ -126,7 +126,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ['3.10', '3.11', '3.12', '3.13', '3.14', 'pypy-3.11'] + python-version: ['3.10', '3.11', '3.12', '3.13', '3.14', '3.14t', 'pypy-3.11'] architecture: ['x64'] os: ['windows-2022'] include: diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index d1b77bd1..858d48ea 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -59,7 +59,8 @@ jobs: env: CFLAGS: "-DCAIRO_WIN32_STATIC_BUILD=1" CIBW_BEFORE_BUILD: "python {package}/.ci/download-cairo-win32.py ${{ matrix.arch }}" - CIBW_BUILD: cp310-${{ matrix.platform_id }} cp311-${{ matrix.platform_id }} cp312-${{ matrix.platform_id }} cp313-${{ matrix.platform_id }} cp314-${{ matrix.platform_id }} + CIBW_BUILD: cp310-${{ matrix.platform_id }} cp311-${{ matrix.platform_id }} cp312-${{ matrix.platform_id }} cp313-${{ matrix.platform_id }} cp314-${{ matrix.platform_id }} cp314t-${{ matrix.platform_id }} + CIBW_SKIP: cp314t-win32 CIBW_TEST_REQUIRES: pytest==8.3.5 CIBW_TEST_COMMAND: bash {package}/.ci/test-wheels.sh {package} CIBW_ENVIRONMENT_WINDOWS: PKG_CONFIG_PATH='${{ github.workspace }}/cairo-prebuild/lib/pkgconfig' PKG_CONFIG='${{ github.workspace }}/cairo-prebuild/bin/pkgconf.exe' From e5038edf408a48a8cab560f8d1beeafdffbd6dc1 Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Sun, 9 Nov 2025 09:12:14 +0100 Subject: [PATCH 4/4] CI: build docs with 3.14 There should be wheels available now --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a401f4ee..751231d4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -116,7 +116,7 @@ jobs: poetry run mypy . - name: Build docs - if: ${{ !contains(matrix.python-version, 'pypy') && !contains(matrix.python-version, '3.14') }} + if: ${{ !contains(matrix.python-version, 'pypy') }} run: | poetry install --with docs poetry run python -m sphinx -W -a -E -b html -n docs docs/_build