Skip to content

Commit d9668c6

Browse files
rparolinclaude
andcommitted
fix(test): replace cython build wrapper with PYTHONPATH shim
Drop cuda_core/tests/cython/build_tests.py in favor of a small PYTHONPATH shim in build_tests.sh. Same outcome (Cython's .pxd resolver finds cuda.bindings via the package's parent directory), three lines instead of a separate setuptools entry point. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 241b3e6 commit d9668c6

2 files changed

Lines changed: 8 additions & 33 deletions

File tree

cuda_core/tests/cython/build_tests.py

Lines changed: 0 additions & 32 deletions
This file was deleted.

cuda_core/tests/cython/build_tests.sh

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

18-
python "${SCRIPTPATH}/build_tests.py"
18+
# pixi-build's editable install exposes the cuda namespace package via a
19+
# finder hook that Cython's filesystem .pxd resolver does not consult.
20+
# Surface the package's parent directory on PYTHONPATH so `cimport
21+
# cuda.bindings.*` can locate the .pxd files.
22+
CUDA_PKG_PARENT=$(python -c "import cuda.bindings as m, os; print(os.path.dirname(os.path.dirname(os.path.dirname(m.__file__))))")
23+
export PYTHONPATH="${CUDA_PKG_PARENT}${PYTHONPATH:+:${PYTHONPATH}}"
24+
25+
cythonize -3 -i -Xfreethreading_compatible=True ${SCRIPTPATH}/test_*.pyx

0 commit comments

Comments
 (0)