Skip to content

Commit eec6988

Browse files
authored
Exclude Cython-generated .cpp files from wheels (#1578)
Use cythonize build_dir parameter to place generated .cpp files in build/cython/ instead of the source tree. This prevents them from being included in the wheel. Additionally, add exclude-package-data for *.cpp in cuda-bindings to exclude any remaining .cpp files from the package.
1 parent 5841ad0 commit eec6988

3 files changed

Lines changed: 5 additions & 0 deletions

File tree

cuda_bindings/pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ Documentation = "https://nvidia.github.io/cuda-python/"
5656
[tool.setuptools.packages.find]
5757
include = ["cuda*"]
5858

59+
[tool.setuptools.exclude-package-data]
60+
"*" = ["*.cpp"]
61+
5962
[tool.setuptools.dynamic]
6063
readme = { file = ["DESCRIPTION.rst"], content-type = "text/x-rst" }
6164

cuda_bindings/setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,7 @@ def do_cythonize(extensions):
356356
return cythonize(
357357
extensions,
358358
nthreads=nthreads,
359+
build_dir="build/cython",
359360
compiler_directives=compiler_directives,
360361
**extra_cythonize_kwargs,
361362
)

cuda_core/build_hooks.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ def get_sources(mod_name):
163163
ext_modules,
164164
verbose=True,
165165
language_level=3,
166+
build_dir="build/cython",
166167
nthreads=nthreads,
167168
compiler_directives=compiler_directives,
168169
compile_time_env=compile_time_env,

0 commit comments

Comments
 (0)