Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
104 changes: 102 additions & 2 deletions .github/workflows/python_matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ env:
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"
SETUPTOOLS_SCM_PRETEND_VERSION_FOR_AUTOCTI: "9999.0.0"

jobs:
unit_tests:
Expand Down Expand Up @@ -135,9 +136,106 @@ jobs:
path: ${{ matrix.workspace.path }}/test-results/
if-no-files-found: warn

# PyAutoCTI (cti-upkeep phase 1). Its own jobs rather than a sixth row in
# the jobs above: autocti needs arcticpy, a source-only C++ build owned by
# PyAutoHeart's install-arcticpy action (the single home of its pin), and its
# chain is Nerves/Fit/Array only. 3.12 and 3.13 only: arcticpy does not build
# on 3.14 yet (cti-upkeep ruling R4, 2026-11-04).
cti_unit_tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ['3.12', '3.13']
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/PyAutoCTI, path: PyAutoCTI }
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install arcticpy (source-only C++ sdist)
uses: PyAutoLabs/PyAutoHeart/.github/actions/install-arcticpy@main
- name: Install libraries (single combined install — all 4 local)
run: |
python -m pip install --upgrade pip wheel
pip install numba \
-e ./PyAutoNerves \
-e "./PyAutoArray[optional]" \
-e ./PyAutoFit \
-e ./PyAutoCTI
pip install pytest pytest-cov
pip list | grep -iE "^(autonerves|autoarray|autofit|autocti|arcticpy|numpy|scipy)"
- name: Run tests
env:
NUMBA_CACHE_DIR: /tmp/numba_cache
MPLCONFIGDIR: /tmp/matplotlib
run: |
cd PyAutoCTI
python -m pytest test_autocti/ --tb=short

cti_smoke_tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ['3.12', '3.13']
workspace:
- { repo: PyAutoLabs/autocti_workspace, path: autocti_workspace }
- { repo: PyAutoLabs/autocti_workspace_test, path: autocti_workspace_test }
env:
NUMBA_CACHE_DIR: /tmp/numba_cache
MPLCONFIGDIR: /tmp/matplotlib
steps:
- name: Checkout Hands harness
uses: actions/checkout@v4
with:
path: PyAutoHands
- 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/PyAutoCTI, path: PyAutoCTI }
- uses: actions/checkout@v4
with: { repository: "${{ matrix.workspace.repo }}", path: "${{ matrix.workspace.path }}" }
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install arcticpy (source-only C++ sdist)
uses: PyAutoLabs/PyAutoHeart/.github/actions/install-arcticpy@main
- name: Install workspace smoke environment
env:
WORKSPACE_PATH: ${{ matrix.workspace.path }}
run: |
python -m pip install --upgrade pip wheel
python -m pip install pyyaml
bash "$WORKSPACE_PATH/.github/scripts/smoke_install.sh"
- name: Run smoke tests
env:
WORKSPACE_PATH: ${{ matrix.workspace.path }}
PYTHONPATH: ${{ github.workspace }}/PyAutoHands/autohands
run: |
cd "$WORKSPACE_PATH"
python .github/scripts/run_smoke.py --report-dir test-results
- name: Upload smoke report
if: always()
uses: actions/upload-artifact@v4
with:
name: python-matrix-${{ matrix.workspace.path }}-${{ matrix.python-version }}
path: ${{ matrix.workspace.path }}/test-results/
if-no-files-found: warn

summary:
runs-on: ubuntu-latest
needs: [unit_tests, smoke_tests]
needs: [unit_tests, smoke_tests, cti_unit_tests, cti_smoke_tests]
if: always()
steps:
- name: Post summary
Expand All @@ -149,7 +247,9 @@ jobs:
echo "|--------------|---------------------------------|"
echo "| unit_tests | ${{ needs.unit_tests.result }} |"
echo "| smoke_tests | ${{ needs.smoke_tests.result }} |"
echo "| cti_unit_tests | ${{ needs.cti_unit_tests.result }} |"
echo "| cti_smoke_tests | ${{ needs.cti_smoke_tests.result }} |"
echo ""
echo "**Required and supported:** 3.12, 3.13, 3.14."
echo "**Required and supported:** 3.12, 3.13, 3.14 (PyAutoCTI: 3.12, 3.13 until arcticpy builds on 3.14)."
echo "**Current source metadata rejects:** Python 3.11 and older."
} >> "$GITHUB_STEP_SUMMARY"
115 changes: 98 additions & 17 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ jobs:
- repository: PyAutoLabs/PyAutoLens
ref: main
path: PyAutoLens
- repository: PyAutoLabs/PyAutoCTI
ref: main
path: PyAutoCTI
steps:
- uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -200,7 +203,7 @@ jobs:
# TODO(token-phase-1b): switch when PyPI trusted publishers are registered.
# Trusted publishing (OIDC) replaces TWINE_PASSWORD/secrets.TEST_PYPI once
# TestPyPI lists PyAutoLabs/PyAutoHands release.yml (environment
# `testpypi`) as a trusted publisher for all five projects. Until the
# `testpypi`) as a trusted publisher for all six projects. Until the
# human confirms that, the twine step below stays live — do not enable
# this before then or the rehearsal cannot publish. Replacement:
#
Expand Down Expand Up @@ -243,7 +246,7 @@ jobs:
popd
- name: Wait for packages and install
run: |
export PACKAGES=("autonerves" "autoarray" "autofit" "autogalaxy" "autolens")
export PACKAGES=("autonerves" "autoarray" "autofit" "autogalaxy" "autolens" "autocti")
export VERSION="${{ needs.version_number.outputs.version_number }}"

# Wait for each package to become available on test PyPI.
Expand All @@ -270,7 +273,7 @@ jobs:
done

echo "All packages available. Installing with pinned versions..."
# Install all 5 PyAuto packages in a single command with all versions
# Install all 6 PyAuto packages in a single command with all versions
# pinned. This prevents pip from substituting unrelated packages with
# the same names from production PyPI (e.g. autonerves 0.7.7, autofit 0.73.1)
# during dependency resolution.
Expand All @@ -288,7 +291,8 @@ jobs:
"autoarray[optional]==$VERSION" \
"autofit[optional]==$VERSION" \
"autogalaxy[optional]==$VERSION" \
"autolens[optional]==$VERSION"; do
"autolens[optional]==$VERSION" \
"autocti[optional]==$VERSION"; do
((install_cnt=install_cnt+1))
if [[ $install_cnt -ge 30 ]]; then
echo "ERROR: Install failed after 30 attempts (5min)"
Expand All @@ -303,6 +307,12 @@ jobs:
# so jax_likelihood_functions / jax_grad / jax_substructure
# scripts can't fail in 0.1s with ModuleNotFoundError.
pip install "jax>=0.7,<0.12,!=0.10.*,!=0.11.0" "jaxlib>=0.7,<0.12,!=0.10.*,!=0.11.0"
# autocti imports arcticpy, a source-only C++ build that is not a pip
# dependency; PyAutoHeart's action is the single home of its recipe and
# pin. Only the CTI leg's tests import autocti.
- name: Install arcticpy (CTI leg only)
if: "${{ matrix.project.path == 'PyAutoCTI' }}"
uses: PyAutoLabs/PyAutoHeart/.github/actions/install-arcticpy@main
- name: Tests
run: |
pushd "${{ matrix.project.path }}"
Expand Down Expand Up @@ -334,6 +344,7 @@ jobs:
- { repo: PyAutoLabs/autofit_workspace, path: autofit_workspace }
- { repo: PyAutoLabs/autogalaxy_workspace, path: autogalaxy_workspace }
- { repo: PyAutoLabs/autolens_workspace, path: autolens_workspace }
- { repo: PyAutoLabs/autocti_workspace, path: autocti_workspace }
env:
# PYAUTO_* behaviour is owned by the workspace's release profile
# (config/build/profile_release.yaml), resolved per script by the runner
Expand Down Expand Up @@ -371,6 +382,9 @@ jobs:
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install arcticpy (autocti_workspace only)
if: "${{ matrix.workspace.path == 'autocti_workspace' }}"
uses: PyAutoLabs/PyAutoHeart/.github/actions/install-arcticpy@main
- name: Install from TestPyPI at pinned version
run: |
export VERSION="${{ needs.version_number.outputs.version_number }}"
Expand All @@ -382,7 +396,8 @@ jobs:
"autoarray[optional]==$VERSION" \
"autofit[optional]==$VERSION" \
"autogalaxy[optional]==$VERSION" \
"autolens[optional]==$VERSION"; do
"autolens[optional]==$VERSION" \
"autocti[optional]==$VERSION"; do
((install_cnt=install_cnt+1))
if [[ $install_cnt -ge 30 ]]; then
echo "ERROR: Install failed after 30 attempts"
Expand Down Expand Up @@ -465,6 +480,9 @@ jobs:
- repository: PyAutoLabs/PyAutoLens
ref: main
path: PyAutoLens
- repository: PyAutoLabs/PyAutoCTI
ref: main
path: PyAutoCTI
steps:
- uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -594,7 +612,7 @@ jobs:
# TODO(token-phase-1b): switch when PyPI trusted publishers are registered.
# Trusted publishing (OIDC) replaces TWINE_PASSWORD/secrets.PYPI once PyPI
# lists PyAutoLabs/PyAutoHands release.yml (environment `pypi`) as a
# trusted publisher for autonerves/autofit/autoarray/autogalaxy/autolens.
# trusted publisher for autonerves/autofit/autoarray/autogalaxy/autolens/autocti.
# Until the human confirms that, the twine step below stays live — do not
# enable this before then or the release cannot publish. Replacement:
#
Expand Down Expand Up @@ -721,7 +739,7 @@ jobs:
client-id: ${{ vars.APP_CLIENT_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}
owner: PyAutoLabs
repositories: PyAutoMind,PyAutoNerves,PyAutoFit,PyAutoArray,PyAutoGalaxy,PyAutoLens
repositories: PyAutoMind,PyAutoNerves,PyAutoFit,PyAutoArray,PyAutoGalaxy,PyAutoLens,PyAutoCTI
permission-contents: read
permission-issues: write
permission-pull-requests: write
Expand Down Expand Up @@ -773,6 +791,8 @@ jobs:
token_repos: PyAutoFit,PyAutoArray,PyAutoGalaxy
- repo: PyAutoLabs/PyAutoLens
token_repos: PyAutoFit,PyAutoArray,PyAutoGalaxy,PyAutoLens
- repo: PyAutoLabs/PyAutoCTI
token_repos: PyAutoFit,PyAutoArray,PyAutoCTI
steps:
- uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -841,6 +861,12 @@ jobs:
generate_notebooks: true
bump_colab_urls: true
assistant: autolens_assistant
- repository: PyAutoLabs/autocti_workspace
name: autocti
package: PyAutoCTI
generate_notebooks: true
bump_colab_urls: true
assistant: autocti_assistant
- repository: PyAutoLabs/HowToGalaxy
name: howtogalaxy
package: PyAutoGalaxy
Expand Down Expand Up @@ -1238,12 +1264,8 @@ jobs:
# unique per run (upload-artifact@v4 names must not collide with the autolens
# check's wiki-drift-report or the autofit check's -autofit in the same run).
#
# autocti_assistant is deliberately NOT wired here: `autocti` on PyPI is
# 2024.11.13.2, so the `autocti==$VERSION` install this contract implies cannot
# resolve, and the baseline step below installs only the five release-train
# packages (autocti is not one). Its own wiki-currency.yml records the same
# constraint — "the CTI release train is not yet wired". Wire the CTI release
# train first; this comment is the pointer for whoever does.
# autocti_assistant has its own pair, wiki_currency_check_autocti below
# (PyAutoHands#332 wired autocti into the release train).
# ---------------------------------------------------------------------------
wiki_currency_check_autogalaxy:
needs:
Expand Down Expand Up @@ -1300,7 +1322,66 @@ jobs:
# is the terminal step that records the resolved TestPyPI version so the caller
# (the Brain Release Agent / Heart) can `pip install` exactly those wheels.
#
# Gating on `release_test_pypi` means the artifact exists IFF all five wheels
# Gating on `release_test_pypi` means the artifact exists IFF all six wheels
# built, uploaded, and became installable on TestPyPI at this version — so the
# artifact's presence is itself the "rehearsal succeeded" signal.
# ---------------------------------------------------------------------------
wiki_currency_check_autocti:
needs:
- resolve_mode
- version_number
- release_workspaces
if: "${{ needs.resolve_mode.outputs.rehearsal != 'true' }}"
uses: PyAutoLabs/autocti_assistant/.github/workflows/wiki-currency.yml@main
with:
stack_version: ${{ needs.version_number.outputs.version_number }}
assistant_ref: main

wiki_drift_issue_autocti:
needs:
- version_number
- wiki_currency_check_autocti
if: "${{ always() && needs.wiki_currency_check_autocti.result == 'failure' }}"
runs-on: ubuntu-latest
steps:
- name: Download drift report
uses: actions/download-artifact@v4
with:
name: wiki-drift-report # autocti_assistant uploads it unsuffixed (wiki-currency.yml)
path: drift
- name: Mint App token (open the drift issue)
id: app_token
uses: actions/create-github-app-token@v3
with:
client-id: ${{ vars.APP_CLIENT_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}
owner: PyAutoLabs
repositories: autocti_assistant
permission-issues: write
- name: Open wiki-drift issue against autocti_assistant
env:
GH_TOKEN: ${{ steps.app_token.outputs.token }}
run: |
VERSION="${{ needs.version_number.outputs.version_number }}"
BODY=drift/drift-report.md
if [ ! -f "$BODY" ]; then
printf '# Wiki-currency drift at release %s\n\nThe check failed but no drift-report artifact was found; see the run logs.\n' "$VERSION" > "$BODY"
fi
gh issue create \
--repo PyAutoLabs/autocti_assistant \
--title "wiki drift detected at release $VERSION" \
--body-file "$BODY" \
|| echo "::warning::could not open wiki-drift issue (non-fatal)"

# ---------------------------------------------------------------------------
# Rehearsal version emitter (rehearsal mode only).
#
# M1 of the Brain->Health->Heart release-validation redesign. In rehearsal mode
# the workflow builds + publishes every package to TestPyPI and STOPS; this job
# is the terminal step that records the resolved TestPyPI version so the caller
# (the Brain Release Agent / Heart) can `pip install` exactly those wheels.
#
# Gating on `release_test_pypi` means the artifact exists IFF all six wheels
# built, uploaded, and became installable on TestPyPI at this version — so the
# artifact's presence is itself the "rehearsal succeeded" signal.
# ---------------------------------------------------------------------------
Expand All @@ -1323,7 +1404,7 @@ jobs:
"mode": "rehearsal",
"index": "testpypi",
"version": "$VERSION",
"packages": ["autonerves", "autoarray", "autofit", "autogalaxy", "autolens"],
"packages": ["autonerves", "autoarray", "autofit", "autogalaxy", "autolens", "autocti"],
"run_id": "${{ github.run_id }}",
"run_attempt": "${{ github.run_attempt }}",
"build_sha": "${{ github.sha }}"
Expand All @@ -1336,14 +1417,14 @@ jobs:
{
echo "## TestPyPI rehearsal complete"
echo ""
echo "Published \`autonerves / autoarray / autofit / autogalaxy / autolens == $VERSION\` to TestPyPI."
echo "Published \`autonerves / autoarray / autofit / autogalaxy / autolens / autocti == $VERSION\` to TestPyPI."
echo "Halted before PyPI upload, git tags, and workspace notebook commits."
echo ""
echo "Install exactly these wheels with:"
echo '```bash'
echo "pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple \\"
echo " autonerves[optional]==$VERSION autoarray[optional]==$VERSION autofit[optional]==$VERSION \\"
echo " autogalaxy[optional]==$VERSION autolens[optional]==$VERSION"
echo " autogalaxy[optional]==$VERSION autolens[optional]==$VERSION autocti[optional]==$VERSION"
echo '```'
} >> "$GITHUB_STEP_SUMMARY"
- name: Upload rehearsal version artifact
Expand Down
5 changes: 4 additions & 1 deletion autohands/aggregate_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ def classify_failure(result: dict) -> str:
return "environment"

lib_patterns = ["PyAutoFit", "PyAutoArray", "PyAutoGalaxy", "PyAutoLens", "PyAutoNerves",
"autofit/", "autoarray/", "autogalaxy/", "autolens/", "autonerves/"]
"PyAutoCTI", "autofit/", "autoarray/", "autogalaxy/", "autolens/",
"autonerves/", "autocti/"]
if any(p in tb for p in lib_patterns):
return "source_code_bug"

Expand All @@ -53,9 +54,11 @@ def fetch_merged_prs() -> list:
"PyAutoLabs/PyAutoArray",
"PyAutoLabs/PyAutoGalaxy",
"PyAutoLabs/PyAutoLens",
"PyAutoLabs/PyAutoCTI",
"PyAutoLabs/autofit_workspace",
"PyAutoLabs/autogalaxy_workspace",
"PyAutoLabs/autolens_workspace",
"PyAutoLabs/autocti_workspace",
]
prs = []
for repo in repos:
Expand Down
Loading
Loading