Skip to content

Commit 173b88f

Browse files
committed
Add CPython 3.13t to the build matrix
1 parent c40f102 commit 173b88f

File tree

3 files changed

+26
-18
lines changed

3 files changed

+26
-18
lines changed

.github/workflows/buildwheel.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ jobs:
8686
os: [ubuntu-24.04, ubuntu-24.04-arm, windows-2019, macos-13, macos-14]
8787
# This list to be kept in sync with cibuildwheel config
8888
# and python-requires in pyproject.toml.
89-
python-version: ['3.11', '3.12', '3.13'] # , 'pypy3.10']
89+
python-version: ['3.11', '3.12', '3.13', '3.13t'] # , 'pypy3.10']
9090

9191
steps:
9292
- uses: actions/setup-python@v5
@@ -97,6 +97,15 @@ jobs:
9797
name: wheels-${{ matrix.os }}
9898
path: wheelhouse
9999
- run: pip install --no-index --find-links wheelhouse python_flint
100+
101+
# Check if the GIL is disabled in the free-threading build after import.
102+
- run: |
103+
python --version --version
104+
which python
105+
python -c "import sysconfig; print(sysconfig.get_config_var('Py_GIL_DISABLED'))"
106+
python -c "import sys; print(sys._is_gil_enabled())"
107+
python -c "import sys; import flint; print(sys._is_gil_enabled())"
108+
100109
- run: python -m flint.test --verbose
101110

102111
# On new enough Ubuntu we can build against the system deb.

meson.build

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,10 @@ add_project_arguments(
8484
)
8585

8686
# Enable free-threading if Cython is new enough:
87-
#cy = meson.get_compiler('cython')
88-
#if cy.version().version_compare('>=3.1.0')
89-
# add_project_arguments('-Xfreethreading_compatible=true', language : 'cython')
90-
#endif
87+
cy = meson.get_compiler('cython')
88+
if cy.version().version_compare('>=3.1.0a1')
89+
add_project_arguments('-Xfreethreading_compatible=true', language : 'cython')
90+
endif
9191

9292
if get_option('coverage')
9393
add_project_arguments('-X', 'linetrace=True', language : 'cython')

pyproject.toml

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ version = "0.7.0"
66
requires-python = ">= 3.11"
77
authors = [
88
{name = "Fredrik Johansson", email = "[email protected]"},
9+
{name = "Oscar Benjamin", email = "[email protected]"},
910
]
1011
license = {text = "MIT"}
1112
classifiers = [
@@ -27,16 +28,16 @@ content-type = "text/markdown"
2728
# Minimum build requirements tested in CI need to be kept in sync with the
2829
# versions in requires below so that they are tested.
2930
#
30-
# The upper cap on Cython is speculative but we may as well cap it given that
31-
# it is only a build requirement and that it is not uncommon for newer Cython
32-
# versions to break the build. For example Cython 3.0 broke the build and then
33-
# Cython 3.1 broke the build again so python-flint 0.6.0 did not have any upper
34-
# cap but it should have had cython>=3.0,<3.1 i.e. precisely one minor release
35-
# of Cython works. In future we could contemplate not having an upper cap but
36-
# until we have actually witnessed a Cython 3.x release that does not break the
37-
# build we should keep the upper cap.
31+
# To support the freethreaded build (CPython 3.13t) the alpha release 3.1.0a1
32+
# of Cython is needed as a minimum requirement. It is possible that future
33+
# versions of Cython might still work but typically a Cython release breaks
34+
# something in the build of python-flint so we pin the exact version here.
3835
#
39-
requires = ["meson-python>=0.13", "cython>=3.0.11,<=3.1.0a1"]
36+
# Apart from the freethreading build any Cython version from 3.0.11 onwards is
37+
# fine. It is not possible to have a separate version constraint here for the
38+
# freethreading build only though.
39+
#
40+
requires = ["meson-python>=0.13", "cython==3.1.0a1"]
4041
build-backend = "mesonpy"
4142

4243
[tool.cython-lint]
@@ -81,12 +82,10 @@ package = "flint"
8182
[tool.cibuildwheel]
8283
# requires-python needs to keep in sync with this and also the list of Python
8384
# versions the wheels are tested against in CI.
84-
build = "cp311-* cp312-* cp313-*" # pp311-*"
85+
build = "cp311-* cp312-* cp313-* cp313t-*" # pp311-*"
8586
skip = "*-win32 *-manylinux_i686 *-musllinux_*"
8687

87-
# This is needed for free-threaded wheels:
88-
# build = "cp313t-*"
89-
# free-threaded-support = true
88+
free-threaded-support = true
9089

9190
manylinux-x86_64-image = "manylinux2014"
9291
manylinux-aarch64-image = "manylinux_2_28"

0 commit comments

Comments
 (0)