From 70d31a3e25326a704fcef4f8eb5644010603ccea Mon Sep 17 00:00:00 2001 From: Jammy2211 Date: Wed, 29 Jul 2026 10:47:20 +0100 Subject: [PATCH] feat: require Python 3.12 --- AGENTS.md | 2 +- autofit/graphical/factor_graphs/abstract.py | 3 +-- autofit/graphical/factor_graphs/jacobians.py | 4 +--- pyproject.toml | 15 +++------------ 4 files changed, 6 insertions(+), 18 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 2d20d118c..c21599567 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -43,7 +43,7 @@ NUMBA_CACHE_DIR=/tmp/numba_cache MPLCONFIGDIR=/tmp/matplotlib python -m pytest t PRs must pass `pytest --cov` on the CI matrix (Python 3.12 **and** 3.13). There is no black/ruff/flake8 gate — formatting is advisory. (`requires-python` in -`pyproject.toml` is `>=3.9`.) +`pyproject.toml` is `>=3.12`.) ## Configuration & defaults diff --git a/autofit/graphical/factor_graphs/abstract.py b/autofit/graphical/factor_graphs/abstract.py index 91313813f..55dab4279 100644 --- a/autofit/graphical/factor_graphs/abstract.py +++ b/autofit/graphical/factor_graphs/abstract.py @@ -8,6 +8,7 @@ Optional, Collection, Any, + Protocol, TYPE_CHECKING, ) @@ -36,8 +37,6 @@ from autofit.graphical.mean_field import MeanField from autofit.graphical.expectation_propagation import EPMeanField -Protocol = ABC # for python 3.7 compat - Value = Dict[Variable, np.ndarray] GradientValue = VariableData diff --git a/autofit/graphical/factor_graphs/jacobians.py b/autofit/graphical/factor_graphs/jacobians.py index 0385b559d..447b36402 100644 --- a/autofit/graphical/factor_graphs/jacobians.py +++ b/autofit/graphical/factor_graphs/jacobians.py @@ -16,16 +16,14 @@ from autofit.mapper.variable_operator import ( RectVariableOperator, ) -from abc import ABC from typing import ( Tuple, Dict, Union, Callable, + Protocol, ) -Protocol = ABC # for python 3.7 compat - Value = Dict[Variable, np.ndarray] GradientValue = VariableData diff --git a/pyproject.toml b/pyproject.toml index 4a681cd35..1fc09840f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,7 +8,7 @@ dynamic = ["version"] description = "Classy Probabilistic Programming" readme = { file = "README.md", content-type = "text/markdown" } license = { text = "MIT" } -requires-python = ">=3.9" +requires-python = ">=3.12" authors = [ { name = "James Nightingale", email = "James.Nightingale@newcastle.ac.uk" }, { name = "Richard Hayes", email = "richard@rghsoftware.co.uk" }, @@ -18,9 +18,6 @@ classifiers = [ "Topic :: Scientific/Engineering :: Physics", "Natural Language :: English", "Operating System :: OS Independent", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13" ] @@ -66,13 +63,7 @@ local_scheme = "no-local-version" [project.optional-dependencies] -# optax carries the same `python_version >= '3.11'` marker every entry in -# autonerves[jax] does. Without it, resolving this extra on 3.9/3.10 sends pip -# backtracking through the whole optax/jax release history looking for a version -# with wheels for that interpreter — which ends in `resolution-too-deep`, taking -# every 3.9 leg of python_matrix red. optax is only useful where jax is -# installed, and jax is gated to 3.11+, so gating optax to match loses nothing. -jax = ["autonerves[jax]", "optax>=0.2.5; python_version >= '3.11'"] +jax = ["autonerves[jax]", "optax>=0.2.5"] mcp = ["mcp"] optional = [ "autofit[jax]", @@ -104,4 +95,4 @@ filterwarnings = [ "ignore:cuda_plugin_extension:UserWarning", "ignore::DeprecationWarning:jax", "ignore:relationship .* will copy column:sqlalchemy.exc.SAWarning", -] \ No newline at end of file +]