Skip to content

Commit 4cb5389

Browse files
kkraus14leofang
andauthored
Move dependencies from requirements.txt to an optional packaging extra (#638)
* Move dependencies from requirements.txt to an optional packaging extra Signed-off-by: Keith Kraus <[email protected]> * move cuda_core test requirements to pyproject.toml optional dependencies as well Signed-off-by: Keith Kraus <[email protected]> * Need to expand wildcard to use the bracket syntax Co-authored-by: Leo Fang <[email protected]> * Add cython to test dependencies for now * add missing distutils dependency, used in cython files directives * distutils is part of setuptools --------- Signed-off-by: Keith Kraus <[email protected]> Co-authored-by: Leo Fang <[email protected]>
1 parent 71762af commit 4cb5389

File tree

8 files changed

+20
-31
lines changed

8 files changed

+20
-31
lines changed

.github/workflows/test-wheel-linux.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -318,14 +318,13 @@ jobs:
318318
pushd "${CUDA_BINDINGS_ARTIFACTS_DIR}"
319319
if [[ "${{ matrix.LOCAL_CTK }}" == 1 ]]; then
320320
ls $CUDA_PATH
321-
pip install *.whl
321+
pip install $(ls *.whl)[test]
322322
else
323-
pip install $(ls *.whl)[all]
323+
pip install $(ls *.whl)[all,test]
324324
fi
325325
popd
326326
327327
pushd ./cuda_bindings
328-
pip install -r requirements.txt
329328
${SANITIZER_CMD} pytest -rxXs -v tests/
330329
331330
# It is a bit convoluted to run the Cython tests against CTK wheels,
@@ -356,11 +355,10 @@ jobs:
356355
fi
357356
TEST_CUDA_MAJOR="$(cut -d '.' -f 1 <<< ${{ matrix.CUDA_VER }})"
358357
pushd "${CUDA_CORE_ARTIFACTS_DIR}"
359-
pip install $(ls *.whl)["cu${TEST_CUDA_MAJOR}"]
358+
pip install $(ls *.whl)["cu${TEST_CUDA_MAJOR}","test-cu${TEST_CUDA_MAJOR}"]
360359
popd
361360
362361
pushd ./cuda_core
363-
pip install -r "tests/requirements-cu${TEST_CUDA_MAJOR}.txt"
364362
${SANITIZER_CMD} pytest -rxXs -v tests/
365363
366364
# It is a bit convoluted to run the Cython tests against CTK wheels,

.github/workflows/test-wheel-windows.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -246,14 +246,13 @@ jobs:
246246
if ('${{ matrix.LOCAL_CTK }}' -eq '1') {
247247
Get-ChildItem $env:CUDA_PATH
248248
echo $PATH
249-
pip install (Get-ChildItem -Filter *.whl).FullName
249+
pip install "$((Get-ChildItem -Filter *.whl).FullName)[test]"
250250
} else {
251-
pip install "$((Get-ChildItem -Filter *.whl).FullName)[all]"
251+
pip install "$((Get-ChildItem -Filter *.whl).FullName)[all,test]"
252252
}
253253
Pop-Location
254254
255255
Push-Location ./cuda_bindings
256-
pip install -r requirements.txt
257256
pytest -rxXs -v tests/
258257
# skip Cython tests for now (NVIDIA/cuda-python#466)
259258
Pop-Location
@@ -273,11 +272,10 @@ jobs:
273272
}
274273
$TEST_CUDA_MAJOR = '${{ matrix.CUDA_VER }}' -split '\.' | Select-Object -First 1
275274
Push-Location $env:CUDA_CORE_ARTIFACTS_DIR
276-
pip install "$((Get-ChildItem -Filter *.whl).FullName)[cu${TEST_CUDA_MAJOR}]"
275+
pip install "$((Get-ChildItem -Filter *.whl).FullName)[cu${TEST_CUDA_MAJOR},test-cu${TEST_CUDA_MAJOR}]"
277276
Pop-Location
278277
279278
Push-Location ./cuda_core
280-
pip install -r "tests/requirements-cu${TEST_CUDA_MAJOR}.txt"
281279
pytest -rxXs -v tests/
282280
Pop-Location
283281

cuda_bindings/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ This subpackage adheres to the developing practices described in the parent meta
1212

1313
## Testing
1414

15-
Latest dependencies can be found in [requirements.txt](https://github.com/NVIDIA/cuda-python/blob/main/cuda_bindings/requirements.txt).
15+
Testing dependencies can be installed using the `[test]` optional dependency identifier. For example, `pip install -v -e .[test]`.
1616

1717
Multiple testing options are available:
1818

cuda_bindings/pyproject.toml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE
33

44
[build-system]
5-
requires = ["setuptools>=77.0.0", "cython", "pyclibrary"]
5+
requires = ["setuptools>=77.0.0", "cython>=3.0", "pyclibrary>=0.1.7"]
66
build-backend = "setuptools.build_meta"
77

88
[project]
@@ -37,6 +37,15 @@ all = [
3737
"nvidia-nvjitlink-cu12>=12.3",
3838
]
3939

40+
test = [
41+
"cython>=3.0",
42+
"setuptools",
43+
"numpy>=1.21.1",
44+
"pytest>=6.2.4",
45+
"pytest-benchmark>=3.4.1",
46+
"llvmlite"
47+
]
48+
4049
[project.urls]
4150
Repository = "https://github.com/NVIDIA/cuda-python"
4251
Documentation = "https://nvidia.github.io/cuda-python/"

cuda_bindings/requirements.txt

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

cuda_core/pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ dependencies = [
4848
[project.optional-dependencies]
4949
cu11 = ["cuda-bindings==11.8.*"]
5050
cu12 = ["cuda-bindings==12.*"]
51+
test = ["cython>=3.0", "setuptools", "pytest>=6.2.4"]
52+
test-cu11 = ["cuda-core[test]", "cupy-cuda11x", "nvidia-cuda-runtime-cu11"] # runtime headers needed by CuPy
53+
test-cu12 = ["cuda-core[test]", "cupy-cuda12x", "nvidia-cuda-runtime-cu12"] # runtime headers needed by CuPy
5154

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

cuda_core/tests/requirements-cu11.txt

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

cuda_core/tests/requirements-cu12.txt

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

0 commit comments

Comments
 (0)