Skip to content

Commit 4065f5c

Browse files
committed
refactor(deps): organize test and dev dependencies using dependency groups
1 parent 95ffffe commit 4065f5c

File tree

6 files changed

+18
-16
lines changed

6 files changed

+18
-16
lines changed

ci/tools/run-tests

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ pushd ./cuda_pathfinder
2626
echo "Installing pathfinder wheel"
2727
pwd
2828
ls
29-
pip install $(ls *.whl)[test]
29+
pip install ./*.whl --group test
3030
popd
3131

3232
if [[ "${test_module}" == "pathfinder" ]]; then
@@ -44,9 +44,9 @@ elif [[ "${test_module}" == "bindings" ]]; then
4444
ls
4545
if [[ "${LOCAL_CTK}" == 1 ]]; then
4646
ls "${CUDA_PATH}"
47-
pip install $(ls *.whl)[test]
47+
pip install ./*.whl --group test
4848
else
49-
pip install $(ls *.whl)[all,test]
49+
pip install $(ls ./*.whl)[all] --group test
5050
fi
5151
popd
5252
pushd ./cuda_bindings
@@ -66,9 +66,9 @@ elif [[ "${test_module}" == "core" ]]; then
6666
pwd
6767
ls
6868
if [[ "${LOCAL_CTK}" == 1 ]]; then
69-
pip install *.whl
69+
pip install ./*.whl
7070
else
71-
pip install $(ls *.whl)[all]
71+
pip install $(ls ./*.whl)[all]
7272
fi
7373
popd
7474
fi
@@ -80,9 +80,9 @@ elif [[ "${test_module}" == "core" ]]; then
8080
if [[ "${LOCAL_CTK}" == 1 ]]; then
8181
# We already installed cuda-bindings, and all CTK components exist locally,
8282
# so just install the test dependencies.
83-
pip install $(ls *.whl)["test-cu${TEST_CUDA_MAJOR}"]
83+
pip install ./*.whl --group "test-cu${TEST_CUDA_MAJOR}"
8484
else
85-
pip install $(ls *.whl)["cu${TEST_CUDA_MAJOR}","test-cu${TEST_CUDA_MAJOR}"]
85+
pip install $(ls ./*.whl)["cu${TEST_CUDA_MAJOR}"] --group "test-cu${TEST_CUDA_MAJOR}"
8686
fi
8787
popd
8888
pushd ./cuda_core

cuda_bindings/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# SPDX-FileCopyrightText: Copyright (c) 2023-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
22
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE
3-
43
[build-system]
54
requires = ["setuptools>=77.0.0", "cython>=3.0,<3.1.0", "pyclibrary>=0.1.7"]
65
build-backend = "setuptools.build_meta"
@@ -36,6 +35,7 @@ all = [
3635
"cuda-toolkit[cufile]==13.*; sys_platform == 'linux'",
3736
]
3837

38+
[dependency-groups]
3939
test = [
4040
"cython>=3.0,<3.1.0",
4141
"setuptools>=77.0.0",

cuda_core/pyproject.toml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,12 @@ dependencies = [
4949
cu11 = ["cuda-bindings[all]==11.8.*"]
5050
cu12 = ["cuda-bindings[all]==12.*"]
5151
cu13 = ["cuda-bindings[all]==13.*"]
52+
53+
[dependency-groups]
5254
test = ["cython>=3.0", "setuptools", "pytest>=6.2.4"]
53-
test-cu11 = ["cuda-core[test]", "cupy-cuda11x", "cuda-toolkit[cudart]==11.*"] # runtime headers needed by CuPy
54-
test-cu12 = ["cuda-core[test]", "cupy-cuda12x", "cuda-toolkit[cudart]==12.*"] # runtime headers needed by CuPy
55-
test-cu13 = ["cuda-core[test]", "cupy-cuda13x", "cuda-toolkit[cudart]==13.*"] # runtime headers needed by CuPy
55+
test-cu11 = [{ include_group = "test" }, "cupy-cuda11x", "cuda-toolkit[cudart]==11.*"] # runtime headers needed by CuPy
56+
test-cu12 = [{ include_group = "test" }, "cupy-cuda12x", "cuda-toolkit[cudart]==12.*"] # runtime headers needed by CuPy
57+
test-cu13 = [{ include_group = "test" }, "cupy-cuda13x", "cuda-toolkit[cudart]==13.*"] # runtime headers needed by CuPy
5658

5759
[project.urls]
5860
homepage = "https://nvidia.github.io/cuda-python/"

cuda_pathfinder/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ requires-python = ">=3.9"
1010
dynamic = ["version", "readme"]
1111
dependencies = []
1212

13-
[project.optional-dependencies]
13+
[dependency-groups]
1414
test = [
1515
"pytest>=6.2.4",
1616
]

scripts/run_tests.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ ensure_installed() {
158158
fi
159159

160160
if [[ "${INSTALL_MODE}" == "force" ]]; then
161-
pip install -e .[test]
161+
pip install -e . --group test
162162
return 0
163163
fi
164164

@@ -177,7 +177,7 @@ sys.exit(0 if str(p).startswith(str(sub)) else 3)
177177
PY
178178
rc=$?
179179
if [[ $rc -ne 0 ]]; then
180-
pip install -e .[test]
180+
pip install -e . --group test
181181
fi
182182
}
183183

toolshed/collect_site_packages_so_files.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ fresh_venv() {
1717
cd cuda_pathfinder/
1818
fresh_venv ../TmpCp12Venv
1919
set -x
20-
pip install --only-binary=:all: -e .[test,test_nvidia_wheels_cu12,test_nvidia_wheels_host]
20+
pip install --only-binary=:all: -e . --group test --group test_nvidia_wheels_cu12 --group test_nvidia_wheels_host
2121
set +x
2222
deactivate
2323
fresh_venv ../TmpCp13Venv
2424
set -x
25-
pip install --only-binary=:all: -e .[test,test_nvidia_wheels_cu13,test_nvidia_wheels_host]
25+
pip install --only-binary=:all: -e . --group test --group test_nvidia_wheels_cu13 --group test_nvidia_wheels_host
2626
set +x
2727
deactivate
2828
cd ..

0 commit comments

Comments
 (0)