Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
82 changes: 76 additions & 6 deletions .github/workflows/build-wheel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,19 @@ jobs:
run: |
twine check --strict cuda_pathfinder/*.whl

- name: Constrain builds to the local cuda.pathfinder wheel
run: |
pathfinder_wheels=(cuda_pathfinder/cuda_pathfinder-*.whl)
test "${#pathfinder_wheels[@]}" -eq 1
test -f "${pathfinder_wheels[0]}"
mkdir -p wheel-constraints
if [[ "${{ inputs.host-platform }}" == win* ]]; then
pathfinder_uri="file:///$(cygpath -am "${pathfinder_wheels[0]}")"
else
pathfinder_uri="file:///host$(realpath "${pathfinder_wheels[0]}")"
fi
printf 'cuda-pathfinder @ %s\n' "${pathfinder_uri}" | tee wheel-constraints/cuda-bindings.txt

- name: Upload cuda.pathfinder build artifacts
if: ${{ strategy.job-index == 0 && inputs.host-platform == 'linux-64' }}
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
Expand All @@ -172,6 +185,8 @@ jobs:
output-dir: ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }}
env:
CIBW_BUILD: ${{ env.CIBW_BUILD }}
CIBW_BEFORE_BUILD_LINUX: 'python -m pip install --upgrade "pip>=25.3"'
CIBW_BEFORE_BUILD_WINDOWS: 'python -m pip install --upgrade "pip>=25.3" delvewheel'
# TODO: remove cpython-prerelease once 3.15 is officially supported
# Allow CPython pre-release builds (currently 3.15 / 3.15t). This is a
# no-op for stable Python versions because CIBW_BUILD still filters
Expand All @@ -181,6 +196,8 @@ jobs:
CIBW_ENVIRONMENT_LINUX: >
CUDA_PATH=/host/${{ env.CUDA_PATH }}
CUDA_PYTHON_PARALLEL_LEVEL=${{ env.CUDA_PYTHON_PARALLEL_LEVEL }}
PIP_BUILD_CONSTRAINT=/host/${{ github.workspace }}/wheel-constraints/cuda-bindings.txt
PIP_CONSTRAINT=/host/${{ github.workspace }}/wheel-constraints/cuda-bindings.txt
CC="/host/${{ env.SCCACHE_PATH }} cc"
CXX="/host/${{ env.SCCACHE_PATH }} c++"
SCCACHE_GHA_ENABLED=true
Expand All @@ -194,6 +211,8 @@ jobs:
CIBW_ENVIRONMENT_WINDOWS: >
CUDA_PATH="$(cygpath -w ${{ env.CUDA_PATH }})"
CUDA_PYTHON_PARALLEL_LEVEL=${{ env.CUDA_PYTHON_PARALLEL_LEVEL }}
PIP_BUILD_CONSTRAINT="$(cygpath -w ./wheel-constraints/cuda-bindings.txt)"
PIP_CONSTRAINT="$(cygpath -w ./wheel-constraints/cuda-bindings.txt)"
# check cache stats before leaving cibuildwheel
CIBW_BEFORE_TEST_LINUX: >
"/host/${{ env.SCCACHE_PATH }}" --show-adv-stats &&
Expand Down Expand Up @@ -226,6 +245,27 @@ jobs:
run: |
twine check --strict ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }}/*.whl

- name: Constrain cuda.core to the local cuda.bindings wheel
run: |
pathfinder_wheels=(cuda_pathfinder/cuda_pathfinder-*.whl)
bindings_wheels=("${CUDA_BINDINGS_ARTIFACTS_DIR}"/cuda_bindings-"${BUILD_CUDA_MAJOR}".*.whl)
test "${#pathfinder_wheels[@]}" -eq 1
test "${#bindings_wheels[@]}" -eq 1
test -f "${pathfinder_wheels[0]}"
test -f "${bindings_wheels[0]}"
mkdir -p wheel-constraints
if [[ "${{ inputs.host-platform }}" == win* ]]; then
pathfinder_uri="file:///$(cygpath -am "${pathfinder_wheels[0]}")"
bindings_uri="file:///$(cygpath -am "${bindings_wheels[0]}")"
else
pathfinder_uri="file:///host$(realpath "${pathfinder_wheels[0]}")"
bindings_uri="file:///host$(realpath "${bindings_wheels[0]}")"
fi
{
printf 'cuda-pathfinder @ %s\n' "${pathfinder_uri}"
printf 'cuda-bindings @ %s\n' "${bindings_uri}"
} | tee wheel-constraints/cuda-core.txt

Comment on lines +248 to +268

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought we explicitly want to test cuda-core against the already-published cuda-bindings to make sure we don't break backward compat. Does this remove that kind of testing (in favor of testing with latest)? I think ideally we need to do both.

@rwgk rwgk Aug 7, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought we explicitly want to test cuda-core against the already-published cuda-bindings to make sure we don't break backward compat. Does this remove that kind of testing (in favor of testing with latest)?

Good question. I asked codex to carefully inspect the CI code. The answer is:

No, this PR does not remove that compatibility testing.

I think ideally we need to do both.

Agreed. That is already what our CI is meant to do. This PR makes the current-build side reliable without changing the published-wheel compatibility side.

This repository already explicitly implements both:

Scenario cuda-bindings used with current cuda-core
Exact build/test CUDA minor Just-built wheel from the current run
Same major, older test minor Published PyPI wheel
Different major Wheel from the backport branch
nightly-cuda-core Reverse direction: released cuda-core with main-built cuda-pathfinder and cuda-bindings

At a high level, the build and test stages have deliberately different policies:

  1. While building the wheels, the packages from the current checkout are built in dependency order: pathfinder, then bindings, then core. This PR ensures that each downstream PEP 517 build actually uses the corresponding wheel produced earlier in that run.
  2. When testing the resulting core wheel, BINDINGS_SOURCE selects which bindings wheel to install:
    • an exact CUDA major/minor match uses the just-built bindings wheel;
    • a same-major, different-minor match uses the published PyPI wheel for that minor, specifically for the real-world backward-compatibility scenario;
    • a major-version mismatch uses the bindings artifact from the backport branch.

For example, the current build version is CUDA 13.3, while the PR test matrix contains many CUDA 13.0.2 rows. Those rows install cuda-bindings==13.0.* from PyPI, then install the core wheel built by the current CI run and run the core tests. Thus the matrix exercises both current bindings and already-published bindings.

Evidence for published-wheel compatibility coverage

  • ci/tools/env-vars explicitly defines published as installing from PyPI. For a same-major/minor-mismatch it selects that mode "to test the real-world backward-compat scenario."
  • ci/tools/run-tests implements the policy: in published mode it installs cuda-bindings==${TEST_CUDA_MAJOR}.${TEST_CUDA_MINOR}.*, then installs the current-run core wheel and runs its tests.
  • ci/versions.yml and the CUDA 13.0.2 entries in ci/test-matrix.yml ensure that this mode is exercised while the current build CUDA version is 13.3.
  • There is also a separate nightly test in the opposite direction: released cuda-core from PyPI against main-built pathfinder and bindings (ci/test-matrix.yml and ci/tools/run-tests).

Evidence for current-run/local-wheel coverage

  • The same ci/tools/env-vars logic says that an exact CUDA major/minor match uses "the just-built bindings wheel."
  • The test workflows download the core artifact, and in main mode the bindings artifact, from the applicable CI run and pass those wheel paths directly to pip.
  • Before this PR, the ordinary build sequence and its PIP_FIND_LINKS settings already indicated that the newly built local wheels were intended to feed downstream builds. The weakness was that PIP_FIND_LINKS only added candidates; it did not guarantee that pip selected them over PyPI.
  • This PR closes that enforcement gap with direct local-wheel constraints. Those are build-environment constraints, not exact requirements embedded into the finished core wheel. The core wheel continues to declare the broad runtime dependency cuda-bindings[all]==13.*, so a published 13.0 bindings wheel still satisfies it.

The PR changes only the build-wheel, coverage, and sdist-build workflows. It does not change ci/tools/env-vars, ci/tools/run-tests, the test matrix, or the test-wheel workflows that implement the published-wheel compatibility coverage.

One distinction worth calling out: the existing compatibility lane builds the core wheel with the current-run bindings, then installs and tests that wheel with an older published bindings version. It does not separately build/cythonize core against the older binding. If that second build-time scenario is what you meant, it would be additional coverage rather than something this PR removes; the previous unconstrained resolver behavior did not select an older release systematically enough to provide such coverage.

- name: Upload cuda.bindings build artifacts
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
Expand All @@ -240,6 +280,8 @@ jobs:
output-dir: ${{ env.CUDA_CORE_ARTIFACTS_DIR }}
env:
CIBW_BUILD: ${{ env.CIBW_BUILD }}
CIBW_BEFORE_BUILD_LINUX: 'python -m pip install --upgrade "pip>=25.3"'
CIBW_BEFORE_BUILD_WINDOWS: 'python -m pip install --upgrade "pip>=25.3" delvewheel'
# TODO: remove cpython-prerelease once 3.15 is officially supported
# Allow CPython pre-release builds (currently 3.15 / 3.15t). This is a
# no-op for stable Python versions because CIBW_BUILD still filters
Expand All @@ -250,7 +292,8 @@ jobs:
CUDA_PATH=/host/${{ env.CUDA_PATH }}
CUDA_PYTHON_PARALLEL_LEVEL=${{ env.CUDA_PYTHON_PARALLEL_LEVEL }}
CUDA_CORE_BUILD_MAJOR=${{ env.BUILD_CUDA_MAJOR }}
PIP_FIND_LINKS=/host/${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }}
PIP_BUILD_CONSTRAINT=/host/${{ github.workspace }}/wheel-constraints/cuda-core.txt
PIP_CONSTRAINT=/host/${{ github.workspace }}/wheel-constraints/cuda-core.txt
CC="/host/${{ env.SCCACHE_PATH }} cc"
CXX="/host/${{ env.SCCACHE_PATH }} c++"
SCCACHE_GHA_ENABLED=true
Expand All @@ -265,7 +308,8 @@ jobs:
CUDA_PATH="$(cygpath -w ${{ env.CUDA_PATH }})"
CUDA_PYTHON_PARALLEL_LEVEL=${{ env.CUDA_PYTHON_PARALLEL_LEVEL }}
CUDA_CORE_BUILD_MAJOR=${{ env.BUILD_CUDA_MAJOR }}
PIP_FIND_LINKS="$(cygpath -w ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }})"
PIP_BUILD_CONSTRAINT="$(cygpath -w ./wheel-constraints/cuda-core.txt)"
PIP_CONSTRAINT="$(cygpath -w ./wheel-constraints/cuda-core.txt)"
# check cache stats before leaving cibuildwheel
CIBW_BEFORE_TEST_LINUX: >
"/host${{ env.SCCACHE_PATH }}" --show-adv-stats &&
Expand Down Expand Up @@ -444,21 +488,45 @@ jobs:
OLD_BRANCH=$(yq '.backport_branch' ci/versions.yml)
OLD_BASENAME="cuda-bindings-python${PYTHON_VERSION_FORMATTED}-cuda*-${{ inputs.host-platform }}*"
LATEST_PRIOR_RUN_ID=$(./ci/tools/lookup-run-id --branch "${OLD_BRANCH}" NVIDIA/cuda-python "CI")
PREV_BINDINGS_DIR="cuda_bindings/dist-prev"

gh run download $LATEST_PRIOR_RUN_ID -p ${OLD_BASENAME} -R NVIDIA/cuda-python
rm -rf ${OLD_BASENAME}-tests # exclude cython test artifacts
ls -al $OLD_BASENAME
mkdir -p "${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }}"
mv $OLD_BASENAME/*.whl "${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }}"
mkdir -p "${PREV_BINDINGS_DIR}"
mv $OLD_BASENAME/*.whl "${PREV_BINDINGS_DIR}"
rmdir $OLD_BASENAME

- name: Constrain previous cuda.core to the downloaded cuda.bindings wheel
run: |
pathfinder_wheels=(cuda_pathfinder/cuda_pathfinder-*.whl)
bindings_wheels=(cuda_bindings/dist-prev/cuda_bindings-"${BUILD_PREV_CUDA_MAJOR}".*.whl)
test "${#pathfinder_wheels[@]}" -eq 1
test "${#bindings_wheels[@]}" -eq 1
test -f "${pathfinder_wheels[0]}"
test -f "${bindings_wheels[0]}"
mkdir -p wheel-constraints
if [[ "${{ inputs.host-platform }}" == win* ]]; then
pathfinder_uri="file:///$(cygpath -am "${pathfinder_wheels[0]}")"
bindings_uri="file:///$(cygpath -am "${bindings_wheels[0]}")"
else
pathfinder_uri="file:///host$(realpath "${pathfinder_wheels[0]}")"
bindings_uri="file:///host$(realpath "${bindings_wheels[0]}")"
fi
{
printf 'cuda-pathfinder @ %s\n' "${pathfinder_uri}"
printf 'cuda-bindings @ %s\n' "${bindings_uri}"
} | tee wheel-constraints/cuda-core-prev.txt

- name: Build cuda.core wheel
uses: pypa/cibuildwheel@4726cd35bb13f7bde50cf2761f2499ac7b3aa32c # v4.1.1
with:
package-dir: ./cuda_core/
output-dir: ${{ env.CUDA_CORE_ARTIFACTS_DIR }}
env:
CIBW_BUILD: ${{ env.CIBW_BUILD }}
CIBW_BEFORE_BUILD_LINUX: 'python -m pip install --upgrade "pip>=25.3"'
CIBW_BEFORE_BUILD_WINDOWS: 'python -m pip install --upgrade "pip>=25.3" delvewheel'
# TODO: remove cpython-prerelease once 3.15 is officially supported
# Allow CPython pre-release builds (currently 3.15 / 3.15t). This is a
# no-op for stable Python versions because CIBW_BUILD still filters
Expand All @@ -469,7 +537,8 @@ jobs:
CUDA_PATH=/host/${{ env.CUDA_PATH }}
CUDA_PYTHON_PARALLEL_LEVEL=${{ env.CUDA_PYTHON_PARALLEL_LEVEL }}
CUDA_CORE_BUILD_MAJOR=${{ env.BUILD_PREV_CUDA_MAJOR }}
PIP_FIND_LINKS=/host/${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }}
PIP_BUILD_CONSTRAINT=/host/${{ github.workspace }}/wheel-constraints/cuda-core-prev.txt
PIP_CONSTRAINT=/host/${{ github.workspace }}/wheel-constraints/cuda-core-prev.txt
CC="/host/${{ env.SCCACHE_PATH }} cc"
CXX="/host/${{ env.SCCACHE_PATH }} c++"
SCCACHE_GHA_ENABLED=true
Expand All @@ -484,7 +553,8 @@ jobs:
CUDA_PATH="$(cygpath -w ${{ env.CUDA_PATH }})"
CUDA_PYTHON_PARALLEL_LEVEL=${{ env.CUDA_PYTHON_PARALLEL_LEVEL }}
CUDA_CORE_BUILD_MAJOR=${{ env.BUILD_PREV_CUDA_MAJOR }}
PIP_FIND_LINKS="$(cygpath -w ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }})"
PIP_BUILD_CONSTRAINT="$(cygpath -w ./wheel-constraints/cuda-core-prev.txt)"
PIP_CONSTRAINT="$(cygpath -w ./wheel-constraints/cuda-core-prev.txt)"
# check cache stats before leaving cibuildwheel
CIBW_BEFORE_TEST_LINUX: >
"/host${{ env.SCCACHE_PATH }}" --show-adv-stats &&
Expand Down
100 changes: 77 additions & 23 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,18 +118,51 @@ jobs:
run: |
python -m venv .venv

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

- name: Build cuda-bindings
run: |
cd cuda_bindings
../.venv/bin/pip install -v . --group test

- name: Build cuda-core
run: |
- name: Install pip with build-constraint support
run: .venv/bin/python -m pip install "pip>=25.3"

- name: Build and install cuda-pathfinder wheel
run: |
.venv/bin/pip wheel -v --no-deps ./cuda_pathfinder -w ./wheels/
.venv/bin/pip install -v ./wheels/cuda_pathfinder*.whl --group ./cuda_pathfinder/pyproject.toml:test

- name: Constrain builds to the local cuda-pathfinder wheel
run: |
pathfinder_wheels=(wheels/cuda_pathfinder-*.whl)
test "${#pathfinder_wheels[@]}" -eq 1
test -f "${pathfinder_wheels[0]}"
mkdir -p wheel-constraints
pathfinder_uri="file://$(realpath "${pathfinder_wheels[0]}")"
printf 'cuda-pathfinder @ %s\n' "${pathfinder_uri}" | tee wheel-constraints/cuda-bindings.txt

- name: Build and install cuda-bindings wheel
run: |
export PIP_BUILD_CONSTRAINT="$(pwd)/wheel-constraints/cuda-bindings.txt"
export PIP_CONSTRAINT="${PIP_BUILD_CONSTRAINT}"
.venv/bin/pip wheel -v --no-deps ./cuda_bindings -w ./wheels/
.venv/bin/pip install -v ./wheels/cuda_bindings*.whl --group ./cuda_bindings/pyproject.toml:test

- name: Constrain cuda-core to the local cuda-bindings wheel
run: |
CUDA_MAJOR="${CUDA_VER%%.*}"
pathfinder_wheels=(wheels/cuda_pathfinder-*.whl)
bindings_wheels=(wheels/cuda_bindings-"${CUDA_MAJOR}".*.whl)
test "${#pathfinder_wheels[@]}" -eq 1
test "${#bindings_wheels[@]}" -eq 1
test -f "${pathfinder_wheels[0]}"
test -f "${bindings_wheels[0]}"
mkdir -p wheel-constraints
pathfinder_uri="file://$(realpath "${pathfinder_wheels[0]}")"
bindings_uri="file://$(realpath "${bindings_wheels[0]}")"
{
printf 'cuda-pathfinder @ %s\n' "${pathfinder_uri}"
printf 'cuda-bindings @ %s\n' "${bindings_uri}"
} | tee wheel-constraints/cuda-core.txt

- name: Build and install cuda-core
run: |
export PIP_BUILD_CONSTRAINT="$(pwd)/wheel-constraints/cuda-core.txt"
export PIP_CONSTRAINT="${PIP_BUILD_CONSTRAINT}"
cd cuda_core
../.venv/bin/pip install -v . --group test

Expand Down Expand Up @@ -225,27 +258,48 @@ jobs:
run: |
python -m venv .venv

- name: Build and install cuda.pathfinder
- name: Build cuda.pathfinder wheel
run: |
.venv/Scripts/pip install wheel setuptools Cython
.venv/Scripts/python -m pip install "pip>=25.3" wheel setuptools Cython
.venv/Scripts/pip wheel -v --no-deps ./cuda_pathfinder -w ./wheels/

- name: Constrain builds to the local cuda.pathfinder wheel
run: |
pathfinder_wheels=(wheels/cuda_pathfinder-*.whl)
test "${#pathfinder_wheels[@]}" -eq 1
test -f "${pathfinder_wheels[0]}"
mkdir -p wheel-constraints
pathfinder_uri="file:///$(cygpath -am "${pathfinder_wheels[0]}")"
printf 'cuda-pathfinder @ %s\n' "${pathfinder_uri}" | tee wheel-constraints/cuda-bindings.txt

- name: Build cuda.bindings wheel
run: |
export PIP_BUILD_CONSTRAINT="$(cygpath -w "$(pwd)/wheel-constraints/cuda-bindings.txt")"
export PIP_CONSTRAINT="${PIP_BUILD_CONSTRAINT}"
cd cuda_bindings
../.venv/Scripts/pip wheel -v --no-deps . -w ../wheels/

# Pin cuda-bindings to the wheel built above; PIP_PRE, which is what makes
# that .devN wheel visible, would otherwise let a PyPI pre-release win.
- name: Constrain cuda.core to the local cuda.bindings wheel
run: |
CUDA_MAJOR="${CUDA_VER%%.*}"
pathfinder_wheels=(wheels/cuda_pathfinder-*.whl)
bindings_wheels=(wheels/cuda_bindings-"${CUDA_MAJOR}".*.whl)
test "${#pathfinder_wheels[@]}" -eq 1
test "${#bindings_wheels[@]}" -eq 1
test -f "${pathfinder_wheels[0]}"
test -f "${bindings_wheels[0]}"
mkdir -p wheel-constraints
pathfinder_uri="file:///$(cygpath -am "${pathfinder_wheels[0]}")"
bindings_uri="file:///$(cygpath -am "${bindings_wheels[0]}")"
{
printf 'cuda-pathfinder @ %s\n' "${pathfinder_uri}"
printf 'cuda-bindings @ %s\n' "${bindings_uri}"
} | tee wheel-constraints/cuda-core.txt

- name: Build cuda.core wheel
run: |
export PIP_FIND_LINKS="$(pwd)/wheels"
export PIP_PRE=1
bindings_whl="$(ls ./wheels/cuda_bindings-*.whl | head -1)"
bindings_ver="$(basename "$bindings_whl" | cut -d- -f2)"
echo "cuda-bindings==${bindings_ver%%+*}" > "$GITHUB_WORKSPACE/constraints.txt"
cat "$GITHUB_WORKSPACE/constraints.txt"
export PIP_CONSTRAINT="$GITHUB_WORKSPACE/constraints.txt"
export PIP_BUILD_CONSTRAINT="$(cygpath -w "$(pwd)/wheel-constraints/cuda-core.txt")"
export PIP_CONSTRAINT="${PIP_BUILD_CONSTRAINT}"
cd cuda_core
../.venv/Scripts/pip wheel -v --no-deps . -w ../wheels/

Expand Down
34 changes: 31 additions & 3 deletions .github/workflows/test-sdist-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
python-version: "3.12"

- name: Install build tools
run: pip install build
run: python -m pip install "pip>=25.3" build

# Pure Python packages -- no CTK needed.
- name: Build cuda.pathfinder sdist and wheel-from-sdist
Expand All @@ -52,6 +52,15 @@ jobs:
python -m build --sdist cuda_python/
pip wheel --no-deps --wheel-dir cuda_python/dist cuda_python/dist/*.tar.gz

- name: Constrain builds to the local cuda.pathfinder wheel
run: |
pathfinder_wheels=(cuda_pathfinder/dist/cuda_pathfinder-*.whl)
test "${#pathfinder_wheels[@]}" -eq 1
test -f "${pathfinder_wheels[0]}"
mkdir -p wheel-constraints
pathfinder_uri="file://$(realpath "${pathfinder_wheels[0]}")"
printf 'cuda-pathfinder @ %s\n' "${pathfinder_uri}" | tee wheel-constraints/cuda-bindings.txt

# Cython packages need CTK + sccache.
# The env vars ACTIONS_CACHE_SERVICE_V2, ACTIONS_RESULTS_URL, and ACTIONS_RUNTIME_TOKEN
# are exposed by this action.
Expand Down Expand Up @@ -88,10 +97,28 @@ jobs:
export CUDA_PYTHON_PARALLEL_LEVEL=$(nproc)
export CC="sccache cc"
export CXX="sccache c++"
export PIP_FIND_LINKS="$(pwd)/cuda_pathfinder/dist"
export PIP_BUILD_CONSTRAINT="$(pwd)/wheel-constraints/cuda-bindings.txt"
export PIP_CONSTRAINT="${PIP_BUILD_CONSTRAINT}"
python -m build --sdist cuda_bindings/
pip wheel --no-deps --wheel-dir cuda_bindings/dist cuda_bindings/dist/*.tar.gz

- name: Constrain cuda.core to the local cuda.bindings wheel
run: |
CUDA_MAJOR="$(echo '${{ inputs.cuda-version }}' | cut -d. -f1)"
pathfinder_wheels=(cuda_pathfinder/dist/cuda_pathfinder-*.whl)
bindings_wheels=(cuda_bindings/dist/cuda_bindings-"${CUDA_MAJOR}".*.whl)
test "${#pathfinder_wheels[@]}" -eq 1
test "${#bindings_wheels[@]}" -eq 1
test -f "${pathfinder_wheels[0]}"
test -f "${bindings_wheels[0]}"
mkdir -p wheel-constraints
pathfinder_uri="file://$(realpath "${pathfinder_wheels[0]}")"
bindings_uri="file://$(realpath "${bindings_wheels[0]}")"
{
printf 'cuda-pathfinder @ %s\n' "${pathfinder_uri}"
printf 'cuda-bindings @ %s\n' "${bindings_uri}"
} | tee wheel-constraints/cuda-core.txt

# cuda_core sdist delegates to setuptools (no CTK needed), but
# wheel-from-sdist needs CTK and cuda-bindings (dynamic build dep via
# get_requires_for_build_wheel in build_hooks.py).
Expand All @@ -101,7 +128,8 @@ jobs:
export CUDA_CORE_BUILD_MAJOR="$(echo '${{ inputs.cuda-version }}' | cut -d. -f1)"
export CC="sccache cc"
export CXX="sccache c++"
export PIP_FIND_LINKS="$(pwd)/cuda_bindings/dist $(pwd)/cuda_pathfinder/dist"
export PIP_BUILD_CONSTRAINT="$(pwd)/wheel-constraints/cuda-core.txt"
export PIP_CONSTRAINT="${PIP_BUILD_CONSTRAINT}"
python -m build --sdist cuda_core/
pip wheel --no-deps --wheel-dir cuda_core/dist cuda_core/dist/*.tar.gz

Expand Down
Loading
Loading