Skip to content

Drop support for --python-version 3.9#21243

Merged
JukkaL merged 7 commits intopython:masterfrom
hauntsaninja:py39
Apr 16, 2026
Merged

Drop support for --python-version 3.9#21243
JukkaL merged 7 commits intopython:masterfrom
hauntsaninja:py39

Conversation

@hauntsaninja
Copy link
Copy Markdown
Collaborator

@hauntsaninja hauntsaninja commented Apr 16, 2026

Resolves #20154

It's getting close to time. Typeshed will drop support in a few days.

Co-authored-by Codex

@github-actions

This comment has been minimized.

Comment thread docs/source/builtin_types.rst Outdated
Comment thread docs/source/builtin_types.rst Outdated
@github-actions
Copy link
Copy Markdown
Contributor

Diff from mypy_primer, showing the effect of this PR on open source code:

antidote (https://github.com/Finistere/antidote)
- pyproject.toml: [mypy]: python_version: Python 3.7 is not supported (must be 3.9 or higher)
+ pyproject.toml: [mypy]: python_version: Python 3.7 is not supported (must be 3.10 or higher)
- .../projects/_antidote_venv/lib/python3.14/site-packages/_pytest/terminal.py:1729: error: Pattern matching is only supported in Python 3.10 and greater  [syntax]
+ src/antidote/core/_wiring.py:15: error: "staticmethod" expects 2 type arguments, but 1 given  [type-arg]
+ src/antidote/core/_wiring.py:15: error: Missing type arguments for generic type "staticmethod"  [type-arg]
+ src/antidote/core/_wiring.py:15: error: "classmethod" expects 3 type arguments, but 1 given  [type-arg]
+ src/antidote/core/_wiring.py:15: error: Missing type arguments for generic type "classmethod"  [type-arg]
+ src/antidote/core/_injection.py:278: error: "staticmethod" expects 2 type arguments, but 1 given  [type-arg]
+ src/antidote/core/_injection.py:278: error: Missing type arguments for generic type "staticmethod"  [type-arg]
+ src/antidote/core/_injection.py:278: error: "classmethod" expects 3 type arguments, but 1 given  [type-arg]
+ src/antidote/core/_injection.py:278: error: Missing type arguments for generic type "classmethod"  [type-arg]
+ src/antidote/core/_inject.py:43: error: "staticmethod" expects 2 type arguments, but 1 given  [type-arg]
+ src/antidote/core/_inject.py:43: error: Missing type arguments for generic type "staticmethod"  [type-arg]
+ src/antidote/core/_inject.py:43: error: "classmethod" expects 3 type arguments, but 1 given  [type-arg]
+ src/antidote/core/_inject.py:43: error: Missing type arguments for generic type "classmethod"  [type-arg]
+ src/antidote/core/_inject.py:93: error: "staticmethod" expects 2 type arguments, but 1 given  [type-arg]
+ src/antidote/core/_inject.py:93: error: Missing type arguments for generic type "staticmethod"  [type-arg]
+ src/antidote/core/_inject.py:93: error: "classmethod" expects 3 type arguments, but 1 given  [type-arg]
+ src/antidote/core/_inject.py:93: error: Missing type arguments for generic type "classmethod"  [type-arg]
+ src/antidote/core/_inject.py:132: error: "staticmethod" expects 2 type arguments, but 1 given  [type-arg]
+ src/antidote/core/_inject.py:132: error: Missing type arguments for generic type "staticmethod"  [type-arg]
+ src/antidote/core/_inject.py:141: error: "staticmethod" expects 2 type arguments, but 1 given  [type-arg]
+ src/antidote/core/_inject.py:141: error: Missing type arguments for generic type "staticmethod"  [type-arg]
+ src/antidote/core/_inject.py:147: error: "classmethod" expects 3 type arguments, but 1 given  [type-arg]
+ src/antidote/core/_inject.py:147: error: Missing type arguments for generic type "classmethod"  [type-arg]
+ src/antidote/core/_inject.py:156: error: "classmethod" expects 3 type arguments, but 1 given  [type-arg]
+ src/antidote/core/_inject.py:156: error: Missing type arguments for generic type "classmethod"  [type-arg]
+ src/antidote/core/_inject.py:348: error: Expected iterable as variadic argument  [misc]
+ src/antidote/core/_inject.py:348: error: Argument after ** must be a mapping, not "dict[str, Any] | None"  [arg-type]
+ src/antidote/core/__init__.py:192: error: Overloaded function signatures 1 and 3 overlap with incompatible return types  [overload-overlap]
+ src/antidote/core/__init__.py:197: error: Overloaded function signatures 2 and 3 overlap with incompatible return types  [overload-overlap]
+ src/antidote/core/__init__.py:197: note: Flipping the order of overloads will fix this error
+ src/antidote/core/__init__.py:398: error: Overloaded function signatures 1 and 2 overlap with incompatible return types  [overload-overlap]
+ src/antidote/core/__init__.py:398: note: Flipping the order of overloads will fix this error
+ src/antidote/core/__init__.py:985: error: "staticmethod" expects 2 type arguments, but 1 given  [type-arg]
+ src/antidote/core/__init__.py:985: error: Missing type arguments for generic type "staticmethod"  [type-arg]
+ src/antidote/core/__init__.py:985: error: "classmethod" expects 3 type arguments, but 1 given  [type-arg]
+ src/antidote/core/__init__.py:985: error: Missing type arguments for generic type "classmethod"  [type-arg]
+ src/antidote/core/__init__.py:1033: error: "staticmethod" expects 2 type arguments, but 1 given  [type-arg]
+ src/antidote/core/__init__.py:1033: error: Missing type arguments for generic type "staticmethod"  [type-arg]
+ src/antidote/core/__init__.py:1042: error: "staticmethod" expects 2 type arguments, but 1 given  [type-arg]
+ src/antidote/core/__init__.py:1042: error: Missing type arguments for generic type "staticmethod"  [type-arg]
+ src/antidote/core/__init__.py:1048: error: "classmethod" expects 3 type arguments, but 1 given  [type-arg]
+ src/antidote/core/__init__.py:1048: error: Missing type arguments for generic type "classmethod"  [type-arg]
+ src/antidote/core/__init__.py:1057: error: "classmethod" expects 3 type arguments, but 1 given  [type-arg]
+ src/antidote/core/__init__.py:1057: error: Missing type arguments for generic type "classmethod"  [type-arg]
+ src/antidote/lib/lazy_ext/_lazy.py:104: error: "staticmethod" expects 2 type arguments, but 1 given  [type-arg]
+ src/antidote/lib/lazy_ext/_lazy.py:104: error: Missing type arguments for generic type "staticmethod"  [type-arg]
+ src/antidote/lib/lazy_ext/_lazy.py:110: error: "staticmethod" expects 2 type arguments, but 1 given  [type-arg]
+ src/antidote/lib/lazy_ext/_lazy.py:110: error: Missing type arguments for generic type "staticmethod"  [type-arg]
+ src/antidote/lib/lazy_ext/__init__.py:210: error: "staticmethod" expects 2 type arguments, but 1 given  [type-arg]
+ src/antidote/lib/lazy_ext/__init__.py:210: error: Missing type arguments for generic type "staticmethod"  [type-arg]
+ src/antidote/lib/lazy_ext/__init__.py:216: error: "staticmethod" expects 2 type arguments, but 1 given  [type-arg]
+ src/antidote/lib/lazy_ext/__init__.py:216: error: Missing type arguments for generic type "staticmethod"  [type-arg]
+ src/antidote/lib/lazy_ext/__init__.py:499: error: "staticmethod" expects 2 type arguments, but 1 given  [type-arg]
+ src/antidote/lib/lazy_ext/__init__.py:499: error: Missing type arguments for generic type "staticmethod"  [type-arg]
+ src/antidote/lib/lazy_ext/__init__.py:505: error: "staticmethod" expects 2 type arguments, but 1 given  [type-arg]
+ src/antidote/lib/lazy_ext/__init__.py:505: error: Missing type arguments for generic type "staticmethod"  [type-arg]
+ src/antidote/lib/lazy_ext/__init__.py:635: error: "staticmethod" expects 2 type arguments, but 1 given  [type-arg]
+ src/antidote/lib/lazy_ext/__init__.py:635: error: Missing type arguments for generic type "staticmethod"  [type-arg]
+ src/antidote/lib/interface_ext/_function.py:76: error: Unused "type: ignore" comment  [unused-ignore]
+ src/antidote/lib/interface_ext/_interface.py:78: error: Overloaded function signatures 1 and 2 overlap with incompatible return types  [overload-overlap]
+ src/antidote/lib/interface_ext/_interface.py:78: note: Flipping the order of overloads will fix this error
+ src/antidote/lib/interface_ext/_interface.py:118: error: Overloaded function signatures 1 and 2 overlap with incompatible return types  [overload-overlap]
+ src/antidote/lib/interface_ext/_interface.py:118: note: Flipping the order of overloads will fix this error
+ src/antidote/lib/interface_ext/_interface.py:257: error: "staticmethod" expects 2 type arguments, but 1 given  [type-arg]
+ src/antidote/lib/interface_ext/_interface.py:257: error: Missing type arguments for generic type "staticmethod"  [type-arg]
+ src/antidote/lib/interface_ext/__init__.py:357: error: Overloaded function signatures 1 and 2 overlap with incompatible return types  [overload-overlap]
+ src/antidote/lib/interface_ext/__init__.py:357: note: Flipping the order of overloads will fix this error
+ src/antidote/lib/interface_ext/__init__.py:396: error: Overloaded function signatures 1 and 2 overlap with incompatible return types  [overload-overlap]
+ src/antidote/lib/interface_ext/__init__.py:396: note: Flipping the order of overloads will fix this error
+ src/antidote/lib/interface_ext/__init__.py:576: error: "staticmethod" expects 2 type arguments, but 1 given  [type-arg]
+ src/antidote/lib/interface_ext/__init__.py:576: error: Missing type arguments for generic type "staticmethod"  [type-arg]
+ src/antidote/lib/interface_ext/__init__.py:1014: error: Missing return statement  [empty-body]
+ src/antidote/lib/interface_ext/__init__.py:1017: error: Missing return statement  [empty-body]
+ src/antidote/lib/interface_ext/__init__.py:1026: error: Missing return statement  [empty-body]
+ src/antidote/lib/interface_ext/__init__.py:1029: error: Missing return statement  [empty-body]
+ src/antidote/lib/interface_ext/__init__.py:1035: error: Missing return statement  [empty-body]
+ src/antidote/lib/interface_ext/__init__.py:1068: error: Missing return statement  [empty-body]
+ src/antidote/lib/interface_ext/__init__.py:1207: error: Overloaded function signatures 1 and 2 overlap with incompatible return types  [overload-overlap]
+ src/antidote/lib/interface_ext/__init__.py:1207: note: Flipping the order of overloads will fix this error
+ src/antidote/lib/interface_ext/__init__.py:1237: error: "classmethod" expects 3 type arguments, but 1 given  [type-arg]
+ src/antidote/lib/interface_ext/__init__.py:1237: error: Missing type arguments for generic type "classmethod"  [type-arg]
+ src/antidote/lib/interface_ext/__init__.py:1241: error: "staticmethod" expects 2 type arguments, but 1 given  [type-arg]
+ src/antidote/lib/interface_ext/__init__.py:1241: error: Missing type arguments for generic type "staticmethod"  [type-arg]
+ src/antidote/lib/interface_ext/__init__.py:1263: error: Missing return statement  [empty-body]
+ src/antidote/lib/interface_ext/__init__.py:1263: note: If the method is meant to be abstract, use @abc.abstractmethod
+ src/antidote/lib/interface_ext/__init__.py:1266: error: Missing return statement  [empty-body]
+ src/antidote/lib/interface_ext/__init__.py:1266: note: If the method is meant to be abstract, use @abc.abstractmethod
+ src/antidote/lib/interface_ext/__init__.py:1278: error: Missing return statement  [empty-body]
+ src/antidote/lib/interface_ext/__init__.py:1278: note: If the method is meant to be abstract, use @abc.abstractmethod
+ src/antidote/lib/interface_ext/__init__.py:1281: error: Missing return statement  [empty-body]
+ src/antidote/lib/interface_ext/__init__.py:1281: note: If the method is meant to be abstract, use @abc.abstractmethod
+ src/antidote/lib/interface_ext/__init__.py:1289: error: Overloaded function signatures 1 and 5 overlap with incompatible return types  [overload-overlap]
+ src/antidote/lib/interface_ext/__init__.py:1298: error: "staticmethod" expects 2 type arguments, but 1 given  [type-arg]
+ src/antidote/lib/interface_ext/__init__.py:1298: error: Missing type arguments for generic type "staticmethod"  [type-arg]
+ src/antidote/lib/interface_ext/__init__.py:1299: error: "staticmethod" expects 2 type arguments, but 1 given  [type-arg]
+ src/antidote/lib/interface_ext/__init__.py:1299: error: Missing type arguments for generic type "staticmethod"  [type-arg]
+ src/antidote/lib/interface_ext/__init__.py:1303: error: Overloaded function signature 4 will never be matched: signature 3's parameter type(s) are the same or broader  [overload-cannot-match]
+ src/antidote/lib/interface_ext/__init__.py:1303: error: "staticmethod" expects 2 type arguments, but 1 given  [type-arg]
+ src/antidote/lib/interface_ext/__init__.py:1303: error: Missing type arguments for generic type "staticmethod"  [type-arg]
+ src/antidote/lib/interface_ext/__init__.py:1321: error: Overloaded function signatures 1 and 5 overlap with incompatible return types  [overload-overlap]
+ src/antidote/lib/interface_ext/__init__.py:1330: error: "staticmethod" expects 2 type arguments, but 1 given  [type-arg]
+ src/antidote/lib/interface_ext/__init__.py:1330: error: Missing type arguments for generic type "staticmethod"  [type-arg]
+ src/antidote/lib/interface_ext/__init__.py:1331: error: "staticmethod" expects 2 type arguments, but 1 given  [type-arg]
+ src/antidote/lib/interface_ext/__init__.py:1331: error: Missing type arguments for generic type "staticmethod"  [type-arg]
+ src/antidote/lib/interface_ext/__init__.py:1335: error: Overloaded function signature 4 will never be matched: signature 3's parameter type(s) are the same or broader  [overload-cannot-match]
+ src/antidote/lib/interface_ext/__init__.py:1335: error: "staticmethod" expects 2 type arguments, but 1 given  [type-arg]
+ src/antidote/lib/interface_ext/__init__.py:1335: error: Missing type arguments for generic type "staticmethod"  [type-arg]
+ src/antidote/lib/interface_ext/__init__.py:1359: error: "staticmethod" expects 2 type arguments, but 1 given  [type-arg]
+ src/antidote/lib/interface_ext/__init__.py:1359: error: Missing type arguments for generic type "staticmethod"  [type-arg]
+ src/antidote/lib/interface_ext/__init__.py:1369: error: Missing return statement  [empty-body]
+ src/antidote/lib/interface_ext/__init__.py:1369: note: If the method is meant to be abstract, use @abc.abstractmethod
+ src/antidote/lib/interface_ext/__init__.py:1372: error: Missing return statement  [empty-body]
+ src/antidote/lib/interface_ext/__init__.py:1372: note: If the method is meant to be abstract, use @abc.abstractmethod
+ src/antidote/lib/interface_ext/__init__.py:1384: error: Missing return statement  [empty-body]
+ src/antidote/lib/interface_ext/__init__.py:1384: note: If the method is meant to be abstract, use @abc.abstractmethod
+ src/antidote/lib/interface_ext/__init__.py:1387: error: Missing return statement  [empty-body]
+ src/antidote/lib/interface_ext/__init__.py:1387: note: If the method is meant to be abstract, use @abc.abstractmethod
+ src/antidote/lib/interface_ext/_provider.py:312: error: Argument "weight" to "replace" of "CandidateImplementation[Weight]" has incompatible type "NewWeight"; expected "Weight"  [arg-type]
+ docs/conf.py:79: error: Function is missing a type annotation  [no-untyped-def]
+ docs/conf.py:177: error: Need type annotation for "latex_elements" (hint: "latex_elements: dict[<type>, <type>] = ...")  [var-annotated]
+ docs/conf.py:223: error: Function is missing a type annotation  [no-untyped-def]
+ tests/lib/lazy/test_lazy.py:286: error: Missing return statement  [empty-body]
+ tests/lib/lazy/test_lazy.py:293: error: Missing return statement  [empty-body]
+ tests/lib/lazy/test_lazy.py:301: error: Missing return statement  [empty-body]
+ tests/lib/lazy/test_lazy.py:308: error: Missing return statement  [empty-body]
+ tests/lib/lazy/test_lazy.py:316: error: Missing return statement  [empty-body]
+ tests/lib/lazy/test_lazy.py:324: error: Missing return statement  [empty-body]
+ tests/lib/lazy/test_lazy.py:658: error: Missing return statement  [empty-body]
+ tests/lib/lazy/test_lazy.py:662: error: Missing return statement  [empty-body]
+ tests/lib/lazy/test_lazy.py:668: error: Missing return statement  [empty-body]
+ tests/lib/lazy/test_lazy.py:672: error: Missing return statement  [empty-body]
+ tests/lib/lazy/test_lazy.py:677: error: Missing return statement  [empty-body]
+ tests/lib/lazy/test_lazy.py:682: error: Missing return statement  [empty-body]
+ tests/lib/lazy/test_lazy.py:845: error: Missing return statement  [empty-body]
+ tests/lib/lazy/test_lazy.py:849: error: Missing return statement  [empty-body]
+ tests/lib/lazy/test_lazy.py:855: error: Missing return statement  [empty-body]
+ tests/lib/lazy/test_lazy.py:859: error: Missing return statement  [empty-body]
+ tests/lib/lazy/test_lazy.py:864: error: Missing return statement  [empty-body]
+ tests/lib/lazy/test_lazy.py:869: error: Missing return statement  [empty-body]
+ tests/lib/interface/test_lazy.py:33: error: Missing return statement  [empty-body]
+ tests/lib/interface/test_lazy.py:142: error: Missing return statement  [empty-body]
+ tests/lib/interface/test_lazy.py:161: error: Missing return statement  [empty-body]
+ tests/lib/interface/test_lazy.py:184: error: Missing return statement  [empty-body]
+ tests/lib/interface/test_lazy.py:205: error: Missing return statement  [empty-body]
+ tests/lib/interface/test_lazy.py:253: error: Missing return statement  [empty-body]
+ tests/lib/interface/test_lazy.py:435: error: Missing return statement  [empty-body]
+ tests/lib/interface/test_lazy.py:441: error: Missing return statement  [empty-body]

... (truncated 94 lines) ...

PyWinCtl (https://github.com/Kalmat/PyWinCtl)
- setup.cfg: [mypy]: python_version: Python 3.8 is not supported (must be 3.9 or higher)
+ setup.cfg: [mypy]: python_version: Python 3.8 is not supported (must be 3.10 or higher)

pywin32 (https://github.com/mhammond/pywin32)
+ mypy.ini: [mypy]: python_version: Python 3.9 is not supported (must be 3.10 or higher)

pybind11 (https://github.com/pybind/pybind11)
- pyproject.toml: [mypy]: python_version: Python 3.8 is not supported (must be 3.9 or higher)
+ pyproject.toml: [mypy]: python_version: Python 3.8 is not supported (must be 3.10 or higher)

build (https://github.com/pypa/build)
+ pyproject.toml: [mypy]: python_version: Python 3.9 is not supported (must be 3.10 or higher)

manticore (https://github.com/trailofbits/manticore)
- mypy.ini: [mypy]: python_version: Python 3.7 is not supported (must be 3.9 or higher)
+ mypy.ini: [mypy]: python_version: Python 3.7 is not supported (must be 3.10 or higher)

PyGithub (https://github.com/PyGithub/PyGithub)
+ pyproject.toml: [mypy]: python_version: Python 3.9 is not supported (must be 3.10 or higher)

mkosi (https://github.com/systemd/mkosi)
+ pyproject.toml: [mypy]: python_version: Python 3.9 is not supported (must be 3.10 or higher). You may need to put quotes around your Python version

com2ann (https://github.com/ilevkivskyi/com2ann)
+ usage: mypy [-h] [-v] [-V] [more options; see below]
+             [-m MODULE] [-p PACKAGE] [-c PROGRAM_TEXT] [files ...]
+ mypy: error: argument --python-version: Python 3.9 is not supported (must be 3.10 or higher)

packaging (https://github.com/pypa/packaging)
- pyproject.toml: [mypy]: python_version: Python 3.8 is not supported (must be 3.9 or higher)
+ pyproject.toml: [mypy]: python_version: Python 3.8 is not supported (must be 3.10 or higher)

git-revise (https://github.com/mystor/git-revise)
- mypy.ini: [mypy]: python_version: Python 3.8 is not supported (must be 3.9 or higher)
+ mypy.ini: [mypy]: python_version: Python 3.8 is not supported (must be 3.10 or higher)

scikit-build-core (https://github.com/scikit-build/scikit-build-core)
- .../projects/_scikit-build-core_venv/lib/python3.14/site-packages/_pytest/terminal.py:1729: error: Pattern matching is only supported in Python 3.10 and greater  [syntax]
+ pyproject.toml: [mypy]: python_version: Python 3.9 is not supported (must be 3.10 or higher)
+ tests/test_pyproject_pep517.py:374: error: "PackageMetadata" has no attribute "get"  [attr-defined]

dragonchain (https://github.com/dragonchain/dragonchain)
- mypy.ini: [mypy]: python_version: Python 3.8 is not supported (must be 3.9 or higher)
+ mypy.ini: [mypy]: python_version: Python 3.8 is not supported (must be 3.10 or higher)

nox (https://github.com/wntrblm/nox)
+ pyproject.toml: [mypy]: python_version: Python 3.9 is not supported (must be 3.10 or higher)
+ nox/_option_set.py:50: error: Only concrete class can be given where "type[PathLike[Any]]" is expected  [type-abstract]

@JukkaL
Copy link
Copy Markdown
Collaborator

JukkaL commented Apr 16, 2026

Are the new errors in antidote expected?

@JelleZijlstra
Copy link
Copy Markdown
Member

It seems we previously had a blocking error (because some dependency used pattern matching which is new in 3.10). Now that we only support 3.10+ mypy actually typechecks the package.

@JukkaL
Copy link
Copy Markdown
Collaborator

JukkaL commented Apr 16, 2026

Ok, all is fine then!

@JukkaL JukkaL merged commit f551cb4 into python:master Apr 16, 2026
25 checks passed
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.

Drop support for Python 3.9

3 participants