Skip to content

Remove support for Python 3.9#13724

Merged
bluetech merged 1 commit intopytest-dev:mainfrom
bluetech:rm-py39
Sep 14, 2025
Merged

Remove support for Python 3.9#13724
bluetech merged 1 commit intopytest-dev:mainfrom
bluetech:rm-py39

Conversation

@bluetech
Copy link
Copy Markdown
Member

It will be end-of-life (or on its last breaths) by the time of the next release.

I tried to cover everything, but might have missed something.

The biggest annoyance is the lint which forces explicit strict on zip calls. I was tempted to add the lint to ignores, but it's actually a good lint so I audited all zip calls, hopefully I got it right. It did bring up #13723.

Refs #13719

@psf-chronographer psf-chronographer Bot added the bot:chronographer:provided (automation) changelog entry is part of PR label Sep 12, 2025
Copy link
Copy Markdown
Member

@Pierre-Sassoulas Pierre-Sassoulas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love the new strict=True ! I reviewed the diff, might take a look at what might be missing later. Adding match cases should be done in another MR, right ?

Comment thread doc/en/index.rst Outdated
Comment thread src/_pytest/config/findpaths.py
Comment thread testing/python/metafunc.py
@bluetech
Copy link
Copy Markdown
Member Author

Some fixes for CI failures:

  • pylib doesn't like PYTHONWARNDEFAULTENCODING=1, changed the tox.ini to avoid it for pylib. This only worked because the CI job ran on py3.9 which I guess didn't have the warning.

  • Changed the TerminalWriter zip strict to False, as it failed in (some!) CI jobs. Probably related to highlighting. Pretty suspicious but I couldn't reproduce locally (though didn't try too hard), so for now keeping the existing behavior, but added a comment.

Copy link
Copy Markdown
Member

@nicoddemus nicoddemus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @bluetech!

Comment thread doc/en/getting-started.rst Outdated
Comment thread doc/en/index.rst
- Can run :ref:`unittest <unittest>` (including trial) test suites out of the box

- Python 3.8+ or PyPy 3
- Python 3.10+ or PyPy 3
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one was not removed ?

Comment thread CONTRIBUTING.rst
Comment thread CONTRIBUTING.rst Outdated
Comment thread CONTRIBUTING.rst Outdated
Comment thread CONTRIBUTING.rst Outdated
Comment thread CONTRIBUTING.rst Outdated
Comment thread CONTRIBUTING.rst Outdated
Comment thread CONTRIBUTING.rst Outdated
Comment thread README.rst
It will be end-of-life (or on its last breaths) by the time of the next
release.

Refs pytest-dev#13719
@bluetech
Copy link
Copy Markdown
Member Author

  • Removed a no longer needed Pypy special case in a test which caused pypy CI (updated 3.9 -> 3.10) to fail

  • Adopted @nicoddemus's suggestions, except I kept the README -- I think it's helpful there -- and also a couple in the CONTRIBUTING because I think it's explicitly trying to explain how to run on a specific pyython version.

@Pierre-Sassoulas

Adding match cases should be done in another MR, right ?

Yes, if there are places that can be improved with match/case we can do it separately.

@Pierre-Sassoulas
Copy link
Copy Markdown
Member

Opened #13727 for match cases as a follow-up

@bluetech
Copy link
Copy Markdown
Member Author

I'll merge this so we can start depending on Python 3.10.

@bluetech bluetech merged commit 0c765c3 into pytest-dev:main Sep 14, 2025
32 of 33 checks passed
@bluetech bluetech deleted the rm-py39 branch September 14, 2025 16:49
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants