Skip to content

refactor: hide autonerves behind Colab bootstrap #194

Description

@Jammy2211

Overview

Stop teaching workspace users to import setup_colab directly from autonerves. Product-level re-exports already exist, but fresh Colab runtimes must still use autonerves privately to install the correct package stack before the product package is available.

This is phase 1 of 2: update and verify the bootstrap generator first, then regenerate all six workspace/HowTo repositories.

Plan

  • Map every Colab project to its public autofit, autogalaxy, or autolens package.
  • Keep autonerves as a private, Colab-only bootstrap implementation.
  • Update generator tests to enforce the public/private boundary.
  • Keep PyAutoHeart's end-to-end Colab simulation aligned with the generated cell.
  • Follow with the six-repository workspace rollout.
Detailed implementation plan

Affected Repositories

  • PyAutoHands (primary)
  • PyAutoHeart

Work Classification

Library/infrastructure phase; workspace rollout follows separately.

Branch Survey

Repository Current Branch Dirty?
./PyAutoHands main Untracked run_logs/
./PyAutoHeart main Clean

At survey time both repositories were claimed by test-results-relayout on
feature/test-results-relayout; that task shipped before issue creation and
the claims are now clear.

Suggested branch: feature/hide-autonerves-colab-bootstrap

Worktree root: ~/Code/PyAutoLabs-wt/hide-autonerves-colab-bootstrap

Implementation Steps

  1. Update PyAutoHands/autohands/build_util.py:

    • Replace the project set with a project-to-product mapping.
    • On Colab, continue installing autonerves --no-deps and load its setup
      implementation privately.
    • Outside Colab, resolve setup_colab through the mapped product package.
    • Preserve the existing project registry call, workspace clone, configuration
      setup, and version-selection behaviour.
  2. Update PyAutoHands/tests/test_inject_colab_setup.py:

    • Verify all six project mappings.
    • Reject generated from autonerves import setup_colab imports.
    • Assert the private Colab bootstrap still installs and invokes autonerves.
    • Preserve idempotency, insertion-position, and handwritten-setup coverage.
  3. Update PyAutoHeart/heart/checks/verify_install.sh:

    • Replace check F's verbatim injected cell with the revised template.
    • Continue exercising the fake-Colab path, stack installation,
      version-matched clone, configuration setup, and real notebook cell.
  4. Validate:

    • Run the focused PyAutoHands injection tests.
    • Run shell syntax checks for the Heart driver.
    • Run PyAutoHeart verify-install check F.
    • Confirm no generated public import exposes autonerves.setup_colab.
  5. After this phase lands, start the dependent six-workspace rollout.

Key Files

  • PyAutoHands/autohands/build_util.py — generated Colab setup cell.
  • PyAutoHands/tests/test_inject_colab_setup.py — generator contract tests.
  • PyAutoHeart/heart/checks/verify_install.sh — end-to-end Colab simulation.

Original Prompt

Click to expand starting prompt

autonerves should not be user facing API, but it is in many workspace examples: from autonerves import setup_colab , update it so its not, but make sure the colab install still uses it as it needs the right install rhere I think.

this is prob requied for PyautoGalaxy too

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions