@@ -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