Skip to content

fix: install every lazily-imported dependency in the Colab bootstrap; gate setup_colab.py on PRs - #169

Merged
Jammy2211 merged 2 commits into
mainfrom
feature/colab-bootstrap-lazy-deps
Sep 15, 2026
Merged

Jammy2211 merged 2 commits into
mainfrom
feature/colab-bootstrap-lazy-deps

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Summary

Closes #167.

autonerves.setup_colab installs 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 with ModuleNotFoundError: 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_EXTRAS gains corner==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-sampler 1.0.4 → 1.0.5, anesthetic ==2.8.14 → >=2.9.0).
  • A second pass driven by PyAutoHeart's new Colab gate (feat(heart): Colab gate — check F seeds from Google's manifest and audits every lazy import PyAutoHeart#228, which probes every import after the real --no-deps bootstrap in a venv built from Google's published Colab manifest) adds jax_zero_contour>=2.0.0,<3.0.0 — an autogalaxy base dependency reached by autogalaxy/operate/lens_calc.py:1452,1884 (critical curves) — and zeus-mcmc==2.5.4 (af.Zeus, run by autofit_workspace plot/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-deps install is clean.
  • TestSpecifiersTrackAutofit derives its expectations at run time from PyAutoFit's and PyAutoGalaxy's pyproject.toml (never restating a literal it guards); test_every_project_installs_every_sampler requires the full set.
  • New .github/workflows/colab-gate.yml: PRs touching setup_colab.py check out PyAutoHeart main and run check F with this checkout overlaid (COLAB_GATE_AUTONERVES_SRC), the PR-time complement of Heart's release-time verify_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 (Heart main must contain colab_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's colab_gate.yaml.

API Changes

None. _SHARED_EXTRAS is a private module-level list; setup() and the for_<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 autonerves unpinned 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

Generated by the PyAutoLabs agent workflow.

🤖 Generated with Claude Code

Jammy2211 and others added 2 commits September 15, 2026 20:50
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>
@Jammy2211 Jammy2211 added the pending-release PR queued for the next release build label Sep 15, 2026
@Jammy2211
Jammy2211 merged commit 8eca4b3 into main Sep 15, 2026
5 checks passed
@Jammy2211
Jammy2211 deleted the feature/colab-bootstrap-lazy-deps branch September 15, 2026 20:03
@Jammy2211 Jammy2211 removed the pending-release PR queued for the next release build label Sep 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: Colab bootstrap installs no lazily-imported dependency (corner, optax, xxhash, blackjax)

1 participant