fix: install every lazily-imported dependency in the Colab bootstrap; gate setup_colab.py on PRs - #169
Merged
Conversation
The Heart Colab gate (PyAutoHeart#228) probes every lazy import after the real --no-deps bootstrap. Two more unguarded imports of packages Colab does not ship: jax_zero_contour (autogalaxy base dependency, reached by lens_calc.py critical-curve code) and zeus-mcmc (af.Zeus, used by autofit_workspace notebooks). The specifier test now also derives expectations from PyAutoGalaxy's pyproject. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
PR-time complement of PyAutoHeart's release-only verify_install_release job: checks out PyAutoHeart main and runs check F with this branch's setup_colab overlaid (COLAB_GATE_AUTONERVES_SRC), so a _SHARED_EXTRAS change is proven against Google's Colab manifest before it merges. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #167.
autonerves.setup_colabinstalls the PyAuto stack on Colab with--no-deps, so every dependency Colab does not preinstall must be named in_SHARED_EXTRAS. HowToFit tutorial 5 died on Colab on 2026-09-15 withModuleNotFoundError: No module named 'corner'after its emcee run — the third report of this class (#166 closed it for emcee/dynesty). This PR audits the whole list rather than adding one package, and adds the PR-time gate that stops the list drifting again._SHARED_EXTRASgainscorner==2.2.2,optax>=0.2.5,xxhash<=3.4.1,blackjax>=1.6.2(lazily imported autofit deps) and corrects two specifiers drifted from PyAutoFit's pyproject (nautilus-sampler1.0.4 → 1.0.5,anesthetic==2.8.14 → >=2.9.0).--no-depsbootstrap in a venv built from Google's published Colab manifest) addsjax_zero_contour>=2.0.0,<3.0.0— an autogalaxy base dependency reached byautogalaxy/operate/lens_calc.py:1452,1884(critical curves) — andzeus-mcmc==2.5.4(af.Zeus, run by autofit_workspaceplot/zeus_plotter,cookbooks/search,searches/mcmc). Every runtime requirement of both is already shipped by Colab (jax/jaxlib 0.11.1; numpy, scipy, tqdm, setuptools, pytest, matplotlib, seaborn, scikit-learn), so the--no-depsinstall is clean.TestSpecifiersTrackAutofitderives its expectations at run time from PyAutoFit's and PyAutoGalaxy'spyproject.toml(never restating a literal it guards);test_every_project_installs_every_samplerrequires the full set..github/workflows/colab-gate.yml: PRs touchingsetup_colab.pycheck out PyAutoHeartmainand run check F with this checkout overlaid (COLAB_GATE_AUTONERVES_SRC), the PR-time complement of Heart's release-timeverify_install_release. It goes green only once feat(heart): Colab gate — check F seeds from Google's manifest and audits every lazy import PyAutoHeart#228 is merged (Heartmainmust containcolab_gate.py).Witness with this branch overlaid on Heart check F: FAIL on five modules before the second pass →
F|PASS(179 s) after it; the three remaining unguarded imports (colossus,hmf,mcp) are not notebook paths and are accepted with written reasons in Heart'scolab_gate.yaml.API Changes
None.
_SHARED_EXTRASis a private module-level list;setup()and thefor_<project>()entry points are unchanged. User-visible effect: Colab notebooks additionally install the packages above at bootstrap.Shipping
Merging fixes nothing on its own — the setup cell pip-installs
autonervesunpinned at run time, so the autonerves PyPI release carrying this is what reaches every published notebook retroactively. Confirm the overnight release run has settled before cutting one.Test Plan
python3 -m pytest -q test_autonerves: 185 passedF|PASS, 179 s (feat(heart): Colab gate — check F seeds from Google's manifest and audits every lazy import PyAutoHeart#228 leg 3)colab-gate.ymlgreen on this PR after PyAutoHeart#228 mergesGenerated by the PyAutoLabs agent workflow.
🤖 Generated with Claude Code