Skip to content

Commit fe4d1b2

Browse files
committed
build: backport ftcompat fix
1 parent 1b578c2 commit fe4d1b2

File tree

6 files changed

+12
-7
lines changed

6 files changed

+12
-7
lines changed

cuda_bindings/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ def do_cythonize(extensions):
326326
return cythonize(
327327
extensions,
328328
nthreads=nthreads,
329-
compiler_directives=dict(language_level=3, embedsignature=True, binding=True),
329+
compiler_directives=dict(language_level=3, embedsignature=True, binding=True, freethreading_compatible=True),
330330
**extra_cythonize_kwargs,
331331
)
332332

cuda_bindings/tests/cython/build_tests.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ REM SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE
55

66
setlocal
77
set CL=%CL% /I"%CUDA_HOME%\include"
8-
cythonize -3 -i %~dp0test_*.pyx
8+
cythonize -3 -i -Xfreethreading_compatible=True %~dp0test_*.pyx
99
endlocal

cuda_bindings/tests/cython/build_tests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ else
1414
exit 1
1515
fi
1616

17-
cythonize -3 -i ${SCRIPTPATH}/test_*.pyx
17+
cythonize -3 -i -Xfreethreading_compatible=True ${SCRIPTPATH}/test_*.pyx

cuda_core/pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# SPDX-License-Identifier: Apache-2.0
44

55
[build-system]
6-
requires = ["setuptools>=77.0.0", "Cython>=3.0"]
6+
requires = ["setuptools>=77.0.0", "Cython>=3.1"]
77
build-backend = "setuptools.build_meta"
88

99

@@ -48,7 +48,7 @@ dependencies = [
4848
[project.optional-dependencies]
4949
cu11 = ["cuda-bindings[all]==11.8.*"]
5050
cu12 = ["cuda-bindings[all]==12.*"]
51-
test = ["cython>=3.0", "setuptools", "pytest>=6.2.4"]
51+
test = ["cython>=3.1", "setuptools", "pytest>=6.2.4"]
5252
test-cu11 = ["cuda-core[test]", "cupy-cuda11x", "nvidia-cuda-runtime-cu11"] # runtime headers needed by CuPy
5353
test-cu12 = ["cuda-core[test]", "cupy-cuda12x", "nvidia-cuda-runtime-cu12"] # runtime headers needed by CuPy
5454

cuda_core/setup.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,12 @@ def build_extensions(self):
4141

4242

4343
setup(
44-
ext_modules=cythonize(ext_modules, verbose=True, language_level=3, compiler_directives={"embedsignature": True}),
44+
ext_modules=cythonize(
45+
ext_modules,
46+
verbose=True,
47+
language_level=3,
48+
compiler_directives={"embedsignature": True, "freethreading_compatible": True},
49+
),
4550
cmdclass={
4651
"build_ext": build_ext,
4752
},

cuda_core/tests/cython/build_tests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ else
1515
exit 1
1616
fi
1717

18-
cythonize -3 -i ${SCRIPTPATH}/test_*.pyx
18+
cythonize -3 -i -Xfreethreading_compatible=True ${SCRIPTPATH}/test_*.pyx

0 commit comments

Comments
 (0)