Skip to content

Commit 0ed43c4

Browse files
Jammy2211claude
authored andcommitted
fix: re-pin PyAuto packages from test PyPI after dependency resolution
pip's dependency resolver can substitute test PyPI packages with production PyPI versions when --extra-index-url is used. This caused release_test_pypi to fail because production PyPI autoconf (2026.4.5.3) has a stale `from collections import Sized` import that breaks on Python 3.12+. After each install step, re-install PyAuto packages with --no-deps --force-reinstall from test PyPI to ensure the correct versions are active. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 7d8e510 commit 0ed43c4

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,11 @@ jobs:
118118
test_condition=$?
119119
done
120120
done
121+
# Re-pin PyAuto packages from test PyPI to prevent production PyPI
122+
# versions being pulled in during dependency resolution
123+
for PACKAGE in ${PACKAGES[@]}; do
124+
python3 -m pip install --index-url https://test.pypi.org/simple/ --no-deps --force-reinstall $PACKAGE==$VERSION
125+
done
121126
- name: Tests
122127
run: |
123128
pushd "${{ matrix.project.path }}"
@@ -126,6 +131,13 @@ jobs:
126131
pip install pynufft==2025.1.1
127132
pip install pytest
128133
pip install numba
134+
# 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+
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+
done
129141
python3 -m pytest
130142
131143
find_scripts:
@@ -311,6 +323,9 @@ jobs:
311323
run: |
312324
python3 -m pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple "autoconf==${{ needs.version_number.outputs.version_number }}"
313325
python3 -m pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple "${{ steps.configure.outputs.project }}==${{ needs.version_number.outputs.version_number }}"
326+
# Re-pin PyAuto packages from test PyPI to prevent production PyPI substitution
327+
python3 -m pip install --index-url https://test.pypi.org/simple/ --no-deps --force-reinstall "autoconf==${{ needs.version_number.outputs.version_number }}"
328+
python3 -m pip install --index-url https://test.pypi.org/simple/ --no-deps --force-reinstall "${{ steps.configure.outputs.project }}==${{ needs.version_number.outputs.version_number }}"
314329
- name: Run Python scripts
315330
if: "${{ github.event.inputs.skip_scripts != 'true' }}"
316331
run: |
@@ -403,6 +418,9 @@ jobs:
403418
run: |
404419
python3 -m pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple "autoconf==${{ needs.version_number.outputs.version_number }}"
405420
python3 -m pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple "${{ steps.configure.outputs.project }}==${{ needs.version_number.outputs.version_number }}"
421+
# Re-pin PyAuto packages from test PyPI to prevent production PyPI substitution
422+
python3 -m pip install --index-url https://test.pypi.org/simple/ --no-deps --force-reinstall "autoconf==${{ needs.version_number.outputs.version_number }}"
423+
python3 -m pip install --index-url https://test.pypi.org/simple/ --no-deps --force-reinstall "${{ steps.configure.outputs.project }}==${{ needs.version_number.outputs.version_number }}"
406424
- name: Install Jupyter dependency
407425
if: "${{ github.event.inputs.skip_notebooks != 'true' }}"
408426
run: |
@@ -736,6 +754,8 @@ jobs:
736754
if: "${{ github.event.inputs.update_notebook_visualisations == 'true' }}"
737755
run: |
738756
python3 -m pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple "${{ steps.configure.outputs.project }}==${{ needs.version_number.outputs.version_number }}"
757+
# Re-pin from test PyPI to prevent production PyPI substitution
758+
python3 -m pip install --index-url https://test.pypi.org/simple/ --no-deps --force-reinstall "${{ steps.configure.outputs.project }}==${{ needs.version_number.outputs.version_number }}"
739759
- name: Install Jupyter dependency
740760
if: "${{ github.event.inputs.update_notebook_visualisations == 'true' }}"
741761
run: |

0 commit comments

Comments
 (0)