File tree Expand file tree Collapse file tree
cuda_bindings/tests/cython Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,7 +4,9 @@ REM SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIA
44REM SPDX-License-Identifier: Apache-2.0
55
66setlocal
7- set CL = %CL% /I" %CUDA_HOME% \include"
8- REM Use -j 1 to side-step any process-pool issues and ensure deterministic single-threaded builds
9- cythonize -3 -j 1 -i -Xfreethreading_compatible=True %~dp0 test_*.pyx
10- endlocal
7+ set CL = %CL% /I" %CUDA_HOME% \include"
8+ REM The Python driver provides Cython's .pxd include path and builds in this
9+ REM directory so Windows does not duplicate the checkout path in link outputs.
10+ python " %~dp0 build_tests.py"
11+ set " BUILD_RESULT = %ERRORLEVEL% "
12+ endlocal & exit /b %BUILD_RESULT%
Original file line number Diff line number Diff line change @@ -34,7 +34,10 @@ def _bindings_source_root() -> Path:
3434
3535def main () -> None :
3636 script_dir = Path (__file__ ).resolve ().parent
37- pyx_files = sorted (str (p ) for p in script_dir .glob ("test_*.pyx" ))
37+ # Avoid appending the absolute checkout path under build/temp: the
38+ # concatenated path can exceed Windows' path limit. These files are siblings.
39+ os .chdir (script_dir )
40+ pyx_files = sorted (p .name for p in script_dir .glob ("test_*.pyx" ))
3841 if not pyx_files :
3942 raise SystemExit (f"no test_*.pyx files under { script_dir } " )
4043
@@ -46,13 +49,8 @@ def main() -> None:
4649 compiler_directives = {"freethreading_compatible" : True },
4750 )
4851
49- # `build_ext --inplace` places the compiled .so relative to the current
50- # working directory, but pixi runs this task from the project root. pytest
51- # imports each extension by bare module name (see test_cython.py), which
52- # only resolves when the .so sits in tests/cython (the dir pytest puts on
53- # sys.path). chdir here so the .so lands next to its .pyx regardless of the
54- # invoking cwd.
55- os .chdir (script_dir )
52+ # pytest imports each extension by bare module name (see test_cython.py),
53+ # so build in-place next to its .pyx regardless of the invoking cwd.
5654 sys .argv = [sys .argv [0 ], "build_ext" , "--inplace" ]
5755 setup (name = "cuda_bindings_cython_tests" , ext_modules = ext_modules )
5856
You can’t perform that action at this time.
0 commit comments