Skip to content

Drop support for Python 3.10 - #555

Open
ggalloni wants to merge 2 commits into
masterfrom
drop-python-3.10
Open

ggalloni wants to merge 2 commits into
masterfrom
drop-python-3.10

Conversation

@ggalloni

Copy link
Copy Markdown
Collaborator

Raises the minimum Python to 3.11. Opened to see the matrix go green on 3.11; the timing against the 0.18.0 release is yours to decide.

Why now

Python 3.10 reaches end of life in October 2026, but the stronger reason is that it was already splitting the dependency stack. pyproject.toml carried two numpy pins:

"numpy>=2.2.6,<2.3; python_version == '3.10'",
"numpy>=2.4.1;     python_version >= '3.11'",

and uv.lock resolved eleven packages at two or three versions at once, every split marked python_full_version < '3.11':

package on 3.10 on 3.11+
numpy 2.2.6 2.4.6
scipy 1.15.3 1.17.1 / 1.18.0
astropy 6.1.7 8.0.1
matplotlib 3.10.9 3.11.0

Astropy two major versions apart matters for a framework that runs Time, TimeDelta and units through it everywhere. The CI matrix was comparing two scientific stacks, not two interpreters.

SPEC 0, which numpy, scipy and astropy follow, suggests dropping a Python version about three years after release. For 3.10 that was late 2024, so this is catching up rather than moving early.

Effect

Packages locked at more than one version drop from 11 to 2 (scipy and sphinx, now splitting on 3.11 against 3.12+, which is normal). Zero python_full_version < '3.11' markers remain. The exceptiongroup backport disappears, ExceptionGroup being stdlib from 3.11, and decorator drops out too. uv.lock loses 900 lines.

Scope

No source changes. There is no sys.version_info branch anywhere in litebird_sim/, so nothing was compensating for 3.10.

pyupgrade --py311-plus does rewrite three files in litebird_sim/hwp_harmonics/, but --py310-plus produces byte-identical output: it is only stripping # -*- encoding: utf-8 -*- cookies from files that escaped 7a10e64. That is pre-existing and deliberately left out of this PR.

Worth knowing

This removes the only CI leg that exercised astropy 6. That is the intent, but it means any latent astropy-6-only assumption will now go unnoticed rather than being caught here.

BrahMap is unaffected: it declares requires-python = ">=3.10,<3.15" with numpy and scipy unpinned, so it installs on 3.11+ unchanged. @anand-avinash may want to follow suit, and separately BrahMap's classifiers stop at 3.13 while its requires-python allows 3.14.

Changelog

Entered as a breaking change. The Reference PR link still needs adding now that this PR has a number.

Python 3.10 reaches end of life in October 2026, but the stronger reason to
move now is that it was splitting the dependency stack. `pyproject.toml`
already carried two numpy pins, `>=2.2.6,<2.3` for 3.10 against `>=2.4.1`
for everything else, and `uv.lock` resolved eleven packages at more than one
version, every split carrying the marker `python_full_version < '3.11'`.
Astropy was the worst of them, 6.1.7 on 3.10 against 8.0.1 elsewhere, so the
CI matrix was comparing two scientific stacks rather than two interpreters.

After the bump only `scipy` and `sphinx` remain split, on 3.11 against 3.12+,
and the `exceptiongroup` and `decorator` backports drop out entirely.

No source changes are needed: there is no `sys.version_info` branch anywhere
in `litebird_sim/`.
@github-actions

github-actions Bot commented Sep 22, 2026

Copy link
Copy Markdown

Coverage report

This PR does not seem to contain any modification to coverable code.

This branch has not been deployed

No deployments
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