diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index 98ef423..f9a6f65 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -38,7 +38,7 @@ env: PY_COLORS: 1 # Recognized by the `py` package, dependency of `pytest` PYTHONIOENCODING: utf-8 PYTHONUTF8: 1 - PYTHON_LATEST: 3.12 + PYTHON_LATEST: 3.13 jobs: @@ -184,6 +184,7 @@ jobs: strategy: matrix: pyver: + - 3.13t - 3.13 - 3.12 - 3.11 @@ -229,9 +230,11 @@ jobs: pattern: ${{ needs.pre-setup.outputs.dists-artifact-name }}* merge-multiple: true + # TODO: Revert back to using actions/setup-python once the official + # action supports free-threaded Python - name: Setup Python ${{ matrix.pyver }} id: python-install - uses: actions/setup-python@v5 + uses: quansight-labs/setup-python@v5 with: python-version: ${{ matrix.pyver }} allow-prereleases: true diff --git a/.github/workflows/reusable-linters.yml b/.github/workflows/reusable-linters.yml index 1b0c6e4..e1c86ec 100644 --- a/.github/workflows/reusable-linters.yml +++ b/.github/workflows/reusable-linters.yml @@ -21,7 +21,7 @@ env: PY_COLORS: 1 # Recognized by the `py` package, dependency of `pytest` PYTHONIOENCODING: utf-8 PYTHONUTF8: 1 - PYTHON_LATEST: 3.12 + PYTHON_LATEST: 3.13 jobs: diff --git a/CHANGES/84.feature.rst b/CHANGES/84.feature.rst new file mode 100644 index 0000000..c5da0e0 --- /dev/null +++ b/CHANGES/84.feature.rst @@ -0,0 +1 @@ +Implemented support for the free-threaded build of CPython 3.13 -- by :user:`lysnikolaou`. diff --git a/CHANGES/84.packaging.rst b/CHANGES/84.packaging.rst new file mode 100644 index 0000000..911a78b --- /dev/null +++ b/CHANGES/84.packaging.rst @@ -0,0 +1 @@ +Started building wheels for the free-threaded build of CPython 3.13 -- by :user:`lysnikolaou`. diff --git a/docs/spelling_wordlist.txt b/docs/spelling_wordlist.txt index 69ac7e8..9ae57bc 100644 --- a/docs/spelling_wordlist.txt +++ b/docs/spelling_wordlist.txt @@ -1,5 +1,6 @@ Bluesky Bugfixes +CPython Changelog Codecov Cython diff --git a/packaging/pep517_backend/_backend.py b/packaging/pep517_backend/_backend.py index 2f5bf95..a43059c 100644 --- a/packaging/pep517_backend/_backend.py +++ b/packaging/pep517_backend/_backend.py @@ -4,6 +4,7 @@ from __future__ import annotations import os +import sysconfig import typing as t from contextlib import contextmanager, nullcontext, suppress from functools import partial @@ -371,10 +372,13 @@ def get_requires_for_build_wheel( stacklevel=999, ) - c_ext_build_deps = [] if is_pure_python_build else [ - 'Cython ~= 3.0.0; python_version >= "3.12"', - 'Cython; python_version < "3.12"', - ] + if is_pure_python_build: + c_ext_build_deps = [] + elif sysconfig.get_config_var("Py_GIL_DISABLED"): + # TODO: Remove when there's a Cython final with free-threading support + c_ext_build_deps = ['Cython == 3.1.0a1'] + else: + c_ext_build_deps = ['Cython ~= 3.0.0'] return _setuptools_get_requires_for_build_wheel( config_settings=config_settings, diff --git a/pyproject.toml b/pyproject.toml index 88d82b5..02dce1f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -64,6 +64,7 @@ linetrace = "True" # Implies `profile=True` [tool.cibuildwheel] build-frontend = "build" +enable = ["cpython-freethreading"] before-test = [ # NOTE: Attempt to have pip pre-compile PyYAML wheel with our build # NOTE: constraints unset. The hope is that pip will cache that wheel diff --git a/requirements/cython.txt b/requirements/cython.txt index 3eaca16..0dd05b9 100644 --- a/requirements/cython.txt +++ b/requirements/cython.txt @@ -1 +1,2 @@ -cython==3.0.11 +cython==3.0.11; python_version < '3.13' +cython==3.1.0a1; python_version >= '3.13' diff --git a/src/propcache/_helpers_c.pyx b/src/propcache/_helpers_c.pyx index 0c42ff3..49ad946 100644 --- a/src/propcache/_helpers_c.pyx +++ b/src/propcache/_helpers_c.pyx @@ -1,4 +1,4 @@ -# cython: language_level=3 +# cython: language_level=3, freethreading_compatible=True from types import GenericAlias