chore: drop Python 3.9, require 3.10+ - #1135
Draft
henryiii wants to merge 1 commit into
Draft
Conversation
This was referenced Jun 11, 2026
Member
Author
|
Ahh, I've been trying to remember to tell it not to do a Python drop, missed this one had that recommendation. If this is helpful, we can leave it open, if you prefer to do it yourself eventually, happy to close. (I have a custom skill that can be used for Python drops, too, at https://github.com/henryiii/skills). |
henryiii
force-pushed
the
chore/drop-python-39-1132
branch
from
June 15, 2026 12:40
8ad48f8 to
2b66bd5
Compare
henryiii
force-pushed
the
chore/drop-python-39-1132
branch
from
July 23, 2026 18:43
2b66bd5 to
af3e7da
Compare
eduardo-rodrigues
pushed a commit
that referenced
this pull request
Jul 24, 2026
cibuildwheel/manylinux has dropped 3.13t (which was experimental only), pybind11 is dropping 3.13t, numpy dropped it, etc, so drop it here too. Support 3.14t+ only. GitHub has also removed the `macos-13` runner, so the x86-64 macOS wheel jobs now queue forever. Switch them to `macos-26-intel`. This fixes the CI on jobs that touch files triggering wheel builds. Part of unblocking #1143. :robot: _AI text below_ :robot: NumPy no longer ships free-threaded (`cp313t`) wheels for Windows `win32` and `win_arm64`. cibuildwheel then tries to build numpy from source in the wheel test step and fails (no compiler / `Python.h`). The `cp313t` Windows jobs are red on any PR that triggers the wheel matrix (e.g. #1133, #1135). Free-threaded 3.14 (`cp314t`) wheels exist and already pass across the whole matrix, so this drops `cp313t` from the wheel build matrix in `release.yml` and keeps `cp314t`.
Python 3.9 reached EOL in October 2025. Bump the minimum required
version to 3.10 and apply the modernizations it unlocks: PEP 604
union types, builtin generics, and collections.abc.Callable in
place of deprecated typing aliases.
- pyproject.toml: requires-python >=3.10, numpy >=1.21.3, remove
cp39 from cibuildwheel skip/overrides
- .github/workflows/release.yml: drop cp39 from wheel matrix
- .github/workflows/test.yml: min-version leg moved to 3.10/numpy 1.21.3
- src/iminuit/typing.py: use X | Y and builtin generics throughout
- src/iminuit/{ipywidget,qtwidget}.py: collections.abc.Callable, dict[]
- ruff UP fixes applied across src/ (F401 unused typing imports removed,
Union/Optional/List/Tuple/Dict replaced with modern equivalents)
- doc/conf.py: sync root_version to submodule
Assisted-by: ClaudeCode:claude-sonnet-4-6
henryiii
force-pushed
the
chore/drop-python-39-1132
branch
from
July 25, 2026 01:13
af3e7da to
777f194
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 AI text below 🤖
Addresses part of #1132.
Python 3.9 reached EOL in October 2025. This PR drops 3.9 support, bumping the minimum to Python 3.10, and applies the modernizations that unlocks.
Changes
pyproject.toml
requires-python = ">=3.10"(was>=3.9)numpy >=1.21.3(oldest numpy with a 3.10 wheel; was>=1.21)Programming Language :: Python :: 3.10/3.11/3.12/3.13classifiers[tool.cibuildwheel]: removedcp39-musllinux_i686skip entry (replaced withcp310-musllinux_i686)[[tool.cibuildwheel.overrides]]: selector changed fromcp3{9,10}-manylinux*tocp310-manylinux*.github/workflows/release.yml
cp39from thepy:matrix.github/workflows/test.yml
python-version: "3.9"/numpy==1.21.0topython-version: "3.10"/numpy==1.21.3noxfile.py
MINIMUM_PYTHONreads frompyproject.tomldynamically, so it picks up 3.10 automatically.Typing modernization (src/iminuit/)
typing.py: removedOptional,Union,Listimports;Keytype alias andUserBound/Intervalfields now useX | Yandfloat | Nonesyntax; addedfrom __future__ import annotationsipywidget.py,qtwidget.py:from typing import Dict, Callablereplaced withcollections.abc.Callableanddict[str, Any]typing.Union,Optional,List,Tuple,Dict,Setusages replaced with modern equivalents inminuit.py,cost.py,util.py,_deprecated.py,_optional_dependencies.py,_parse_version.py,_repr_html.py; unused typing imports removed (F401)minuit.py:method: str | Callable | None = None(ruff correctly surfaced a latent mypy issue)doc/conf.py
root_versionto match the submodule SHA (pre-commit hook was failing on a pre-existing mismatch)Test results
All tests pass on Python 3.10 except
tests/test_tabulate.py::test_paramswhich is a pre-existing failure on the develop branch (tabulate column-alignment difference unrelated to this PR).Note on conflicts
This PR modifies
minuit.py,cost.py, andutil.py(import blocks only, not logic). It may conflict slightly with parallel bugfix PRs touching those same files. Recommend merging this PR last among active PRs, or rebasing it on top of them once they land.