Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
82bc3c9
Switch to uv build frontend and add top-level uv workspace
kkraus14 Feb 12, 2026
541ac24
Address review comments
kkraus14 Feb 12, 2026
5a4c420
Address second round of review comments
kkraus14 Feb 12, 2026
0e7e756
Restore twine check steps
kkraus14 Feb 12, 2026
9c9757f
Add --system to all uv pip install/list calls in CI
kkraus14 Feb 13, 2026
a736c3d
Fix uv build output directory in workspace context
kkraus14 Feb 13, 2026
1eb0f14
Replace uv sync with uv export | uv pip install --system
kkraus14 Feb 13, 2026
5196e1e
Add --frozen to uv export and switch coverage.yml to uv export
kkraus14 Feb 13, 2026
5f7f735
Fix win-64 py3.14t build: shorten uv cache path on Windows
kkraus14 Feb 13, 2026
8e93038
Keep build[uv] on Windows: shorten TEMP path to avoid cmd.exe limit
kkraus14 Feb 13, 2026
37dd2d0
Add explanatory comments to uv export incantations and workspace conf…
kkraus14 Feb 13, 2026
214e3d6
Switch CI to venvs everywhere, use uv sync for dependency groups
kkraus14 Feb 13, 2026
486b4b7
Use setup-uv v7.3.0 with activate-environment, uv tool run for twine
kkraus14 Feb 13, 2026
d776987
Fix build-wheel: create venv after second setup-python
kkraus14 Feb 13, 2026
9465c42
Fix build-wheel: use uv run for build_tests.sh
kkraus14 Feb 13, 2026
199a3d4
Fix build-wheel: use uv run --no-project for build_tests.sh
kkraus14 Feb 13, 2026
099cf22
Fix build-wheel: prepend venv to PATH for build_tests.sh
kkraus14 Feb 13, 2026
dc1bfb0
Fix: install wheels after uv sync to prevent removal
kkraus14 Feb 13, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ cuda_core/cuda/core/_cpp/*.hpp -binary text diff
*.svg binary
# SCM syntax highlighting & preventing 3-way merges
pixi.lock merge=binary linguist-language=YAML linguist-generated=true
uv.lock merge=binary linguist-language=TOML linguist-generated=true

# "export-subst" specifies that this file will get filled in with the current
# commit and tag information when running `git archive`. This allows
Expand Down
13 changes: 8 additions & 5 deletions .github/workflows/build-docs.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# SPDX-License-Identifier: Apache-2.0

Expand Down Expand Up @@ -77,6 +77,9 @@ jobs:
conda config --show-sources
conda config --show

- name: Install uv
uses: astral-sh/setup-uv@eac588ad8def6316056a12d4907a9d4d84ff7a3b # v7.3.0

# WAR: Building the doc currently requires CTK installed (NVIDIA/cuda-python#326,327)
- name: Set up mini CTK
uses: ./.github/actions/fetch_ctk
Expand Down Expand Up @@ -181,18 +184,18 @@ jobs:
- name: Install all packages
run: |
pushd cuda_pathfinder
pip install *.whl
uv pip install --system *.whl
popd

pushd "${CUDA_BINDINGS_ARTIFACTS_DIR}"
pip install *.whl
uv pip install --system *.whl
popd

pushd "${CUDA_CORE_ARTIFACTS_DIR}"
pip install *.whl
uv pip install --system *.whl
popd

pip install cuda_python*.whl
uv pip install --system cuda_python*.whl

# This step sets the PR_NUMBER/BUILD_LATEST/BUILD_PREVIEW env vars.
- name: Get PR number
Expand Down
66 changes: 46 additions & 20 deletions .github/workflows/build-wheel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,15 +106,25 @@ jobs:
run: |
env

- name: Install twine
- name: Install uv
uses: astral-sh/setup-uv@eac588ad8def6316056a12d4907a9d4d84ff7a3b # v7.3.0

# Shorten TEMP on Windows so cibuildwheel's build isolation paths
# stay within cmd.exe's ~8KB environment limit (needed for py3.14t).
- name: Shorten TEMP path (Windows)
if: ${{ startsWith(inputs.host-platform, 'win') }}
shell: pwsh
run: |
pip install twine
$short = "C:\t"
New-Item -ItemType Directory -Force -Path $short | Out-Null
"TEMP=$short" | Out-File -FilePath $env:GITHUB_ENV -Append
"TMP=$short" | Out-File -FilePath $env:GITHUB_ENV -Append

# To keep the build workflow simple, all matrix jobs will build a wheel for later use within this workflow.
- name: Build and check cuda.pathfinder wheel
run: |
pushd cuda_pathfinder
pip wheel -v --no-deps .
uv build --wheel --out-dir dist
popd

- name: List the cuda.pathfinder artifacts directory
Expand All @@ -124,22 +134,22 @@ jobs:
else
export CHOWN="sudo chown"
fi
$CHOWN -R $(whoami) cuda_pathfinder/*.whl
ls -lahR cuda_pathfinder
$CHOWN -R $(whoami) cuda_pathfinder/dist/*.whl
ls -lahR cuda_pathfinder/dist

# We only need/want a single pure python wheel, pick linux-64 index 0.
# This is what we will use for testing & releasing.
- name: Check cuda.pathfinder wheel
if: ${{ strategy.job-index == 0 && inputs.host-platform == 'linux-64' }}
run: |
twine check --strict cuda_pathfinder/*.whl
uv tool run twine check --strict cuda_pathfinder/dist/*.whl

- name: Upload cuda.pathfinder build artifacts
if: ${{ strategy.job-index == 0 && inputs.host-platform == 'linux-64' }}
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: cuda-pathfinder-wheel
path: cuda_pathfinder/*.whl
path: cuda_pathfinder/dist/*.whl
if-no-files-found: error

- name: Set up mini CTK
Expand Down Expand Up @@ -192,9 +202,10 @@ jobs:
$CHOWN -R $(whoami) ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }}
ls -lahR ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }}


- name: Check cuda.bindings wheel
run: |
twine check --strict ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }}/*.whl
uv tool run twine check --strict ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }}/*.whl

- name: Upload cuda.bindings build artifacts
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
Expand Down Expand Up @@ -267,8 +278,7 @@ jobs:
if: ${{ strategy.job-index == 0 && inputs.host-platform == 'linux-64' }}
run: |
pushd cuda_python
pip wheel -v --no-deps .
twine check --strict *.whl
uv build --wheel --out-dir dist
popd

- name: List the cuda-python artifacts directory
Expand All @@ -279,15 +289,20 @@ jobs:
else
export CHOWN="sudo chown"
fi
$CHOWN -R $(whoami) cuda_python/*.whl
ls -lahR cuda_python
$CHOWN -R $(whoami) cuda_python/dist/*.whl
ls -lahR cuda_python/dist

- name: Check cuda-python wheel
if: ${{ strategy.job-index == 0 && inputs.host-platform == 'linux-64' }}
run: |
uv tool run twine check --strict cuda_python/dist/*.whl

- name: Upload cuda-python build artifacts
if: ${{ strategy.job-index == 0 && inputs.host-platform == 'linux-64' }}
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: cuda-python-wheel
path: cuda_python/*.whl
path: cuda_python/dist/*.whl
if-no-files-found: error

- name: Set up Python
Expand All @@ -310,13 +325,20 @@ jobs:
# For caching
echo "PY_EXT_SUFFIX=$(python -c "import sysconfig; print(sysconfig.get_config_var('EXT_SUFFIX'))")" >> $GITHUB_ENV

- name: Install cuda.pathfinder (required for next step)
run: |
pip install cuda_pathfinder/*.whl
# Create a fresh venv for the matrix Python (differs from the 3.12 used
# during the build phase above).
- name: Create venv
run: uv venv

- name: Build cuda.bindings Cython tests
run: |
pip install ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }}/*.whl --group ./cuda_bindings/pyproject.toml:test
# Install test deps first, then wheels (uv sync manages the env
# and would remove previously-installed wheels).
uv sync --frozen --package cuda-bindings --only-group test --no-install-project
uv pip install cuda_pathfinder/dist/*.whl
uv pip install ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }}/*.whl
# Activate venv so cythonize is on PATH for build_tests.sh
export PATH="${GITHUB_WORKSPACE}/.venv/bin:${GITHUB_WORKSPACE}/.venv/Scripts:${PATH}"
pushd ${{ env.CUDA_BINDINGS_CYTHON_TESTS_DIR }}
bash build_tests.sh
popd
Expand All @@ -330,7 +352,11 @@ jobs:

- name: Build cuda.core Cython tests
run: |
pip install ${{ env.CUDA_CORE_ARTIFACTS_DIR }}/"cu${BUILD_CUDA_MAJOR}"/*.whl --group ./cuda_core/pyproject.toml:test
# Install test deps first, then the wheel.
uv sync --frozen --package cuda-core --only-group test --no-install-project
uv pip install ${{ env.CUDA_CORE_ARTIFACTS_DIR }}/"cu${BUILD_CUDA_MAJOR}"/*.whl
# Activate venv so cythonize is on PATH for build_tests.sh
export PATH="${GITHUB_WORKSPACE}/.venv/bin:${GITHUB_WORKSPACE}/.venv/Scripts:${PATH}"
pushd ${{ env.CUDA_CORE_CYTHON_TESTS_DIR }}
bash build_tests.sh
popd
Expand Down Expand Up @@ -444,15 +470,15 @@ jobs:

- name: Merge cuda.core wheels
run: |
pip install wheel
uv pip install wheel
python ci/tools/merge_cuda_core_wheels.py \
"${{ env.CUDA_CORE_ARTIFACTS_DIR }}"/cu"${BUILD_CUDA_MAJOR}"/cuda_core*.whl \
"${{ env.CUDA_CORE_ARTIFACTS_DIR }}"/cu"${BUILD_PREV_CUDA_MAJOR}"/cuda_core*.whl \
--output-dir "${{ env.CUDA_CORE_ARTIFACTS_DIR }}"

- name: Check cuda.core wheel
run: |
twine check --strict ${{ env.CUDA_CORE_ARTIFACTS_DIR }}/*.whl
uv tool run twine check --strict ${{ env.CUDA_CORE_ARTIFACTS_DIR }}/*.whl

- name: Upload cuda.core build artifacts
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
Expand Down
37 changes: 19 additions & 18 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# SPDX-License-Identifier: Apache-2.0

Expand Down Expand Up @@ -82,6 +82,11 @@ jobs:
# we use self-hosted runners on which setup-python behaves weirdly...
AGENT_TOOLSDIRECTORY: "/opt/hostedtoolcache"

- name: Install uv
uses: astral-sh/setup-uv@eac588ad8def6316056a12d4907a9d4d84ff7a3b # v7.3.0
with:
activate-environment: true

- name: Set up mini CTK
if: ${{ env.LOCAL_CTK == '1' }}
uses: ./.github/actions/fetch_ctk
Expand All @@ -90,57 +95,53 @@ jobs:
host-platform: ${{ env.HOST_PLATFORM }}
cuda-version: ${{ env.CUDA_VER }}

- name: Create venv
run: |
python -m venv .venv

- name: Build cuda-pathfinder
run: |
.venv/bin/pip install -v ./cuda_pathfinder
uv pip install -v ./cuda_pathfinder

- name: Build cuda-python-test-helpers
run: |
.venv/bin/pip install -v ./cuda_python_test_helpers
uv pip install -v ./cuda_python_test_helpers

- name: Build cuda-bindings
run: |
cd cuda_bindings
../.venv/bin/pip install -v . --group test
uv pip install -v ./cuda_bindings
uv sync --frozen --package cuda-bindings --only-group test --no-install-project

- name: Build cuda-core
run: |
cd cuda_core
../.venv/bin/pip install -v . --group test
uv pip install -v ./cuda_core
uv sync --frozen --package cuda-core --only-group "test-cu$(cut -d. -f1 <<< $CUDA_VER)" --no-install-project

- name: Install coverage tools
run: |
.venv/bin/pip install coverage pytest-cov
uv pip install coverage pytest-cov

- name: Set cuda package install root
run: |
echo "INSTALL_ROOT=$(.venv/bin/python -c 'import cuda; print(cuda.__path__[0])')/.." >> $GITHUB_ENV
echo "INSTALL_ROOT=$(python -c 'import cuda; print(cuda.__path__[0])')/.." >> $GITHUB_ENV
echo "REPO_ROOT=$(pwd)" >> $GITHUB_ENV

- name: Run cuda.pathfinder tests
run: |
cd $INSTALL_ROOT
$REPO_ROOT/.venv/bin/pytest -v --cov=./cuda --cov-append --cov-config=$REPO_ROOT/.coveragerc $REPO_ROOT/cuda_pathfinder/tests
pytest -v --cov=./cuda --cov-append --cov-config=$REPO_ROOT/.coveragerc $REPO_ROOT/cuda_pathfinder/tests

- name: Run cuda.bindings tests
run: |
cd $INSTALL_ROOT
$REPO_ROOT/.venv/bin/pytest -v --cov=./cuda --cov-append --cov-config=$REPO_ROOT/.coveragerc $REPO_ROOT/cuda_bindings/tests
pytest -v --cov=./cuda --cov-append --cov-config=$REPO_ROOT/.coveragerc $REPO_ROOT/cuda_bindings/tests

- name: Run cuda.core tests
run: |
cd $INSTALL_ROOT
$REPO_ROOT/.venv/bin/pytest -v --cov=./cuda --cov-append --cov-config=$REPO_ROOT/.coveragerc $REPO_ROOT/cuda_core/tests
pytest -v --cov=./cuda --cov-append --cov-config=$REPO_ROOT/.coveragerc $REPO_ROOT/cuda_core/tests

- name: Generate coverage report
run: |
cd $INSTALL_ROOT
$REPO_ROOT/.venv/bin/coverage html --rcfile=$REPO_ROOT/.coveragerc
$REPO_ROOT/.venv/bin/coverage xml --rcfile=$REPO_ROOT/.coveragerc -o htmlcov/coverage.xml
coverage html --rcfile=$REPO_ROOT/.coveragerc
coverage xml --rcfile=$REPO_ROOT/.coveragerc -o htmlcov/coverage.xml
mkdir $REPO_ROOT/docs
mv htmlcov $REPO_ROOT/docs/coverage

Expand Down
15 changes: 11 additions & 4 deletions .github/workflows/test-wheel-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,11 @@ jobs:
# we use self-hosted runners on which setup-python behaves weirdly (Python include can't be found)...
AGENT_TOOLSDIRECTORY: "/opt/hostedtoolcache"

- name: Install uv
uses: astral-sh/setup-uv@eac588ad8def6316056a12d4907a9d4d84ff7a3b # v7.3.0
with:
activate-environment: true

- name: Set up mini CTK
if: ${{ matrix.LOCAL_CTK == '1' }}
uses: ./.github/actions/fetch_ctk
Expand Down Expand Up @@ -279,17 +284,19 @@ jobs:
- name: Ensure cuda-python installable
run: |
if [[ "${{ matrix.LOCAL_CTK }}" == 1 ]]; then
pip install --only-binary=:all: cuda_python*.whl
uv pip install cuda_python*.whl
else
pip install --only-binary=:all: $(ls cuda_python*.whl)[all]
uv pip install $(ls cuda_python*.whl)[all]
fi

- name: Install cuda.pathfinder extra wheels for testing
run: |
set -euo pipefail
pushd cuda_pathfinder
pip install --only-binary=:all: -v ./*.whl --group "test-cu${TEST_CUDA_MAJOR}"
pip list
uv pip install -v ./*.whl
# Install the "test-cu${TEST_CUDA_MAJOR}" dependency group from cuda_pathfinder/pyproject.toml.
uv sync --frozen --package cuda-pathfinder --only-group "test-cu${TEST_CUDA_MAJOR}" --no-install-project
uv pip list
popd

- name: Run cuda.pathfinder tests with all_must_work
Expand Down
22 changes: 15 additions & 7 deletions .github/workflows/test-wheel-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,11 @@ jobs:
with:
python-version: ${{ matrix.PY_VER }}

- name: Install uv
uses: astral-sh/setup-uv@eac588ad8def6316056a12d4907a9d4d84ff7a3b # v7.3.0
with:
activate-environment: true

- name: Set up mini CTK
if: ${{ matrix.LOCAL_CTK == '1' }}
uses: ./.github/actions/fetch_ctk
Expand Down Expand Up @@ -254,19 +259,22 @@ jobs:
run: run-tests core

- name: Ensure cuda-python installable
shell: bash --noprofile --norc -xeuo pipefail {0}
run: |
if ('${{ matrix.LOCAL_CTK }}' -eq '1') {
pip install --only-binary=:all: (Get-ChildItem -Filter cuda_python*.whl).FullName
} else {
pip install --only-binary=:all: "$((Get-ChildItem -Filter cuda_python*.whl).FullName)[all]"
}
if [[ "${{ matrix.LOCAL_CTK }}" == 1 ]]; then
uv pip install cuda_python*.whl
else
uv pip install $(ls cuda_python*.whl)[all]
fi

- name: Install cuda.pathfinder extra wheels for testing
shell: bash --noprofile --norc -xeuo pipefail {0}
run: |
pushd cuda_pathfinder
pip install --only-binary=:all: -v ./*.whl --group "test-cu${TEST_CUDA_MAJOR}"
pip list
uv pip install -v ./*.whl
# Install the "test-cu${TEST_CUDA_MAJOR}" dependency group from cuda_pathfinder/pyproject.toml.
uv sync --frozen --package cuda-pathfinder --only-group "test-cu${TEST_CUDA_MAJOR}" --no-install-project
uv pip list
popd

- name: Run cuda.pathfinder tests with all_must_work
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ repos:
language: python
additional_dependencies:
- https://files.pythonhosted.org/packages/cc/20/ff623b09d963f88bfde16306a54e12ee5ea43e9b597108672ff3a408aad6/pathspec-0.12.1-py3-none-any.whl
exclude: '(.*pixi\.lock)|(\.git_archival\.txt)'
exclude: '(.*pixi\.lock)|(\.git_archival\.txt)|uv\.lock'
args: ["--fix"]

- id: no-markdown-in-docs-source
Expand All @@ -46,7 +46,7 @@ repos:
rev: "3e8a8703264a2f4a69428a0aa4dcb512790b2c8c" # frozen: v6.0.0
hooks:
- id: check-added-large-files
exclude: cuda_bindings/cuda/bindings/nvml.pyx
exclude: 'cuda_bindings/cuda/bindings/nvml\.pyx|uv\.lock'
- id: check-case-conflict
- id: check-docstring-first
- id: check-merge-conflict
Expand Down
Loading
Loading