Skip to content

Commit 2112ec3

Browse files
committed
Fix the Cython version check in meson.build
1 parent 173b88f commit 2112ec3

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

.github/workflows/buildwheel.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,8 @@ jobs:
103103
python --version --version
104104
which python
105105
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())"
106+
python -c "import sys; print(getattr(sys, '_is_gil_enabled', lambda: True)())"
107+
python -c "import sys; import flint; print(getattr(sys, '_is_gil_enabled', lambda: True)())"
108108
109109
- run: python -m flint.test --verbose
110110

meson.build

+8-3
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,15 @@ add_project_arguments(
8383
language : 'cython'
8484
)
8585

86-
# Enable free-threading if Cython is new enough:
86+
# Enable free-threading if Cython is new enough. The check should be
87+
# >= 3.1.0a1 but meson gets confused by the a1 alpha release suffix.
88+
# so we go with >= 3.1 (which will be correct once 3.1 is released).
8789
cy = meson.get_compiler('cython')
88-
if cy.version().version_compare('>=3.1.0a1')
89-
add_project_arguments('-Xfreethreading_compatible=true', language : 'cython')
90+
if cy.version().version_compare('>=3.1')
91+
message('Enabling freethreading')
92+
add_project_arguments('-Xfreethreading_compatible=true', language : 'cython')
93+
else
94+
message('Disabling freethreading')
9095
endif
9196

9297
if get_option('coverage')

0 commit comments

Comments
 (0)