diff --git a/.github/workflows/test-wheel-linux.yml b/.github/workflows/test-wheel-linux.yml index 037adf71db..a78a9d6117 100644 --- a/.github/workflows/test-wheel-linux.yml +++ b/.github/workflows/test-wheel-linux.yml @@ -318,14 +318,13 @@ jobs: pushd "${CUDA_BINDINGS_ARTIFACTS_DIR}" if [[ "${{ matrix.LOCAL_CTK }}" == 1 ]]; then ls $CUDA_PATH - pip install *.whl + pip install $(ls *.whl)[test] else - pip install $(ls *.whl)[all] + pip install $(ls *.whl)[all,test] fi popd pushd ./cuda_bindings - pip install -r requirements.txt ${SANITIZER_CMD} pytest -rxXs -v tests/ # It is a bit convoluted to run the Cython tests against CTK wheels, @@ -356,11 +355,10 @@ jobs: fi TEST_CUDA_MAJOR="$(cut -d '.' -f 1 <<< ${{ matrix.CUDA_VER }})" pushd "${CUDA_CORE_ARTIFACTS_DIR}" - pip install $(ls *.whl)["cu${TEST_CUDA_MAJOR}"] + pip install $(ls *.whl)["cu${TEST_CUDA_MAJOR}","test-cu${TEST_CUDA_MAJOR}"] popd pushd ./cuda_core - pip install -r "tests/requirements-cu${TEST_CUDA_MAJOR}.txt" ${SANITIZER_CMD} pytest -rxXs -v tests/ # It is a bit convoluted to run the Cython tests against CTK wheels, diff --git a/.github/workflows/test-wheel-windows.yml b/.github/workflows/test-wheel-windows.yml index 4473ad8392..09b2b69adc 100644 --- a/.github/workflows/test-wheel-windows.yml +++ b/.github/workflows/test-wheel-windows.yml @@ -246,14 +246,13 @@ jobs: if ('${{ matrix.LOCAL_CTK }}' -eq '1') { Get-ChildItem $env:CUDA_PATH echo $PATH - pip install (Get-ChildItem -Filter *.whl).FullName + pip install "$((Get-ChildItem -Filter *.whl).FullName)[test]" } else { - pip install "$((Get-ChildItem -Filter *.whl).FullName)[all]" + pip install "$((Get-ChildItem -Filter *.whl).FullName)[all,test]" } Pop-Location Push-Location ./cuda_bindings - pip install -r requirements.txt pytest -rxXs -v tests/ # skip Cython tests for now (NVIDIA/cuda-python#466) Pop-Location @@ -273,11 +272,10 @@ jobs: } $TEST_CUDA_MAJOR = '${{ matrix.CUDA_VER }}' -split '\.' | Select-Object -First 1 Push-Location $env:CUDA_CORE_ARTIFACTS_DIR - pip install "$((Get-ChildItem -Filter *.whl).FullName)[cu${TEST_CUDA_MAJOR}]" + pip install "$((Get-ChildItem -Filter *.whl).FullName)[cu${TEST_CUDA_MAJOR},test-cu${TEST_CUDA_MAJOR}]" Pop-Location Push-Location ./cuda_core - pip install -r "tests/requirements-cu${TEST_CUDA_MAJOR}.txt" pytest -rxXs -v tests/ Pop-Location diff --git a/cuda_bindings/README.md b/cuda_bindings/README.md index 800de17f7a..a0657706d0 100644 --- a/cuda_bindings/README.md +++ b/cuda_bindings/README.md @@ -12,7 +12,7 @@ This subpackage adheres to the developing practices described in the parent meta ## Testing -Latest dependencies can be found in [requirements.txt](https://github.com/NVIDIA/cuda-python/blob/main/cuda_bindings/requirements.txt). +Testing dependencies can be installed using the `[test]` optional dependency identifier. For example, `pip install -v -e .[test]`. Multiple testing options are available: diff --git a/cuda_bindings/pyproject.toml b/cuda_bindings/pyproject.toml index e13dc015c7..f1a97e8069 100644 --- a/cuda_bindings/pyproject.toml +++ b/cuda_bindings/pyproject.toml @@ -2,7 +2,7 @@ # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE [build-system] -requires = ["setuptools>=77.0.0", "cython", "pyclibrary"] +requires = ["setuptools>=77.0.0", "cython>=3.0", "pyclibrary>=0.1.7"] build-backend = "setuptools.build_meta" [project] @@ -37,6 +37,15 @@ all = [ "nvidia-nvjitlink-cu12>=12.3", ] +test = [ + "cython>=3.0", + "setuptools", + "numpy>=1.21.1", + "pytest>=6.2.4", + "pytest-benchmark>=3.4.1", + "llvmlite" +] + [project.urls] Repository = "https://github.com/NVIDIA/cuda-python" Documentation = "https://nvidia.github.io/cuda-python/" diff --git a/cuda_bindings/requirements.txt b/cuda_bindings/requirements.txt deleted file mode 100644 index 09041ba1ff..0000000000 --- a/cuda_bindings/requirements.txt +++ /dev/null @@ -1,11 +0,0 @@ -Cython>=3.0.0 -pytest>=6.2.4 -pytest-benchmark>=3.4.1 -numpy>=1.21.1 -pyclibrary>=0.1.7 -setuptools -tomli; python_version < "3.11" -versioneer==0.29 -wheel -pywin32; sys_platform == 'win32' -# llvmlite # Uncomment to generate MINIMAL_NVVMIR_BITCODE_STATIC for test_nvvm.py (see PR #443). diff --git a/cuda_core/pyproject.toml b/cuda_core/pyproject.toml index 40b4130983..8518a2e282 100644 --- a/cuda_core/pyproject.toml +++ b/cuda_core/pyproject.toml @@ -48,6 +48,9 @@ dependencies = [ [project.optional-dependencies] cu11 = ["cuda-bindings==11.8.*"] cu12 = ["cuda-bindings==12.*"] +test = ["cython>=3.0", "setuptools", "pytest>=6.2.4"] +test-cu11 = ["cuda-core[test]", "cupy-cuda11x", "nvidia-cuda-runtime-cu11"] # runtime headers needed by CuPy +test-cu12 = ["cuda-core[test]", "cupy-cuda12x", "nvidia-cuda-runtime-cu12"] # runtime headers needed by CuPy [project.urls] homepage = "https://nvidia.github.io/cuda-python/" diff --git a/cuda_core/tests/requirements-cu11.txt b/cuda_core/tests/requirements-cu11.txt deleted file mode 100644 index d9bd566c76..0000000000 --- a/cuda_core/tests/requirements-cu11.txt +++ /dev/null @@ -1,4 +0,0 @@ -pytest -# TODO: remove this hack once cupy has a cp313 build -cupy-cuda11x; python_version < "3.13" -nvidia-cuda-runtime-cu11 # headers consumed by CuPy diff --git a/cuda_core/tests/requirements-cu12.txt b/cuda_core/tests/requirements-cu12.txt deleted file mode 100644 index 18f6736033..0000000000 --- a/cuda_core/tests/requirements-cu12.txt +++ /dev/null @@ -1,4 +0,0 @@ -pytest -# TODO: remove this hack once cupy has a cp313 build -cupy-cuda12x; python_version < "3.13" -nvidia-cuda-runtime-cu12 # headers consumed by CuPy