Skip to content

feat: require Python 3.12 #1428

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.

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