Skip to content

Commit 59cabd4

Browse files
authored
Merge pull request #97 from PyAutoLabs/feature/assistant-release-baseline
feat: auto-refresh autolens_assistant API baseline in release pipeline
2 parents 6537102 + f3a82ca commit 59cabd4

3 files changed

Lines changed: 47 additions & 3 deletions

File tree

.github/workflows/release.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -837,6 +837,12 @@ jobs:
837837
package: PyAutoLens
838838
generate_notebooks: false
839839
bump_colab_urls: false
840+
- repository: PyAutoLabs/autolens_assistant
841+
name: autolens
842+
package: PyAutoLens
843+
generate_notebooks: false
844+
bump_colab_urls: false
845+
write_api_baseline: true
840846
steps:
841847
- uses: actions/checkout@v2
842848
if: "${{ github.event.inputs.skip_release != 'true' }}"
@@ -905,6 +911,39 @@ jobs:
905911
PY
906912
git add version.txt config/general.yaml 2>/dev/null || git add version.txt
907913
git commit -m "Release $VERSION: pin workspace version" || true
914+
- name: Regenerate API audit baseline
915+
if: "${{ github.event.inputs.skip_release != 'true' && matrix.workspace.write_api_baseline == true }}"
916+
env:
917+
NUMBA_CACHE_DIR: /tmp/numba_cache
918+
MPLCONFIGDIR: /tmp/matplotlib
919+
PYAUTO_SKIP_WORKSPACE_VERSION_CHECK: "1"
920+
run: |
921+
VERSION="${{ needs.version_number.outputs.version_number }}"
922+
# Install the just-released wheels so the baseline hashes the published
923+
# API surface, then let the assistant regenerate its own baseline (it
924+
# owns the hash format — no reimplementation here).
925+
install_cnt=0
926+
until python3 -m pip install \
927+
--index-url https://test.pypi.org/simple/ \
928+
--extra-index-url https://pypi.org/simple \
929+
"autoconf[optional]==$VERSION" \
930+
"autoarray[optional]==$VERSION" \
931+
"autofit[optional]==$VERSION" \
932+
"autogalaxy[optional]==$VERSION" \
933+
"autolens[optional]==$VERSION"; do
934+
((install_cnt=install_cnt+1))
935+
if [[ $install_cnt -ge 30 ]]; then
936+
echo "ERROR: Install failed after 30 attempts"
937+
exit 1
938+
fi
939+
sleep 10
940+
done
941+
pip install matplotlib==3.6.0 pynufft==2025.1.1 numba
942+
pushd workspace
943+
python3 work/audit_skill_apis.py --write-baseline
944+
git add wiki/core/api_audit_baseline.json
945+
git commit -m "Release $VERSION: regenerate API audit baseline" || true
946+
popd
908947
- name: Bump Colab URL tag refs
909948
if: "${{ github.event.inputs.skip_release != 'true' && matrix.workspace.bump_colab_urls == true }}"
910949
run: |

pre_build.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,10 @@ run_workspace "HowToLens" "howtolens" true false
9999
run_workspace "HowToFit" "howtofit" true false PyAutoFit
100100
run_workspace "autofit_workspace_developer" "" false false ""
101101
run_workspace "autolens_workspace_developer" "" false false ""
102+
# The AI assistant repo. No notebook generation or README pin; release.yml's
103+
# release_workspaces job stamps its workspace version and regenerates
104+
# wiki/core/api_audit_baseline.json against the released wheels.
105+
run_workspace "autolens_assistant" "autolens" false false ""
102106

103107
# Commit and push PyAutoBuild itself
104108
echo ""

verify_workspace_versions.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
# If both exist and disagree, the script fails — they must be kept in sync
1717
# by the release pipeline.
1818
#
19-
# Compares each of the 7 workspaces (3 main + 3 HowTo + euclid_pipeline)
20-
# against its installed library version, parsed as a YYYY.M.D.B 4-tuple of
21-
# ints. Exits 1 if any workspace.version > library.version.
19+
# Compares each of the 8 workspaces (3 main + 3 HowTo + euclid_pipeline +
20+
# autolens_assistant) against its installed library version, parsed as a
21+
# YYYY.M.D.B 4-tuple of ints. Exits 1 if any workspace.version > library.version.
2222
#
2323
# Workspace → library mapping mirrors the release_workspaces matrix in
2424
# .github/workflows/release.yml.
@@ -37,6 +37,7 @@ WORKSPACES=(
3737
"HowToGalaxy|autogalaxy"
3838
"HowToLens|autolens"
3939
"euclid_strong_lens_modeling_pipeline|autolens"
40+
"autolens_assistant|autolens"
4041
)
4142

4243
# Compare two YYYY.M.D.B versions. Echoes AHEAD / BEHIND / MATCH / BAD.

0 commit comments

Comments
 (0)