Skip to content

Python Version Matrix #33

Python Version Matrix

Python Version Matrix #33

Workflow file for this run

name: Python Version Matrix
on:
workflow_dispatch:
schedule:
- cron: '0 3 * * 1' # Monday 03:00 UTC, off-cycle from the daily release
# Force local editable builds to outrank PyPI versions so pip's resolver
# doesn't replace `pip install -e ./PyAutoNerves` (1.0.dev0) with PyPI's
# autonerves-2026.x during a downstream lib install. Without this, the
# stale daily-release PyPI artifacts shadow the merged main code.
env:
SETUPTOOLS_SCM_PRETEND_VERSION_FOR_AUTOCONF: "9999.0.0"
SETUPTOOLS_SCM_PRETEND_VERSION_FOR_AUTOARRAY: "9999.0.0"
SETUPTOOLS_SCM_PRETEND_VERSION_FOR_AUTOFIT: "9999.0.0"
SETUPTOOLS_SCM_PRETEND_VERSION_FOR_AUTOGALAXY: "9999.0.0"
SETUPTOOLS_SCM_PRETEND_VERSION_FOR_AUTOLENS: "9999.0.0"
jobs:
unit_tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ['3.12', '3.13']
project:
- { name: PyAutoNerves, tests: test_autonerves }
- { name: PyAutoArray, tests: test_autoarray }
- { name: PyAutoFit, tests: test_autofit }
- { name: PyAutoGalaxy, tests: test_autogalaxy }
- { name: PyAutoLens, tests: test_autolens }
steps:
- uses: actions/checkout@v4
with: { repository: PyAutoLabs/PyAutoNerves, path: PyAutoNerves }
- uses: actions/checkout@v4
with: { repository: PyAutoLabs/PyAutoArray, path: PyAutoArray }
- uses: actions/checkout@v4
with: { repository: PyAutoLabs/PyAutoFit, path: PyAutoFit }
- uses: actions/checkout@v4
with: { repository: PyAutoLabs/PyAutoGalaxy, path: PyAutoGalaxy }
- uses: actions/checkout@v4
with: { repository: PyAutoLabs/PyAutoLens, path: PyAutoLens }
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
- name: Install libraries (single combined install — all 5 local)
run: |
python -m pip install --upgrade pip wheel
# Pass all 5 libs in ONE pip invocation so the resolver knows about
# every local checkout upfront. Without this, transitive deps
# (e.g. autogalaxy as a dep of autolens) get resolved from PyPI,
# and pip backtracks through the entire PyPI release history of
# autogalaxy looking for one whose nautilus-sampler pin matches
# the local autolens — which never matches because PyPI is stale.
pip install \
-e ./PyAutoNerves \
-e "./PyAutoArray[optional]" \
-e ./PyAutoFit \
-e ./PyAutoGalaxy \
-e "./PyAutoLens[optional]"
pip install pytest pytest-cov
# Show final installed versions for diagnosis
pip list | grep -iE "^(autonerves|autoarray|autofit|autogalaxy|autolens|jax|numpy|scipy|nautilus)"
- name: Run tests
env:
NUMBA_CACHE_DIR: /tmp/numba_cache
MPLCONFIGDIR: /tmp/matplotlib
JAX_ENABLE_X64: "True"
run: |
cd ${{ matrix.project.name }}
python -m pytest ${{ matrix.project.tests }}/ --tb=short
# Python 3.14 is deliberately unit-suite evidence only. The known PyAutoFit
# workspace-level factor-graph regression is tracked separately and is not
# exercised by this job. Every project gets an isolated cell, but a failure
# cannot weaken or mask the required 3.12/3.13 matrix above.
experimental_python_314:
runs-on: ubuntu-latest
continue-on-error: true
strategy:
fail-fast: false
matrix:
python-version: ['3.14']
project:
- { name: PyAutoNerves, tests: test_autonerves }
- { name: PyAutoArray, tests: test_autoarray }
- { name: PyAutoFit, tests: test_autofit }
- { name: PyAutoGalaxy, tests: test_autogalaxy }
- { name: PyAutoLens, tests: test_autolens }
steps:
- uses: actions/checkout@v4
with: { repository: PyAutoLabs/PyAutoNerves, path: PyAutoNerves }
- uses: actions/checkout@v4
with: { repository: PyAutoLabs/PyAutoArray, path: PyAutoArray }
- uses: actions/checkout@v4
with: { repository: PyAutoLabs/PyAutoFit, path: PyAutoFit }
- uses: actions/checkout@v4
with: { repository: PyAutoLabs/PyAutoGalaxy, path: PyAutoGalaxy }
- uses: actions/checkout@v4
with: { repository: PyAutoLabs/PyAutoLens, path: PyAutoLens }
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
- name: Install libraries (experimental 3.14 evidence)
run: |
python -m pip install --upgrade pip wheel
pip install \
-e ./PyAutoNerves \
-e "./PyAutoArray[optional]" \
-e ./PyAutoFit \
-e ./PyAutoGalaxy \
-e "./PyAutoLens[optional]"
pip install pytest pytest-cov
pip list | grep -iE "^(autonerves|autoarray|autofit|autogalaxy|autolens|jax|numpy|scipy|nautilus)"
- name: Run experimental tests
env:
NUMBA_CACHE_DIR: /tmp/numba_cache
MPLCONFIGDIR: /tmp/matplotlib
JAX_ENABLE_X64: "True"
run: |
cd ${{ matrix.project.name }}
python -m pytest ${{ matrix.project.tests }}/ --tb=short
- name: Record experimental cell result
if: always()
run: |
{
echo "### Python 3.14 experimental unit evidence"
echo ""
echo "- Project: ${{ matrix.project.name }}"
echo "- Cell status before continue-on-error: ${{ job.status }}"
echo "- This cell is non-required and does not cover workspace scripts."
} >> "$GITHUB_STEP_SUMMARY"
smoke_tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ['3.12', '3.13']
workspace:
- { repo: PyAutoLabs/autofit_workspace, path: autofit_workspace }
- { repo: PyAutoLabs/autogalaxy_workspace, path: autogalaxy_workspace }
- { repo: PyAutoLabs/autolens_workspace, path: autolens_workspace }
env:
PYAUTO_TEST_MODE: "1"
PYAUTO_SMALL_DATASETS: "1"
PYAUTO_FAST_PLOTS: "1"
NUMBA_CACHE_DIR: /tmp/numba_cache
MPLCONFIGDIR: /tmp/matplotlib
JAX_ENABLE_X64: "True"
steps:
- uses: actions/checkout@v4
with: { repository: PyAutoLabs/PyAutoNerves, path: PyAutoNerves }
- uses: actions/checkout@v4
with: { repository: PyAutoLabs/PyAutoArray, path: PyAutoArray }
- uses: actions/checkout@v4
with: { repository: PyAutoLabs/PyAutoFit, path: PyAutoFit }
- uses: actions/checkout@v4
with: { repository: PyAutoLabs/PyAutoGalaxy, path: PyAutoGalaxy }
- uses: actions/checkout@v4
with: { repository: PyAutoLabs/PyAutoLens, path: PyAutoLens }
- uses: actions/checkout@v4
with: { repository: "${{ matrix.workspace.repo }}", path: "${{ matrix.workspace.path }}" }
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
- name: Install libraries (single combined install — all 5 local)
run: |
python -m pip install --upgrade pip wheel
pip install \
-e ./PyAutoNerves \
-e "./PyAutoArray[optional]" \
-e "./PyAutoFit[optional]" \
-e ./PyAutoGalaxy \
-e "./PyAutoLens[optional]"
pip install numba
pip list | grep -iE "^(autonerves|autoarray|autofit|autogalaxy|autolens|jax|numpy|scipy|nautilus)"
- name: Run smoke tests
run: |
cd ${{ matrix.workspace.path }}
if [ ! -f smoke_tests.txt ]; then
echo "No smoke_tests.txt found in ${{ matrix.workspace.path }} -- skipping"
exit 0
fi
fail=0
while IFS= read -r script || [ -n "$script" ]; do
[ -z "$script" ] && continue
case "$script" in \#*) continue ;; esac
echo "::group::$script"
if python "scripts/$script"; then
echo "PASS: $script"
else
echo "FAIL: $script"
fail=$((fail + 1))
fi
echo "::endgroup::"
done < smoke_tests.txt
if [ "$fail" -gt 0 ]; then
echo "$fail smoke test(s) failed"
exit 1
fi
summary:
runs-on: ubuntu-latest
needs: [unit_tests, smoke_tests, experimental_python_314]
if: always()
steps:
- name: Post summary
run: |
{
echo "## Python Version Matrix Results"
echo ""
echo "| Job | Result |"
echo "|--------------|---------------------------------|"
echo "| unit_tests | ${{ needs.unit_tests.result }} |"
echo "| smoke_tests | ${{ needs.smoke_tests.result }} |"
echo "| python_314 (non-required job conclusion) | ${{ needs.experimental_python_314.result }} |"
echo ""
echo "Each 3.14 matrix cell records its pre-continue-on-error status"
echo "in that cell's summary; the aggregate conclusion may be coerced"
echo "to success by GitHub's job-level continue-on-error semantics."
echo ""
echo "**Required and supported:** 3.12, 3.13."
echo "**Experimental evidence (non-required):** 3.14."
echo "**Current source metadata rejects:** Python 3.11 and older."
} >> "$GITHUB_STEP_SUMMARY"