Repository navigation
Remove support for Python 3.10 - #15163
Pierre-Sassoulas wants to merge 8 commits into
Conversation
afb4878 to
196c757
Compare
|
🤖 Written by Claude Opus 5.5 via Claude Code for the pytest maintainers; I prompted it, it did the work, I read it. The We still support those interpreters (Debian 12 ships 3.11.2), so either:
The changelog file also needs the PR number: Generated by Claude Code |
5558706 to
b10422d
Compare
|
Thank you for the review @RonnyPfannschmidt , fixed in b10422d |
|
I'm preparing to release pytest 9.2 (I think I'll open an issue for it now). I think we might as well leave 3.10 support for this release and drop it in 10.0. (To be clear, our policy allows dropping old Python support in minor releases, just thinking since we've done the work for this release, might as well keep it). Let me know if you think differently. |
| @@ -11,7 +11,7 @@ | |||
|
|
|||
|
|
|||
| if TYPE_CHECKING: | |||
There was a problem hiding this comment.
Probably we can drop the TYPE_CHECKING now.
| [tool.black] | ||
| # See https://black.readthedocs.io/en/stable/usage_and_configuration/the_basics.html#t-target-version | ||
| target-version = [ "py310", "py311", "py312", "py313" ] | ||
| target-version = [ "py311", "py312", "py313" ] |
There was a problem hiding this comment.
BTW, seems like this is missing py314. Or, given that the link says black supports deriving this info from project.requires-python, maybe can just drop it?
|
|
||
| [tool.ruff] | ||
| target-version = "py310" | ||
| target-version = "py311" |
There was a problem hiding this comment.
BTW2, Ruff also says it considers project.requires-python for this https://docs.astral.sh/ruff/settings/#target-version, so should be possible to just drop this line as well.
| from datetime import timezone | ||
|
|
||
| tz = timezone.utc | ||
| tz = UTC |
There was a problem hiding this comment.
Personally I prefer datetime.UTC when datetime import is already available. A bit clearer.
There was a problem hiding this comment.
Can't do it because there's a from datetime import datetime so it'd require a prior refactor.
| @@ -41,7 +41,7 @@ | |||
|
|
|||
|
|
|||
| if TYPE_CHECKING: | |||
| @@ -16,7 +16,7 @@ | |||
|
|
|||
|
|
|||
| if TYPE_CHECKING: | |||
|
BTW, I remembered this Python 3.11 changelog
I think we have a lot of cases in of the old pattern ( |
Python 3.10 reached end of life in October 2026. Drop the exceptiongroup, tomli and asynctest dependencies and the version-conditional code paths that existed only for it. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
importlib.resources.abc exists since Python 3.11, so the version check was only needed for 3.10. Also refresh a docstring that still mentioned Python 3.10. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
With Python 3.10 gone, the latest patch releases that setup-python installs never hit the workaround for python/cpython#61648, which was fixed in 3.11.9 and 3.12.3. Add a `floor` tox factor that runs only testing/test_doctest.py, and a CI job using it on 3.11.2, the version Debian 12 ships. Also name the changelog fragment after the pull request. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Both are available in typing since Python 3.11, so the TYPE_CHECKING blocks that only existed for them are no longer needed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Both tools derive their target version from ``project.requires-python`` when it is not configured, so the explicit lists only had to be kept in sync by hand. Black is only run through blacken-docs, which does not read ``[tool.black]`` at all, so the section had no effect. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Matches the local imports of the other datetime tests in the class. ``datetime.UTC`` cannot be used there because the local ``from datetime import datetime`` shadows the module. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Since Python 3.11, ``warnings.catch_warnings()`` accepts the arguments of ``warnings.simplefilter()``, so the ``with catch_warnings():`` followed by ``simplefilter()`` pattern can be written in one line, in the docs as well as in the code and tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Did the warning refactor in 32422f4 |
|
The coverage fail comes from the |
32422f4 to
21a7a51
Compare
Python 3.10 reached end of life in October 2026. Drop the exceptiongroup, tomli and asynctest dependencies and the version-conditional code paths that existed only for it.