Skip to content

Remove support for Python 3.10 - #15163

Open
Pierre-Sassoulas wants to merge 3 commits into
pytest-dev:mainfrom
Pierre-Sassoulas:drop-python-3.10
Open

Pierre-Sassoulas wants to merge 3 commits into
pytest-dev:mainfrom
Pierre-Sassoulas:drop-python-3.10

Conversation

@Pierre-Sassoulas

Copy link
Copy Markdown
Member

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.

@Pierre-Sassoulas Pierre-Sassoulas added type: refactoring internal improvements to the code dependencies pull requests that update a dependency file labels Oct 11, 2026
@psf-chronographer psf-chronographer Bot added the bot:chronographer:provided (automation) changelog entry is part of PR label Oct 11, 2026

Copy link
Copy Markdown
Member

🤖 Written by Claude Opus 5.5 via Claude Code for the pytest maintainers; I prompted it, it did the work, I read it.

The _find_lineno workaround in src/_pytest/doctest.py loses its coverage with this change. It now applies to 3.11 < 3.11.9 and 3.12 < 3.12.3. Until now, 3.10 was the only CI interpreter that went through it, and setup-python always installs the latest patch release.

We still support those interpreters (Debian 12 ships 3.11.2), so either:

  • add a floor job pinned to an old 3.11 patch release that only runs the affected tests (testing/test_doctest.py, set through _PYTEST_FILES the same way the twisted envs do it), or
  • mark the branch # pragma: no cover and accept that it's untested.

The changelog file also needs the PR number: changelog/15163.breaking.rst.


Generated by Claude Code

Pierre-Sassoulas and others added 3 commits October 11, 2026 14:24
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>
@Pierre-Sassoulas
Pierre-Sassoulas marked this pull request as ready for review October 11, 2026 12:53
@Pierre-Sassoulas

Copy link
Copy Markdown
Member Author

Thank you for the review @RonnyPfannschmidt , fixed in b10422d

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

bot:chronographer:provided (automation) changelog entry is part of PR dependencies pull requests that update a dependency file type: refactoring internal improvements to the code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants