Skip to content

Commit 117e3db

Browse files
committed
test: simplify core wheel install selection
Centralize the core wheel target selection so both install modes share one pip invocation while preserving when the published cuda.bindings extra is requested. Made-with: Cursor
1 parent 0730157 commit 117e3db

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

ci/tools/run-tests

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -74,15 +74,15 @@ elif [[ "${test_module}" == "core" ]]; then
7474

7575
pushd ./cuda_core
7676
CUDA_VER_MINOR="$(cut -d '.' -f 1-2 <<< "${CUDA_VER}")"
77+
# Start from the built wheel path, then add the published cuda.bindings extra
78+
# when this job is resolving against wheel-installed CTK packages.
79+
WHL_EXTRA=("${CUDA_CORE_ARTIFACTS_DIR}"/*.whl)
80+
if [[ "${LOCAL_CTK}" != 1 ]]; then
81+
WHL_EXTRA=("${WHL_EXTRA[0]}[cu${TEST_CUDA_MAJOR}]")
82+
fi
7783
# Constrain cuda-toolkit to the requested CTK version to avoid
7884
# pip pulling in a newer nvidia-cuda-runtime that conflicts with it.
79-
if [[ "${LOCAL_CTK}" == 1 ]]; then
80-
# We already installed cuda-bindings, and all CTK components exist locally,
81-
# so just install the test dependencies.
82-
pip install "${CUDA_CORE_ARTIFACTS_DIR}"/*.whl --group "test-cu${TEST_CUDA_MAJOR}${FREE_THREADING}" "cuda-toolkit==${CUDA_VER_MINOR}.*"
83-
else
84-
pip install $(ls "${CUDA_CORE_ARTIFACTS_DIR}"/*.whl)["cu${TEST_CUDA_MAJOR}"] --group "test-cu${TEST_CUDA_MAJOR}${FREE_THREADING}" "cuda-toolkit==${CUDA_VER_MINOR}.*"
85-
fi
85+
pip install "${WHL_EXTRA[@]}" --group "test-cu${TEST_CUDA_MAJOR}${FREE_THREADING}" "cuda-toolkit==${CUDA_VER_MINOR}.*"
8686
echo "Running core tests"
8787
${SANITIZER_CMD} pytest -rxXs -v --durations=0 --randomly-dont-reorganize tests/
8888
# Currently our CI always installs the latest bindings (from either major version).

0 commit comments

Comments
 (0)