Skip to content

feat: verify_install check F — simulate the Colab bootstrap end-to-end #45

Description

@Jammy2211

Overview

Closes the last gap from the Colab maturity effort (PyAutoLabs/PyAutoBuild#124, closed): nothing actually executes the Colab bootstrap path. The setup cell is unit-tested and its no-op-outside-Colab path runs everywhere, but no CI simulates a real Colab session. This adds a check F ("Colab simulation") to Heart's verify_install suite: fresh venv → pip from PyPI → fake google.colab → the injected setup cell's code verbatim → assert clone/config/cwd → run a real notebook cell.

User-approved in-session; effective level safe (mechanical, well-specified; single-purpose).

Plan

  • PyAutoHeart — new check_f in heart/checks/verify_install.sh, following the A–E pattern (throwaway venv, PASS/FAIL/SKIP row, --report-json sidecar → readiness). Emulates Colab's base env (pip install autolens jax), installs a fake google.colab stub in the venv so the real on-Colab branch activates, executes the injected-cell code verbatim, asserts the workspace cloned + config pushed + cwd moved, then runs a genuine cell (al.Imaging.from_fits on dataset/imaging/simple). Honest SKIP when the installed autoconf predates the setup() registry (i.e. until the next release) — the check self-activates once the release ships. Docs + arg parsing + help updated; light tests (syntax + help/arg surface).
  • PyAutoConf — add workspace_dir: str | None = None override to setup_colab.setup (threaded to _colab_setup/_clone_workspace), because the registry hardcodes Colab's /content/..., which CI cannot write. Unit tests extended.
Detailed implementation plan

Affected Repositories

  • PyAutoHeart (primary)
  • PyAutoConf

Branch Survey

Repository Current Branch Dirty?
./PyAutoConf main clean
./PyAutoHeart main clean

Suggested branch: feature/colab-sim-verify-install
Work Classification: Library
Worktree root: ~/Code/PyAutoLabs-wt/colab-sim-verify-install/

Implementation Steps

  1. PyAutoConf/autoconf/setup_colab.py: setup(project, raise_error_if_not_gpu=False, workspace_dir=None); override threads through _colab_setup_clone_workspace and the conf.instance.push/os.chdir paths. Docstring notes it exists for CI simulation.
  2. PyAutoConf/test_autoconf/test_setup_colab.py: override-threading test.
  3. PyAutoHeart/heart/checks/verify_install.sh: register F in usage/help/arg-parse/runner; check_f() builds the venv, installs autolens jax (honouring --version / --testpypi / PIP_INDEX_ARGS), writes google/colab stub packages into site-packages, writes a Python driver to the venv dir and runs it from a scratch cwd; driver: import google.colab, bootstrap pip install autoconf --no-deps, hasattr(setup_colab, "setup") else SKIP(rc 3), setup("autolens", raise_error_if_not_gpu=False, workspace_dir=$TMP), assert cwd/config/clone, then the imaging cell. PASS/FAIL/SKIP row per suite convention.
  4. PyAutoHeart/tests/test_verify_install_script.py: bash -n syntax check; --help lists F; unknown-arg rejection unchanged.
  5. Update heart/checks/verify_install.sh header comment + skills/verify_install doc line if it enumerates checks.

Key Files

  • PyAutoHeart/heart/checks/verify_install.sh
  • PyAutoConf/autoconf/setup_colab.py / test_autoconf/test_setup_colab.py

Original Prompt

Click to expand starting prompt

See PyAutoMind/issued/colab_sim_verify_install.md.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions