diff --git a/cuda_core/tests/cython/build_tests.sh b/cuda_core/tests/cython/build_tests.sh index 3e20136133..c92f3dd04e 100755 --- a/cuda_core/tests/cython/build_tests.sh +++ b/cuda_core/tests/cython/build_tests.sh @@ -15,4 +15,11 @@ else exit 1 fi +# pixi-build's editable install exposes the cuda namespace package via a +# finder hook that Cython's filesystem .pxd resolver does not consult. +# Surface the package's parent directory on PYTHONPATH so `cimport +# cuda.bindings.*` can locate the .pxd files. +CUDA_PKG_PARENT=$(python -c "import cuda.bindings as m, os; print(os.path.dirname(os.path.dirname(os.path.dirname(m.__file__))))") +export PYTHONPATH="${CUDA_PKG_PARENT}${PYTHONPATH:+:${PYTHONPATH}}" + cythonize -3 -i -Xfreethreading_compatible=True ${SCRIPTPATH}/test_*.pyx diff --git a/pixi.toml b/pixi.toml index 71d6b5d91b..d36e8f2298 100644 --- a/pixi.toml +++ b/pixi.toml @@ -19,29 +19,30 @@ PIXI_ENVIRONMENT_NAME = "${PIXI_ENVIRONMENT_NAME/default/cu13}" # Test Tasks # Runs tests across all sub-packages: pathfinder → bindings → core (dependency order) -# Each sub-package has its own pixi.toml; the -e environment propagates via PIXI_ENVIRONMENT_NAME +# Each sub-package has its own pixi.toml; the active environment is forwarded +# explicitly via -e "$PIXI_ENVIRONMENT_NAME" in each inner pixi run. # # Usage: pixi run test | pixi run -e cu12 test | pixi run -e cu13 test [target.linux.tasks.test-pathfinder] cmd = [ - "pixi", - "run", - "--manifest-path", - "$PIXI_PROJECT_ROOT/cuda_pathfinder", - "test", + "bash", + "-c", + 'pixi run --manifest-path "$PIXI_PROJECT_ROOT/cuda_pathfinder" -e "$PIXI_ENVIRONMENT_NAME" test', ] [target.linux.tasks.test-bindings] cmd = [ - "pixi", - "run", - "--manifest-path", - "$PIXI_PROJECT_ROOT/cuda_bindings", - "test", + "bash", + "-c", + 'pixi run --manifest-path "$PIXI_PROJECT_ROOT/cuda_bindings" -e "$PIXI_ENVIRONMENT_NAME" test', ] [target.linux.tasks.test-core] -cmd = ["pixi", "run", "--manifest-path", "$PIXI_PROJECT_ROOT/cuda_core", "test"] +cmd = [ + "bash", + "-c", + 'pixi run --manifest-path "$PIXI_PROJECT_ROOT/cuda_core" -e "$PIXI_ENVIRONMENT_NAME" test', +] [target.linux.tasks.test] depends-on = [