diff --git a/.github/workflows/python_matrix.yml b/.github/workflows/python_matrix.yml index e9302c3c..605cd425 100644 --- a/.github/workflows/python_matrix.yml +++ b/.github/workflows/python_matrix.yml @@ -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: @@ -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 @@ -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" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ae88e6dd..99283669 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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: @@ -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: # @@ -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. @@ -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. @@ -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)" @@ -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 }}" @@ -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 @@ -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 }}" @@ -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" @@ -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: @@ -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: # @@ -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 @@ -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: @@ -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 @@ -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: @@ -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. # --------------------------------------------------------------------------- @@ -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 }}" @@ -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 diff --git a/autohands/aggregate_results.py b/autohands/aggregate_results.py index 41a8a116..d4e53c69 100644 --- a/autohands/aggregate_results.py +++ b/autohands/aggregate_results.py @@ -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" @@ -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: diff --git a/autohands/build_util.py b/autohands/build_util.py index 07b55011..09a8c353 100644 --- a/autohands/build_util.py +++ b/autohands/build_util.py @@ -312,6 +312,7 @@ def py_to_notebook(filename: Path): "autofit": "autofit", "autogalaxy": "autogalaxy", "autolens": "autolens", + "autocti": "autocti", "howtofit": "autofit", "howtogalaxy": "autogalaxy", "howtolens": "autolens", diff --git a/autohands/bump_colab_urls.sh b/autohands/bump_colab_urls.sh index ddbc5b99..21e2b4f1 100644 --- a/autohands/bump_colab_urls.sh +++ b/autohands/bump_colab_urls.sh @@ -8,7 +8,7 @@ # with , in-place across *.rst, *.md, *.ipynb, *.py. # # is one of: -# autofit_workspace, autogalaxy_workspace, autolens_workspace +# autofit_workspace, autogalaxy_workspace, autolens_workspace, autocti_workspace # HowToGalaxy, HowToLens, HowToFit # must match the date-based scheme YYYY.M.D.B (anything else is left alone, # so the bumper is a no-op until the URL sweep migrates URLs to canonical form). @@ -27,7 +27,7 @@ if ! [[ "$NEW_TAG" =~ ^[0-9]{4}\.[0-9]+\.[0-9]+\.[0-9]+$ ]]; then exit 2 fi -PATTERN='(colab\.research\.google\.com/github/PyAutoLabs/((autofit|autogalaxy|autolens)_workspace|HowToGalaxy|HowToLens|HowToFit)/blob/)[0-9]{4}\.[0-9]+\.[0-9]+\.[0-9]+/' +PATTERN='(colab\.research\.google\.com/github/PyAutoLabs/((autofit|autogalaxy|autolens|autocti)_workspace|HowToGalaxy|HowToLens|HowToFit)/blob/)[0-9]{4}\.[0-9]+\.[0-9]+\.[0-9]+/' REPLACE="\${1}${NEW_TAG}/" find . -type f \( -name '*.rst' -o -name '*.md' -o -name '*.ipynb' -o -name '*.py' \) \ diff --git a/autohands/config/workspaces.yaml b/autohands/config/workspaces.yaml index b5f14e70..6510430d 100644 --- a/autohands/config/workspaces.yaml +++ b/autohands/config/workspaces.yaml @@ -26,6 +26,7 @@ libraries: - {name: PyAutoArray, package: autoarray} - {name: PyAutoGalaxy, package: autogalaxy} - {name: PyAutoLens, package: autolens} + - {name: PyAutoCTI, package: autocti} # slow_skip_check: the default audit targets when none are given on the CLI. slow_skip_default: @@ -50,6 +51,10 @@ colab_setup: name: PyAutoLens intro_url: https://github.com/PyAutoLabs/autolens_workspace/blob/main/start_here.ipynb intro_patterns: [cosmos_web_ring_colab.ipynb] + autocti: + name: PyAutoCTI + intro_url: https://github.com/PyAutoLabs/autocti_workspace/blob/main/notebooks/overview/overview_1_what_is_cti.ipynb + intro_patterns: [overview_1_what_is_cti.ipynb] howtofit: name: PyAutoFit intro_url: https://github.com/PyAutoLabs/HowToFit/blob/main/notebooks/chapter_1_introduction/tutorial_1_models.ipynb @@ -75,6 +80,7 @@ colab_gemini: autofit: {repo: autofit_workspace, assistant: autofit_assistant} autogalaxy: {repo: autogalaxy_workspace, assistant: autogalaxy_assistant} autolens: {repo: autolens_workspace, assistant: autolens_assistant} + autocti: {repo: autocti_workspace, assistant: autocti_assistant} howtofit: {repo: HowToFit, assistant: autofit_assistant} howtogalaxy: {repo: HowToGalaxy, assistant: autogalaxy_assistant} howtolens: {repo: HowToLens, assistant: autolens_assistant} diff --git a/autohands/generate_markdown.py b/autohands/generate_markdown.py index 7b933b35..3959b765 100644 --- a/autohands/generate_markdown.py +++ b/autohands/generate_markdown.py @@ -67,6 +67,7 @@ "autofit": "PyAutoFit", "autogalaxy": "PyAutoGalaxy", "autolens": "PyAutoLens", + "autocti": "PyAutoCTI", "howtofit": "HowToFit", "howtogalaxy": "HowToGalaxy", "howtolens": "HowToLens", diff --git a/autohands/generate_release_notes.py b/autohands/generate_release_notes.py index 206463b6..e1426ae6 100644 --- a/autohands/generate_release_notes.py +++ b/autohands/generate_release_notes.py @@ -30,6 +30,10 @@ "PyAutoLabs/PyAutoArray", "PyAutoLabs/PyAutoGalaxy", ], + "PyAutoLabs/PyAutoCTI": [ + "PyAutoLabs/PyAutoFit", + "PyAutoLabs/PyAutoArray", + ], } # Human-readable short names @@ -39,6 +43,7 @@ "PyAutoLabs/PyAutoArray": "PyAutoArray", "PyAutoLabs/PyAutoGalaxy": "PyAutoGalaxy", "PyAutoLabs/PyAutoLens": "PyAutoLens", + "PyAutoLabs/PyAutoCTI": "PyAutoCTI", } # Base branches per repo @@ -47,6 +52,7 @@ "PyAutoLabs/PyAutoArray": "main", "PyAutoLabs/PyAutoGalaxy": "main", "PyAutoLabs/PyAutoLens": "main", + "PyAutoLabs/PyAutoCTI": "main", } diff --git a/autohands/slack_release_notes.py b/autohands/slack_release_notes.py index 5d73d2df..ae66e81f 100644 --- a/autohands/slack_release_notes.py +++ b/autohands/slack_release_notes.py @@ -32,6 +32,7 @@ ("PyAutoArray", "PyAutoLabs/PyAutoArray"), ("PyAutoGalaxy", "PyAutoLabs/PyAutoGalaxy"), ("PyAutoLens", "PyAutoLabs/PyAutoLens"), + ("PyAutoCTI", "PyAutoLabs/PyAutoCTI"), ] # Slack's per-message `text` ceiling is 40000 chars; stay under it with headroom diff --git a/autohands/tag_and_merge.sh b/autohands/tag_and_merge.sh index af0450c4..f5727fef 100755 --- a/autohands/tag_and_merge.sh +++ b/autohands/tag_and_merge.sh @@ -4,7 +4,7 @@ # Usage: tag_and_merge.sh --version # # For each library repo (PyAutoNerves, PyAutoFit, PyAutoArray, PyAutoGalaxy, -# PyAutoLens), commits pending changes with message "Update version to +# PyAutoLens, PyAutoCTI), commits pending changes with message "Update version to # " and tags HEAD as v. Stops on the first failing repo. set -euo pipefail @@ -38,7 +38,7 @@ fi HANDS_HOME="$(cd "$(dirname "$0")/.." && pwd)" PYAUTOBASE="$(PYTHONPATH="$HANDS_HOME" python3 -c 'from autohands import _workspace; print(_workspace.workspace_root())')" -LIB_PROJECTS=(PyAutoNerves PyAutoFit PyAutoArray PyAutoLens PyAutoGalaxy) +LIB_PROJECTS=(PyAutoNerves PyAutoFit PyAutoArray PyAutoLens PyAutoGalaxy PyAutoCTI) for project in "${LIB_PROJECTS[@]}"; do repo="$(PYTHONPATH="$HANDS_HOME" python3 -c 'import sys; from pathlib import Path; from autohands import _workspace; print(_workspace.repo_path(Path(sys.argv[1]), sys.argv[2], required=True))' "$PYAUTOBASE" "$project")" diff --git a/bin/autohands b/bin/autohands index f5d0cdae..845aa7d0 100755 --- a/bin/autohands +++ b/bin/autohands @@ -199,7 +199,7 @@ Rewrite every URL of the form to use , in-place across *.rst, *.md, *.ipynb, *.py under cwd. must be one of: autofit_workspace, autogalaxy_workspace, -autolens_workspace, HowToGalaxy, HowToLens, HowToFit. +autolens_workspace, autocti_workspace, HowToGalaxy, HowToLens, HowToFit. must look like YYYY.M.D.B. Idempotent. Called by the release.yml `release_workspaces` and `bump_library_colab_urls` @@ -689,7 +689,8 @@ help_tag_and_merge() { autohands tag_and_merge --version Commit any pending changes and tag HEAD as v in every library -repo: PyAutoNerves, PyAutoFit, PyAutoArray, PyAutoGalaxy, PyAutoLens. +repo: PyAutoNerves, PyAutoFit, PyAutoArray, PyAutoGalaxy, PyAutoLens, +PyAutoCTI. Each repo gets a commit with message "Update version to " and a tag named "v". Stops on the first failing repo. diff --git a/pre_build.sh b/pre_build.sh index c06b9e98..8e4a4178 100644 --- a/pre_build.sh +++ b/pre_build.sh @@ -92,6 +92,8 @@ WORKSPACE_SPECS=( "autofit_workspace_test autofit false false" "autogalaxy_workspace_test autogalaxy false false" "autolens_workspace_test autolens false false" + "autocti_workspace autocti true false" + "autocti_workspace_test autocti false false" "euclid_strong_lens_modeling_pipeline - false false" "HowToGalaxy howtogalaxy true false" "HowToLens howtolens true false" diff --git a/skills/pre_build/pre_build.md b/skills/pre_build/pre_build.md index b10c9ffb..52aee9f3 100644 --- a/skills/pre_build/pre_build.md +++ b/skills/pre_build/pre_build.md @@ -20,6 +20,8 @@ Check that all required repositories exist under the workspace root: - `autofit_workspace_test` - `autogalaxy_workspace_test` - `autolens_workspace_test` +- `autocti_workspace` +- `autocti_workspace_test` - `euclid_strong_lens_modeling_pipeline` - `HowToGalaxy` - `HowToLens` diff --git a/tests/test_generate_validates_project.py b/tests/test_generate_validates_project.py index 37ff0c3e..38cc9dbe 100644 --- a/tests/test_generate_validates_project.py +++ b/tests/test_generate_validates_project.py @@ -56,10 +56,16 @@ def _run_generate(workspace: Path, project: str): ) +# A project name no registry knows. This was "autocti" until CTI joined +# COLAB_PROJECTS (cti-upkeep phase 1, PyAutoHands#332); any unregistered name +# exercises the same validate-before-rmtree ordering. +UNKNOWN_PROJECT = "notaproject" + + def test_unknown_project_exits_nonzero_without_touching_notebooks(tmp_path): workspace = _make_workspace(tmp_path) - result = _run_generate(workspace, "autocti") + result = _run_generate(workspace, UNKNOWN_PROJECT) assert result.returncode != 0 @@ -83,9 +89,9 @@ def test_unknown_project_exits_nonzero_without_touching_notebooks(tmp_path): def test_unknown_project_message_names_the_project_and_both_registries(tmp_path): workspace = _make_workspace(tmp_path) - message = _run_generate(workspace, "autocti").stderr + message = _run_generate(workspace, UNKNOWN_PROJECT).stderr - assert "autocti" in message + assert UNKNOWN_PROJECT in message assert "COLAB_PROJECTS" in message assert "setup_colab" in message assert "Nothing was modified" in message diff --git a/tests/test_inject_colab_setup.py b/tests/test_inject_colab_setup.py index 68e8422c..97e262d5 100644 --- a/tests/test_inject_colab_setup.py +++ b/tests/test_inject_colab_setup.py @@ -124,6 +124,7 @@ def test_all_projects_accepted(tmp_path): "autofit": "autofit", "autogalaxy": "autogalaxy", "autolens": "autolens", + "autocti": "autocti", "howtofit": "autofit", "howtogalaxy": "autogalaxy", "howtolens": "autolens", diff --git a/tests/test_python_matrix_workflow.py b/tests/test_python_matrix_workflow.py index 222c7e0a..f522dfc3 100644 --- a/tests/test_python_matrix_workflow.py +++ b/tests/test_python_matrix_workflow.py @@ -68,7 +68,25 @@ def test_python_314_is_a_required_leg_not_an_isolated_experiment(): assert "3.14" in jobs[name]["strategy"]["matrix"]["python-version"] assert "continue-on-error" not in jobs[name] - assert sorted(jobs["summary"]["needs"]) == ["smoke_tests", "unit_tests"] + assert sorted(jobs["summary"]["needs"]) == [ + "cti_smoke_tests", "cti_unit_tests", "smoke_tests", "unit_tests" + ] + + +def test_cti_legs_are_required_and_skip_314_until_arcticpy_builds(): + """The CTI library joined the matrix on 2026-11-04 (cti-upkeep phase 1). Its jobs + are required (no continue-on-error) but run 3.12/3.13 only: arcticpy, a C++ + source build, does not build on 3.14 yet (cti-upkeep ruling R4). Both jobs + take arcticpy from PyAutoHeart's action, the single home of its pin.""" + jobs = load_workflow()["jobs"] + for name in ("cti_unit_tests", "cti_smoke_tests"): + assert jobs[name]["strategy"]["matrix"]["python-version"] == ["3.12", "3.13"] + assert "continue-on-error" not in jobs[name] + uses = [s.get("uses", "") for s in jobs[name]["steps"]] + assert any( + u.endswith("/PyAutoHeart/.github/actions/install-arcticpy@main") for u in uses + ) + assert not any("arcticpy==" in str(s) for s in jobs[name]["steps"]) def test_no_below_floor_success_or_banner_contract_remains(): diff --git a/tests/test_slack_release_notes.py b/tests/test_slack_release_notes.py index 317ce2ee..34aff2c5 100644 --- a/tests/test_slack_release_notes.py +++ b/tests/test_slack_release_notes.py @@ -68,12 +68,12 @@ def test_md_to_mrkdwn_keeps_blockquote_and_code(): assert "`pip install autolens`" in out -def test_release_links_all_four(): +def test_release_links_all_five(): links = release_links("2026.7.9.1") - for name in ("PyAutoFit", "PyAutoArray", "PyAutoGalaxy", "PyAutoLens"): + for name in ("PyAutoFit", "PyAutoArray", "PyAutoGalaxy", "PyAutoLens", "PyAutoCTI"): assert f"|{name}>" in links assert "releases/tag/2026.7.9.1" in links - assert links.count("·") == 3 + assert links.count("·") == 4 def test_build_success_text_embeds_notes_and_links():