Skip to content

feat: require Python 3.12 #1428

Closed
Closed

Description

@Jammy2211

Overview

Raise the PyAutoFit package floor to Python 3.12 as Phase 1C of the ecosystem migration. This removes obsolete interpreter metadata and compatibility scaffolding while preserving the existing Optax dependency lower bound and runtime behavior on supported Python versions.

Plan

  • Require Python 3.12 and advertise only Python 3.12 and 3.13.
  • Remove the now-tautological Optax Python marker and its stale Python 3.9/3.10 resolver explanation without loosening optax >=0.2.5.
  • Replace both Python-3.7-era Protocol aliases with typing.Protocol.
  • Update the repository support contract and retain focused coverage for the affected graphical interfaces.
  • Validate the full suite on Python 3.12 and 3.13, built wheel metadata, curated downstream smoke tests, independent review, and Heart readiness.
Detailed implementation plan

Work Classification

Library

Affected Repositories

  • PyAutoFit (primary)

PyAutoHands was inferred only from the campaign prompt folder and is explicitly excluded from this phase; build and verification tooling belongs to Phase 2.

Branch Survey

Repository Current Branch Dirty?
./PyAutoFit main at origin/main 658e452 clean

No competing PyAutoMind worktree claims PyAutoFit.

Suggested branch: feature/python-312-floor

Worktree root: /home/jammy/Code/PyAutoLabs/.codex-worktrees/python-312-floor

Implementation Steps

  1. In pyproject.toml, set requires-python to >=3.12 and remove the Python 3.9, 3.10, and 3.11 classifiers.
  2. In pyproject.toml, remove the Optax python_version marker and the stale multi-line resolver comment while retaining optax>=0.2.5 unchanged.
  3. In autofit/graphical/factor_graphs/abstract.py and jacobians.py, import typing.Protocol directly and delete the Protocol = ABC compatibility aliases; preserve ABC where AbstractNode still requires it.
  4. In AGENTS.md, update the documented package floor to >=3.12.
  5. Census the repository for stale lower-floor metadata, markers, comments, and compatibility shims; add or adjust tests only if supported-runtime behavior needs extra coverage.
  6. Run the complete PyAutoFit suite on Python 3.12 and 3.13, verify generated wheel metadata, run the curated ecosystem smoke surface, obtain an independent CLEAN review, and consult Heart before shipping.

Key Files

  • pyproject.toml — interpreter metadata, classifiers, and Optax extra
  • autofit/graphical/factor_graphs/abstract.py — graphical Protocol interfaces and AbstractNode ABC
  • autofit/graphical/factor_graphs/jacobians.py — Jacobian Protocol interfaces
  • AGENTS.md — repository support contract
  • test_autofit/graphical/ — focused interface coverage if required

Original Prompt

Click to expand starting prompt

Python 3.12 floor — Phase 1C: PyAutoFit

Type: feature
Target: PyAutoFit
Difficulty: medium
Autonomy: supervised
Priority: high
Status: formalised

Parent: python_312_floor_phase_1_core.md
Depends on: python_312_floor_phase_1b_array.md

Scope

In @PyAutoFit, raise metadata/classifiers to 3.12/3.13, remove the now-tautological optax Python marker and its stale explanatory comment without loosening the pin, replace the two Python-3.7 Protocol = ABC shims with the direct modern definition, update tests if needed, and update AGENTS.md.

Activity

  1. Jammy2211 commented on Jul 29, 2026

    @Jammy2211
    CollaboratorAuthor

    Smoke Test Results — 2026-07-29

    Workspace Passed Failed Skipped Total
    autofit_workspace 7 0 1 8
    autogalaxy_workspace 10 0 0 10
    autolens_workspace 14 0 0 14
    autolens_workspace_test 16 3 2 21
    euclid_strong_lens_modeling_pipeline 4 2 0 6
    HowToLens 6 0 0 6
    Parallel total 57 5 3 65

    Sequential retry of all five parallel failures:

    • PASS autolens_workspace_test/interferometer/subhalo_recovery_interferometer.py — 14.0s
    • PASS autolens_workspace_test/misc/database/scrape/general.py — 93.0s
    • TIMEOUT autolens_workspace_test/imaging/subhalo_recovery.py — 300.1s
    • PASS euclid_strong_lens_modeling_pipeline/scripts/full_model.py — 147.1s
    • PASS euclid_strong_lens_modeling_pipeline/scripts/lens_model_waveband.py — 61.5s

    The only remaining failure is the exact script and timeout mode already reproduced in Phase 1B and explicitly accepted by the human as non-causal before authorizing the campaign to continue to subsequent phases. Phase 1C changes package metadata and replaces annotation-only Python-3.7 Protocol aliases; it does not touch likelihood or workspace runtime behavior. No new smoke signal is present.

    Additional gates already green:

    • Python 3.12: 1559 passed, 1 skipped
    • Python 3.13 clean optional profile: 1559 passed, 1 skipped
    • wheel: Requires-Python >=3.12; only 3.12/3.13 classifiers; optax>=0.2.5 preserved without a Python marker

    Proceeding to independent review without modifying code in response to smoke.

  2. Jammy2211 commented on Jul 29, 2026

    @Jammy2211
    CollaboratorAuthor

    Independent review and ship gate

    Claude Opus 5 reviewed the exact byte-identical four-file tree at maximum effort and returned CLEAN.

    Key review evidence:

    • generated metadata preserves optax>=0.2.5 exactly with no marker, requires Python >=3.12, and advertises only 3.12/3.13
    • the real typing.Protocol objects cannot be instantiated or used with isinstance unless runtime-checkable, unlike the old ABC aliases, but exhaustive in-repo and downstream searches found no such call site; the interfaces are annotation-only and not re-exported
    • ABC remains where AbstractNode needs it and is removed only where the shim was its sole use
    • no added test is justified because there is no reachable behavior to assert; existing graphical and full suites cover every consumer
    • the EP seam rule is not applicable because no graphical capability changed

    Gate summary:

    • Python 3.12: 1559 passed, 1 skipped
    • Python 3.13: 1559 passed, 1 skipped
    • wheel metadata: correct floor/classifiers and exact Optax lower bound
    • smoke: 57 passed / 5 parallel failures / 3 intentional skips; sequential retry 4 passed and only the exact previously human-accepted imaging/subhalo_recovery.py 300-second timeout remained
    • review: CLEAN
    • Heart: YELLOW score 65, exact previously acknowledged four-reason campaign set, no RED

    Proceeding to commit, push, and pending-release PR. The human has authorized campaign PR merges after the exact reviewed heads pass CI; no release is authorized.

  3. Jammy2211 commented on Jul 29, 2026

    @Jammy2211
    CollaboratorAuthor

    Phase 1C merged via PR #1429.

    • Reviewed head: 70d31a3e25326a704fcef4f8eb5644010603ccea
    • Merge commit: 241f2d69c4d8d0d1df19765431caacfcc3468da9
    • GitHub checks: docs plus Python 3.12/3.13 push and pull-request jobs all passed
    • Independent Claude Opus 5 review: CLEAN
    • Heart campaign launch acknowledgement: unchanged YELLOW set, no new RED
    • No release was performed

    The issue remains open as the campaign record; Phase 1D (PyAutoGalaxy) is next.

  4. Jammy2211 commented on Jul 30, 2026

    @Jammy2211
    CollaboratorAuthor

    Phase 1C merged unchanged as PyAutoFit#1429 (241f2d6), CI 5/5 green on the reviewed head. python-312-floor arc complete (record: PyAutoMind/complete/2026/07/python-312-floor.md; parent PyAutoNerves#142 closed). Closing on the same 2026-07-30 human cleanup authorization.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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