Skip to content

Commit 718398f

Browse files
Jammy2211claude
authored andcommitted
fix: tolerate missing packages in test PyPI re-pin step
The re-pin loop iterates over all 5 PyAuto packages, but not all may be uploaded yet due to parallel matrix runners. Add || true to prevent failures when a package hasn't been uploaded by its matrix runner yet. Also guard the Tests step re-pin with pip show to only re-pin packages that are actually installed. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 0ed43c4 commit 718398f

1 file changed

Lines changed: 10 additions & 6 deletions

File tree

.github/workflows/release.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,12 @@ jobs:
119119
done
120120
done
121121
# Re-pin PyAuto packages from test PyPI to prevent production PyPI
122-
# versions being pulled in during dependency resolution
122+
# versions being pulled in during dependency resolution.
123+
# Use || true because not all packages may be uploaded yet (parallel matrix).
123124
for PACKAGE in ${PACKAGES[@]}; do
124-
python3 -m pip install --index-url https://test.pypi.org/simple/ --no-deps --force-reinstall $PACKAGE==$VERSION
125+
python3 -m pip install --index-url https://test.pypi.org/simple/ --no-deps --force-reinstall $PACKAGE==$VERSION || true
125126
done
127+
true # ensure step exits 0
126128
- name: Tests
127129
run: |
128130
pushd "${{ matrix.project.path }}"
@@ -132,11 +134,13 @@ jobs:
132134
pip install pytest
133135
pip install numba
134136
# Re-pin PyAuto packages after third-party installs to ensure
135-
# test PyPI versions were not replaced by production PyPI versions
136-
export PACKAGES=("autoconf" "autoarray" "autofit" "autogalaxy" "autolens")
137+
# test PyPI versions were not replaced by production PyPI versions.
138+
# Only re-pin packages that are already installed (pip show succeeds).
137139
export VERSION="${{ needs.version_number.outputs.version_number }}"
138-
for PACKAGE in ${PACKAGES[@]}; do
139-
python3 -m pip install --index-url https://test.pypi.org/simple/ --no-deps --force-reinstall $PACKAGE==$VERSION
140+
for PACKAGE in autoconf autoarray autofit autogalaxy autolens; do
141+
if pip show $PACKAGE >/dev/null 2>&1; then
142+
python3 -m pip install --index-url https://test.pypi.org/simple/ --no-deps --force-reinstall $PACKAGE==$VERSION || true
143+
fi
140144
done
141145
python3 -m pytest
142146

0 commit comments

Comments
 (0)