Skip to content

Require Python >=3.12#745

Merged
lewisjared merged 5 commits into
mainfrom
chore/python-312-minimum
Jun 19, 2026
Merged

Require Python >=3.12#745
lewisjared merged 5 commits into
mainfrom
chore/python-312-minimum

Conversation

@lewisjared

Copy link
Copy Markdown
Contributor

Description

Raises the minimum supported Python version to 3.12 and modernises the codebase for it. Two commits:

  • chore: require Python >=3.12requires-python across all packages, trove classifiers, .python-version, README badges, install docs, and the CI matrices now target 3.12. uv.lock is regenerated on 3.12, which drops the <3.12 backport packages (async-timeout, importlib-metadata, tomli, zipp, overrides).
  • style: modernise syntax for Python 3.12 — raises the ruff target-version to py312 and applies the resulting pyupgrade fixes: datetime.UTC, Self/StrEnum imports, PEP 695 generic syntax, and removal of dead sys.version_info compatibility blocks.

Motivation: newer ilamb3 (>=2026.4.20, and the in-flight amoc-rapid trim_time fix) requires Python >=3.12.

Verified locally: ruff check clean, mypy clean (129 files), the CLI/config/constraints suites pass (452 passed), and the full workspace collects (2331 tests) and builds on 3.12.

Checklist

Please confirm that this pull request has done the following:

  • Tests added
  • Documentation added (where applicable)
  • Changelog item added to changelog/

Raise the minimum supported Python version from 3.11 to 3.12 across the
workspace: requires-python in every package, trove classifiers,
.python-version, README badges, install docs, and the CI matrices. The
lockfile is regenerated on 3.12, which drops the <3.12 backport packages
(async-timeout, importlib-metadata, tomli, zipp, overrides).

This unblocks newer ilamb3 (>=2026.4.20), which requires Python >=3.12.
Raise the ruff target-version to py312 and apply the resulting pyupgrade
fixes: datetime.UTC, Self/StrEnum imports, PEP 695 generic syntax, and
removal of dead sys.version_info compatibility blocks.

Verified: ruff check clean, mypy clean (129 files), and the CLI, config
and constraints test suites pass (the StrEnum and PEP 695 generic changes
are behaviour-preserving).
@codecov

codecov Bot commented Jun 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Flag Coverage Δ
core 92.58% <100.00%> (+0.01%) ⬆️
providers 91.82% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...te-ref-core/src/climate_ref_core/cmip6_to_cmip7.py 94.50% <100.00%> (ø)
...imate-ref-core/src/climate_ref_core/constraints.py 98.57% <100.00%> (+0.90%) ⬆️
...ate-ref-core/src/climate_ref_core/pycmec/metric.py 98.21% <100.00%> (-0.01%) ⬇️
...ate-ref-core/src/climate_ref_core/pycmec/output.py 98.68% <100.00%> (-0.02%) ⬇️
...ges/climate-ref/src/climate_ref/_config_helpers.py 89.61% <100.00%> (ø)
...ckages/climate-ref/src/climate_ref/cli/__init__.py 96.96% <100.00%> (ø)
...ages/climate-ref/src/climate_ref/cli/executions.py 94.88% <100.00%> (ø)
...kages/climate-ref/src/climate_ref/cli/providers.py 98.78% <100.00%> (ø)
...s/climate-ref/src/climate_ref/executor/fragment.py 86.15% <100.00%> (ø)
packages/climate-ref/src/climate_ref/solver.py 98.90% <100.00%> (ø)

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@lewisjared lewisjared merged commit 82aff55 into main Jun 19, 2026
27 checks passed
@lewisjared lewisjared deleted the chore/python-312-minimum branch June 19, 2026 05:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant