Skip to content

Commit 76a5fcb

Browse files
committed
chore: backport pyproject.toml files
1 parent 53eaf7a commit 76a5fcb

File tree

2 files changed

+54
-17
lines changed

2 files changed

+54
-17
lines changed

cuda_bindings/pyproject.toml

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE
33

44
[build-system]
5-
requires = ["setuptools>=77.0.0", "cython>=3.0,<3.1.0", "pyclibrary>=0.1.7"]
5+
requires = ["setuptools>=77.0.0", "cython>=3.1,<3.2", "pyclibrary>=0.1.7"]
66
build-backend = "setuptools.build_meta"
77

88
[project]
@@ -28,19 +28,16 @@ dynamic = [
2828
]
2929
dependencies = [
3030
"cuda-pathfinder ~=1.1",
31-
"pywin32; sys_platform == 'win32'",
3231
]
3332

3433
[project.optional-dependencies]
3534
all = [
36-
"nvidia-cuda-nvcc-cu12",
37-
"nvidia-cuda-nvrtc-cu12",
38-
"nvidia-nvjitlink-cu12>=12.3",
39-
"nvidia-cufile-cu12; sys_platform == 'linux'",
35+
"cuda-toolkit[nvrtc,nvjitlink,nvvm]==13.*",
36+
"cuda-toolkit[cufile]==13.*; sys_platform == 'linux'",
4037
]
4138

4239
test = [
43-
"cython>=3.0,<3.1.0",
40+
"cython>=3.1,<3.2",
4441
"setuptools>=77.0.0",
4542
"numpy>=1.21.1",
4643
"pytest>=6.2.4",
@@ -85,9 +82,9 @@ select = [
8582
]
8683

8784
ignore = [
88-
"UP007",
85+
"UP007",
8986
"E741", # ambiguous variable name such as I
90-
"B007", # rename unsued loop variable to _name
87+
"B007", # rename unsued loop variable to _name
9188
"UP035" # UP006, UP007, UP035 complain about deprecated Typing.<type> use, but disregard backward compatibility of python version
9289
]
9390

@@ -103,13 +100,31 @@ exclude = ["cuda/bindings/_version.py"]
103100
]
104101

105102
"tests/**/*" = [
106-
"E722",
103+
"E722",
107104
"UP022",
108105
"E402", # module level import not at top of file
109106
"F841"] # F841 complains about unused variables, but some assignments have side-effects that could be useful for tests (func calls for example)
110107

111108
"benchmarks/**/*" = [
112-
"E722",
109+
"E722",
113110
"UP022",
114111
"E402", # module level import not at top of file
115112
"F841"] # F841 complains about unused variables, but some assignments have side-effects that could be useful for tests (func calls for example)
113+
114+
[tool.cibuildwheel]
115+
skip = "*-musllinux_*"
116+
enable = "cpython-freethreading"
117+
build-verbosity = 1
118+
environment-pass = ["CUDA_PATH", "CUDA_PYTHON_PARALLEL_LEVEL"]
119+
120+
[tool.cibuildwheel.linux]
121+
archs = "native"
122+
# CIBW mounts the host filesystem under /host
123+
environment-pass = ["CUDA_PATH"]
124+
environment = { CUDA_HOME = "/host/$CUDA_PATH" }
125+
126+
[tool.cibuildwheel.windows]
127+
archs = "AMD64"
128+
before-build = "pip install delvewheel"
129+
repair-wheel-command = "delvewheel repair --namespace-pkg cuda -w {dest_dir} {wheel}"
130+
environment = { CUDA_HOME = "$(cygpath -w $CUDA_PATH)" }

cuda_core/pyproject.toml

Lines changed: 28 additions & 6 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,9 +48,17 @@ 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"]
52-
test-cu11 = ["cuda-core[test]", "cupy-cuda11x", "nvidia-cuda-runtime-cu11"] # runtime headers needed by CuPy
53-
test-cu12 = ["cuda-core[test]", "cupy-cuda12x", "nvidia-cuda-runtime-cu12"] # runtime headers needed by CuPy
51+
cu13 = ["cuda-bindings[all]==13.*"]
52+
# TODO: these should all be in development dependencies; optional dependencies
53+
# are for features exposed to *users*, not a dumping ground for all tooling
54+
# needed to build and test the project
55+
test = ["cython>=3.1", "setuptools", "pytest>=6.2.4"]
56+
test-cu11 = ["cuda-core[test]", "cupy-cuda11x; python_version < '3.14'", "cuda-toolkit[cudart]==11.*"] # runtime headers needed by CuPy
57+
test-cu12 = ["cuda-core[test]", "cupy-cuda12x; python_version < '3.14'", "cuda-toolkit[cudart]==12.*"] # runtime headers needed by CuPy
58+
test-cu13 = ["cuda-core[test]", "cupy-cuda13x; python_version < '3.14'", "cuda-toolkit[cudart]==13.*"] # runtime headers needed by CuPy
59+
# free threaded build, cupy doesn't support free-threaded builds yet, so avoid installing it for now
60+
# TODO: cupy should support free threaded builds
61+
test-cu13-ft = ["cuda-core[test]", "cuda-toolkit[cudart]==13.*"]
5462

5563
[project.urls]
5664
homepage = "https://nvidia.github.io/cuda-python/"
@@ -95,9 +103,9 @@ select = [
95103
]
96104

97105
ignore = [
98-
"UP007",
106+
"UP007",
99107
"E741", # ambiguous variable name such as I
100-
"B007", # rename unsued loop variable to _name
108+
"B007", # rename unsued loop variable to _name
101109
"UP035" # UP006, UP007, UP035 complain about deprecated Typing.<type> use, but disregard backward compatibility of python version
102110
]
103111

@@ -106,3 +114,17 @@ exclude = ["cuda/core/_version.py"]
106114
[tool.ruff.lint.per-file-ignores]
107115
"__init__.py" = ["F401"]
108116
"setup.py" = ["F401"]
117+
118+
[tool.cibuildwheel]
119+
skip = "*-musllinux_*"
120+
enable = "cpython-freethreading"
121+
build-verbosity = 1
122+
environment-pass = ["CUDA_PYTHON_PARALLEL_LEVEL"]
123+
124+
[tool.cibuildwheel.linux]
125+
archs = "native"
126+
127+
[tool.cibuildwheel.windows]
128+
archs = "AMD64"
129+
before-build = "pip install delvewheel"
130+
repair-wheel-command = "delvewheel repair --namespace-pkg cuda -w {dest_dir} {wheel}"

0 commit comments

Comments
 (0)