Commit ea7afcb
authored
Fix GIL being re-enabled by C++ extensions (#8059)
Towards fixing #7464
Currently, running the scikit-image tests fails on the free-threaded
build because the GIL is enabled at runtime:
```
_______________________________________________ ERROR collecting build-install/usr/lib/python3.14t/site-packages/skimage/feature/censure.py ________________________________________________
build-install/usr/lib/python3.14t/site-packages/skimage/feature/censure.py:6: in <module>
from ..morphology import octagon, star
build-install/usr/lib/python3.14t/site-packages/skimage/morphology/__init__.py:28: in <module>
from ._skeletonize import medial_axis, skeletonize, thin
build-install/usr/lib/python3.14t/site-packages/skimage/morphology/_skeletonize.py:10: in <module>
from ._skeletonize_lee_cy import _compute_thin_image
E RuntimeWarning: The global interpreter lock (GIL) has been enabled to load module 'skimage.morphology._skeletonize_lee_cy', which has not declared that it can run safely without the GIL. To override this behavior and keep the GIL disabled (at your own risk), run with PYTHON_GIL=0 or -Xgil=0.
```
This is happening because the `cython_args` aren't being passed to the
C++ codegen function in the project's meson configuration.
I changed the name of the variable to `cython_codegen_args` to make it a
little clearer it has nothing to do with `cython_c_args` and
`cython_cpp_args`, which are passed to e.g. clang and not Cython. I also
made `cython_gen_cpp` use the same arguments as `cython_gen`.
`c_undefined_ok` is unused, so I deleted it.
Finally, I added a regression test for this in the project's
`conftest.py`, following a similar check I added to numpy's
`conftest.py` a while back. I also added a 3.14t testing job and deleted
the 3.13t job and special testing logic. All of that is unnecessary now.
I will follow up after this to make the 3.14t testing job use
pytest-run-parallel, superseding #7678.1 parent 89009eb commit ea7afcb
3 files changed
Lines changed: 26 additions & 56 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| |||
131 | 131 | | |
132 | 132 | | |
133 | 133 | | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | 134 | | |
181 | 135 | | |
182 | | - | |
| 136 | + | |
183 | 137 | | |
184 | 138 | | |
185 | 139 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
131 | | - | |
| 131 | + | |
| 132 | + | |
132 | 133 | | |
133 | | - | |
| 134 | + | |
134 | 135 | | |
135 | 136 | | |
136 | | - | |
137 | | - | |
138 | 137 | | |
139 | | - | |
| 138 | + | |
140 | 139 | | |
141 | 140 | | |
142 | 141 | | |
143 | | - | |
| 142 | + | |
144 | 143 | | |
145 | 144 | | |
146 | | - | |
147 | | - | |
148 | 145 | | |
149 | 146 | | |
150 | 147 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
14 | 19 | | |
15 | 20 | | |
16 | 21 | | |
| |||
59 | 64 | | |
60 | 65 | | |
61 | 66 | | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
0 commit comments