Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement support for the free-threaded build of CPython 3.13 #84

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -184,6 +184,7 @@ jobs:
strategy:
matrix:
pyver:
- 3.13t
- 3.13
- 3.12
- 3.11
Expand Down Expand Up @@ -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
lysnikolaou marked this conversation as resolved.
Show resolved Hide resolved
with:
python-version: ${{ matrix.pyver }}
allow-prereleases: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/reusable-linters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
1 change: 1 addition & 0 deletions CHANGES/84.feature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Implemented support for the free-threaded build of CPython 3.13 -- by :user:`lysnikolaou`.
1 change: 1 addition & 0 deletions CHANGES/84.packaging.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Started building wheels for the free-threaded build of CPython 3.13 -- by :user:`lysnikolaou`.
1 change: 1 addition & 0 deletions docs/spelling_wordlist.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Bluesky
Bugfixes
CPython
Changelog
Codecov
Cython
Expand Down
3 changes: 2 additions & 1 deletion packaging/pep517_backend/_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,8 @@ def get_requires_for_build_wheel(
)

c_ext_build_deps = [] if is_pure_python_build else [
'Cython ~= 3.0.0; python_version >= "3.12"',
'Cython == 3.1.0a1; python_version >= "3.13"',
'Cython ~= 3.0.0; python_version == "3.12"',
'Cython; python_version < "3.12"',
]

Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion requirements/cython.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
cython==3.0.11
cython==3.0.11; python_version < '3.13'
cython==3.1.0a1; python_version >= '3.13'
2 changes: 1 addition & 1 deletion src/propcache/_helpers_c.pyx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# cython: language_level=3
# cython: language_level=3, freethreading_compatible=True
from types import GenericAlias
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this can go into pyproject.toml. There's a section for Cython.

Copy link
Author

@lysnikolaou lysnikolaou Jan 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried that but it unfortunately cannot, because there's not the ability to add a version-specific option to pyproject.toml. For this, the build backend would have to be changed, which seems like a bigger hassle.



Expand Down
Loading