Skip to content

chore: sync __version__ stamps to 2026.8.17.1 + guard release seds #235

Description

@Jammy2211

Overview

The five coupled libraries' source __version__ literals are deliberately frozen between releases (wheels are sed-stamped at build time; per-release bump commits to library mains caused the June/July 2026 accidental-release cascade, PyAutoBuild#118/#120). In-session research (full readers/writers map + check_version handshake mechanics) rejected migrating to a derived importlib.metadata version — local dev resolves via PYTHONPATH with no dist metadata, so it would only add per-run warnings while breaking the release sed. Instead: perform the deliberate manual sync to 2026.8.17.1, document the freeze in-line, and harden the release machinery so the loose sed can never silently ship a broken wheel.

Plan

  • Sync the five __version__ literals from 2026.7.23.1 to 2026.8.17.1, each with a one-line comment documenting the freeze design (tag/wheel = release truth; literal = last manual sync).
  • Delete the three dead legacy release.sh stampers (unreferenced; their grep -v __version__ rewrite would mangle any future multi-line stamp).
  • Add a post-sed guard in the release workflow: after each version-stamp sed, ast.parse the stamped __init__.py and assert the exact __version__ = "$VERSION" line, failing the build loudly otherwise.
Detailed implementation plan

Affected Repositories

  • PyAutoHands (primary — release workflow guard)
  • PyAutoNerves, PyAutoArray, PyAutoFit, PyAutoGalaxy, PyAutoLens (stamp sync + comment; dead-script deletion in three)

Branch Survey

Repository Current Branch Dirty?
./PyAutoNerves main clean
./PyAutoArray main clean
./PyAutoFit main clean
./PyAutoGalaxy main clean
./PyAutoLens main clean
./PyAutoHands main clean

Suggested branch: feature/version-stamp-sync-guards

Implementation Steps

  1. In each of autonerves/__init__.py:119, autoarray/__init__.py:110, autofit/__init__.py:163, autogalaxy/__init__.py:134, autolens/__init__.py:154: set __version__ = "2026.8.17.1" preceded by a one-line comment: last manual sync; wheels are stamped at build time by the release workflow; git tag is release truth; deliberately not bumped per release (PyAutoBuild#118/feat: release stamping slim — wheels+tags only, no daily bump commits (R3-core) #120).
  2. Delete PyAutoLens/release.sh, PyAutoArray/files/release.sh, PyAutoFit/files/release.sh (dead: no callers anywhere in the workspace; only release.sh reference is PyAutoBrain's unrelated release conductor).
  3. In PyAutoHands/.github/workflows/release.yml, after the stamp sed in both the rehearsal build (~line 136) and the live build (~line 431): verify with python3 -c "import ast,sys; ast.parse(open(f).read())" over each stamped */__init__.py and grep -F "__version__ = \"$VERSION\"", exiting non-zero with a clear ::error:: if either fails. The current sed pattern [\."\'0-9]* is unanchored/zero-or-more and empirically corrupts non-literal assignments into SyntaxErrors — the guard converts that silent failure mode into a loud one.
  4. Verify: ast.parse the five edited files locally; confirm PyAutoBrain/bin/version_drift.sh still resolves all five stamps (consensus at 2026.8.17.1); library test suites unaffected (zero __version__ assertions — verified by research).

Key Files

  • PyAutoHands/.github/workflows/release.yml — the two stamp seds + new guards
  • autonerves|autoarray|autofit|autogalaxy|autolens/__init__.py — stamp sync + freeze comment
  • PyAutoLens/release.sh, PyAutoArray/files/release.sh, PyAutoFit/files/release.sh — delete

Original Prompt

Click to expand starting prompt

Version-stamp sync to 2026.8.17.1 + release-sed guards

Type: maintenance
Target: libraries
Repos:

  • @PyAutoNerves
  • @PyAutoArray
  • @PyAutoFit
  • @PyAutoGalaxy
  • @PyAutoLens
  • @PyAutoHands
    Difficulty: small
    Autonomy: safe
    Priority: medium
    Status: draft

Original request (verbatim): "should we even bother with having these versions?
I think we should but if so they should update?" → "ok do it but do a bit more
deep research on the source code first to make sure its the right approach".

In-session research (2026-08-17, full readers/writers map + handshake
mechanics) concluded the derive-from-importlib.metadata migration is
net-negative for this stack: local dev resolves libs via PYTHONPATH (no dist
metadata → fallback always taken → per-run check_version UserWarning), the
release stamp sed would corrupt a try/except block into SyntaxError wheels,
assistant chat-bundle regeneration would publish dev stamps to users, and
per-release bump commits to library mains are the documented cause of the
June/July 2026 accidental-release cascade (PyAutoBuild#118/#120). Human chose
the manual-sync-plus-guards package instead:

  1. Sync the five frozen __version__ literals from 2026.7.23.1 to the
    latest release 2026.8.17.1 (same deliberate manual sync that produced
    7.23): autonerves/__init__.py:119, autoarray/__init__.py:110,
    autofit/__init__.py:163, autogalaxy/__init__.py:134,
    autolens/__init__.py:154. Add a one-line comment at each stamp site
    documenting the freeze design (git tag / stamped wheel = release truth;
    this literal = last manual sync, deliberately NOT bumped per release).
  2. Delete the three dead legacy stampersPyAutoLens/release.sh,
    PyAutoArray/files/release.sh, PyAutoFit/files/release.sh — unreferenced,
    and their grep -v __version__ rewrite would mangle any future refactor of
    the stamp lines.
  3. Guard the live release seds in
    PyAutoHands/.github/workflows/release.yml (~136 rehearsal build, ~431 live
    build): after each sed, verify the stamped __init__.py still parses
    (python3 -c "import ast; ast.parse(...)") and contains the exact
    __version__ = "$VERSION" line, failing the job loudly otherwise. The sed's
    unanchored zero-or-more pattern was empirically shown to be able to ship a
    SyntaxError wheel silently.

Supersedes nerves_version_stamp_behind_consensus.md (its drift already
resolved — all five stamps read 2026.7.23.1; the pre_build stamp-sweep question
it raised is moot since pre_build no longer stamps versions). While in
version_drift.sh territory: no change needed there — literal date stamps
remain grep-able after this task.

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