Skip to content

Commit 428ea82

Browse files
committed
ci: install exact local wheels in metapackage tests
1 parent fbef1b9 commit 428ea82

2 files changed

Lines changed: 44 additions & 18 deletions

File tree

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

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -384,21 +384,31 @@ jobs:
384384
if: ${{ inputs.test-mode == 'standard' && inputs.test-python && env.BINDINGS_SOURCE == 'main' }}
385385
run: |
386386
# Package suites install their own dependencies. A metapackage-only
387-
# run has no preceding suite, so resolve its exact cuda-bindings pin
388-
# from this run while allowing its released cuda-core pin from PyPI.
387+
# run has no preceding suite, so install the exact local internal
388+
# wheels in one transaction while resolving released dependencies
389+
# such as cuda-core from the package index.
389390
if ${{ inputs.test-bindings || inputs.test-core }}; then
390391
dependency_args=(--no-deps)
391392
else
392-
dependency_args=(
393-
--find-links ./cuda_pathfinder
394-
--find-links "${CUDA_BINDINGS_ARTIFACTS_DIR}"
395-
)
393+
pathfinder_wheels=(./cuda_pathfinder/cuda_pathfinder-*.whl)
394+
bindings_wheels=("${CUDA_BINDINGS_ARTIFACTS_DIR}"/cuda_bindings-*.whl)
395+
test "${#pathfinder_wheels[@]}" -eq 1
396+
test "${#bindings_wheels[@]}" -eq 1
397+
test -f "${pathfinder_wheels[0]}"
398+
test -f "${bindings_wheels[0]}"
399+
if [[ "${{ matrix.LOCAL_CTK }}" == 1 ]]; then
400+
dependency_args=("${pathfinder_wheels[0]}" "${bindings_wheels[0]}")
401+
else
402+
dependency_args=("${pathfinder_wheels[0]}" "${bindings_wheels[0]}[all]")
403+
fi
396404
fi
397-
wheel=$(ls cuda_python*.whl)
405+
python_wheels=(cuda_python*.whl)
406+
test "${#python_wheels[@]}" -eq 1
407+
test -f "${python_wheels[0]}"
398408
if [[ "${{ matrix.LOCAL_CTK }}" == 1 ]]; then
399-
pip install --only-binary=:all: "${dependency_args[@]}" "${wheel}"
409+
pip install --only-binary=:all: "${dependency_args[@]}" "${python_wheels[0]}"
400410
else
401-
pip install --only-binary=:all: "${dependency_args[@]}" "${wheel}[all]"
411+
pip install --only-binary=:all: "${dependency_args[@]}" "${python_wheels[0]}[all]"
402412
fi
403413
404414
- name: Install cuda.pathfinder extra wheels for testing

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

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -354,21 +354,37 @@ jobs:
354354
if: ${{ inputs.test-mode == 'standard' && inputs.test-python && env.BINDINGS_SOURCE == 'main' }}
355355
run: |
356356
# Package suites install their own dependencies. A metapackage-only
357-
# run has no preceding suite, so resolve its exact cuda-bindings pin
358-
# from this run while allowing its released cuda-core pin from PyPI.
357+
# run has no preceding suite, so install the exact local internal
358+
# wheels in one transaction while resolving released dependencies
359+
# such as cuda-core from the package index.
359360
if ('${{ inputs.test-bindings || inputs.test-core }}' -eq 'true') {
360361
$dependencyArgs = @('--no-deps')
361362
} else {
362-
$dependencyArgs = @(
363-
'--find-links', './cuda_pathfinder',
364-
'--find-links', $env:CUDA_BINDINGS_ARTIFACTS_DIR
365-
)
363+
$pathfinderWheels = @(Get-ChildItem -Path ./cuda_pathfinder -Filter cuda_pathfinder-*.whl -File)
364+
$bindingsWheels = @(Get-ChildItem -Path $env:CUDA_BINDINGS_ARTIFACTS_DIR -Filter cuda_bindings-*.whl -File)
365+
if ($pathfinderWheels.Count -ne 1) {
366+
throw "Expected exactly one cuda-pathfinder wheel, found $($pathfinderWheels.Count)"
367+
}
368+
if ($bindingsWheels.Count -ne 1) {
369+
throw "Expected exactly one cuda-bindings wheel, found $($bindingsWheels.Count)"
370+
}
371+
$pathfinderWheel = $pathfinderWheels[0].FullName
372+
$bindingsWheel = $bindingsWheels[0].FullName
373+
if ('${{ matrix.LOCAL_CTK }}' -eq '1') {
374+
$dependencyArgs = @($pathfinderWheel, $bindingsWheel)
375+
} else {
376+
$dependencyArgs = @($pathfinderWheel, "${bindingsWheel}[all]")
377+
}
378+
}
379+
$pythonWheels = @(Get-ChildItem -Filter cuda_python*.whl -File)
380+
if ($pythonWheels.Count -ne 1) {
381+
throw "Expected exactly one cuda-python wheel, found $($pythonWheels.Count)"
366382
}
367-
$wheel = (Get-ChildItem -Filter cuda_python*.whl).FullName
383+
$pythonWheel = $pythonWheels[0].FullName
368384
if ('${{ matrix.LOCAL_CTK }}' -eq '1') {
369-
pip install --only-binary=:all: @dependencyArgs $wheel
385+
pip install --only-binary=:all: @dependencyArgs $pythonWheel
370386
} else {
371-
pip install --only-binary=:all: @dependencyArgs "$wheel[all]"
387+
pip install --only-binary=:all: @dependencyArgs "${pythonWheel}[all]"
372388
}
373389
374390
- name: Install cuda.pathfinder extra wheels for testing

0 commit comments

Comments
 (0)