Skip to content

Commit bf46dd7

Browse files
kkraus14cursoragent
andcommitted
Use uv sync --inexact to preserve pre-installed wheels
--inexact tells uv sync not to remove extraneous packages, so pre-built wheels installed via uv pip install are preserved. This restores the natural ordering (install wheels first, then sync dependency groups) and simplifies the logic. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 721abce commit bf46dd7

5 files changed

Lines changed: 30 additions & 34 deletions

File tree

.github/workflows/build-wheel.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -332,13 +332,12 @@ jobs:
332332

333333
- name: Install test deps and wheels for Cython tests
334334
run: |
335-
# Run all uv sync calls first (each one resets the venv), then
336-
# install all pre-built wheels after the last sync.
337-
uv sync --frozen --package cuda-bindings --only-group test --no-install-project
338-
uv sync --frozen --package cuda-core --only-group test --no-install-project
339335
uv pip install cuda_pathfinder/dist/*.whl
340336
uv pip install ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }}/*.whl
341337
uv pip install ${{ env.CUDA_CORE_ARTIFACTS_DIR }}/"cu${BUILD_CUDA_MAJOR}"/*.whl
338+
# --inexact preserves the wheels installed above
339+
uv sync --frozen --inexact --package cuda-bindings --only-group test --no-install-project
340+
uv sync --frozen --inexact --package cuda-core --only-group test --no-install-project
342341
343342
- name: Build cuda.bindings Cython tests
344343
run: |

.github/workflows/coverage.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,12 +106,12 @@ jobs:
106106
- name: Build cuda-bindings
107107
run: |
108108
uv pip install -v ./cuda_bindings
109-
uv sync --frozen --package cuda-bindings --only-group test --no-install-project
109+
uv sync --frozen --inexact --package cuda-bindings --only-group test --no-install-project
110110
111111
- name: Build cuda-core
112112
run: |
113113
uv pip install -v ./cuda_core
114-
uv sync --frozen --package cuda-core --only-group "test-cu$(cut -d. -f1 <<< $CUDA_VER)" --no-install-project
114+
uv sync --frozen --inexact --package cuda-core --only-group "test-cu$(cut -d. -f1 <<< $CUDA_VER)" --no-install-project
115115
116116
- name: Install coverage tools
117117
run: |

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -293,9 +293,9 @@ jobs:
293293
run: |
294294
set -euo pipefail
295295
pushd cuda_pathfinder
296-
# Install test deps first (uv sync resets the venv), then the wheel.
297-
uv sync --frozen --package cuda-pathfinder --only-group "test-cu${TEST_CUDA_MAJOR}" --no-install-project
298296
uv pip install -v ./*.whl
297+
# --inexact preserves the wheel installed above
298+
uv sync --frozen --inexact --package cuda-pathfinder --only-group "test-cu${TEST_CUDA_MAJOR}" --no-install-project
299299
uv pip list
300300
popd
301301

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,9 +271,9 @@ jobs:
271271
shell: bash --noprofile --norc -xeuo pipefail {0}
272272
run: |
273273
pushd cuda_pathfinder
274-
# Install test deps first (uv sync resets the venv), then the wheel.
275-
uv sync --frozen --package cuda-pathfinder --only-group "test-cu${TEST_CUDA_MAJOR}" --no-install-project
276274
uv pip install -v ./*.whl
275+
# --inexact preserves the wheel installed above
276+
uv sync --frozen --inexact --package cuda-pathfinder --only-group "test-cu${TEST_CUDA_MAJOR}" --no-install-project
277277
uv pip list
278278
popd
279279

ci/tools/run-tests

Lines changed: 21 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,16 @@ fi
2020

2121
test_module=${1}
2222

23-
# Install dependency groups first (uv sync manages the venv and removes
24-
# packages it didn't install), then install pre-built wheels after.
23+
# Unconditionally install pathfinder wheel
24+
# (it is a direct dependency of bindings, and a transitive dependency of core)
25+
pushd ./cuda_pathfinder
26+
echo "Installing pathfinder wheel"
27+
uv pip install ./*.whl
28+
uv sync --frozen --inexact --package cuda-pathfinder --only-group test --no-install-project
29+
popd
2530

2631
if [[ "${test_module}" == "pathfinder" ]]; then
2732
pushd ./cuda_pathfinder
28-
echo "Installing pathfinder test deps and wheel"
29-
uv sync --frozen --package cuda-pathfinder --only-group test --no-install-project
30-
uv pip install ./*.whl
3133
echo "Running pathfinder tests with " \
3234
"LD:${CUDA_PATHFINDER_TEST_LOAD_NVIDIA_DYNAMIC_LIB_STRICTNESS} " \
3335
"FH:${CUDA_PATHFINDER_TEST_FIND_NVIDIA_HEADERS_STRICTNESS}"
@@ -37,51 +39,46 @@ if [[ "${test_module}" == "pathfinder" ]]; then
3739
echo "Number of \"INFO test_\" lines: $line_count"
3840
popd
3941
elif [[ "${test_module}" == "bindings" ]]; then
40-
echo "Installing bindings test deps and wheels"
42+
echo "Installing bindings wheel"
4143
pushd ./cuda_bindings
42-
uv sync --frozen --package cuda-pathfinder --only-group test --no-install-project
43-
uv sync --frozen --package cuda-bindings --only-group test --no-install-project
44-
uv pip install ./cuda_pathfinder/*.whl
4544
if [[ "${LOCAL_CTK}" == 1 ]]; then
4645
uv pip install "${CUDA_BINDINGS_ARTIFACTS_DIR}"/*.whl
4746
else
4847
uv pip install $(ls "${CUDA_BINDINGS_ARTIFACTS_DIR}"/*.whl)[all]
4948
fi
49+
uv sync --frozen --inexact --package cuda-bindings --only-group test --no-install-project
5050
echo "Running bindings tests"
5151
${SANITIZER_CMD} pytest -rxXs -v --durations=0 tests/
5252
if [[ "${SKIP_CYTHON_TEST}" == 0 ]]; then
5353
${SANITIZER_CMD} pytest -rxXs -v --durations=0 tests/cython
5454
fi
5555
popd
5656
elif [[ "${test_module}" == "core" ]]; then
57+
# If build/test majors match: cuda.bindings is installed in the previous step.
58+
# If mismatch: cuda.bindings is installed from the backport branch.
59+
if [[ "${SKIP_CUDA_BINDINGS_TEST}" == 1 ]]; then
60+
echo "Installing bindings wheel"
61+
if [[ "${LOCAL_CTK}" == 1 ]]; then
62+
uv pip install "${CUDA_BINDINGS_ARTIFACTS_DIR}"/*.whl
63+
else
64+
uv pip install $(ls "${CUDA_BINDINGS_ARTIFACTS_DIR}"/*.whl)[all]
65+
fi
66+
fi
5767
TEST_CUDA_MAJOR="$(cut -d '.' -f 1 <<< ${CUDA_VER})"
68+
echo "Installing core wheel"
5869

5970
FREE_THREADING=""
6071
if python -c 'import sys; assert not sys._is_gil_enabled()' 2> /dev/null; then
6172
FREE_THREADING+="-ft"
6273
fi
6374

64-
echo "Installing core test deps and wheels"
6575
pushd ./cuda_core
66-
uv sync --frozen --package cuda-pathfinder --only-group test --no-install-project
67-
uv sync --frozen --package cuda-bindings --only-group test --no-install-project
68-
uv sync --frozen --package cuda-core --only-group "test-cu${TEST_CUDA_MAJOR}${FREE_THREADING}" --no-install-project
69-
# Install all wheels after the last sync
70-
uv pip install ./cuda_pathfinder/*.whl
71-
if [[ "${SKIP_CUDA_BINDINGS_TEST}" == 1 ]]; then
72-
if [[ "${LOCAL_CTK}" == 1 ]]; then
73-
uv pip install "${CUDA_BINDINGS_ARTIFACTS_DIR}"/*.whl
74-
else
75-
uv pip install $(ls "${CUDA_BINDINGS_ARTIFACTS_DIR}"/*.whl)[all]
76-
fi
77-
else
78-
uv pip install "${CUDA_BINDINGS_ARTIFACTS_DIR}"/*.whl
79-
fi
8076
if [[ "${LOCAL_CTK}" == 1 ]]; then
8177
uv pip install "${CUDA_CORE_ARTIFACTS_DIR}"/*.whl
8278
else
8379
uv pip install $(ls "${CUDA_CORE_ARTIFACTS_DIR}"/*.whl)["cu${TEST_CUDA_MAJOR}"]
8480
fi
81+
uv sync --frozen --inexact --package cuda-core --only-group "test-cu${TEST_CUDA_MAJOR}${FREE_THREADING}" --no-install-project
8582
echo "Running core tests"
8683
${SANITIZER_CMD} pytest -rxXs -v --durations=0 tests/
8784
if [[ "${SKIP_CYTHON_TEST}" == 0 ]]; then

0 commit comments

Comments
 (0)