Repository navigation
packaging: Update min Python version to 3.11 - #7684
Merged
Merged
Conversation
Python 3.10 receives security fixes only and reaches end of life in October 2026, before the next release. Per RFC 8, raise the minimum supported Python version from 3.10 to 3.11. Update the version in REQUIREMENTS.md, pyproject.toml (requires-python, Black, Pylint, Pyright, and isort) and CI (pytest matrix and MIN_PYTHON_VERSION). Update places in code which add code for the older version: - utils/mkdocs.py: datetime.fromisoformat parses the Z suffix used by recent Git natively since 3.11, so the fallback is no longer needed. - Use the datetime.UTC alias added in 3.11. Ruff enables this check (UP017) once it infers the higher target version from requires-python. - Drop the toml extra for bandit. It provided a TOML parser for reading the bandit configuration from pyproject.toml, which the standard library covers since 3.11 with tomllib. Here the deciding version is the one the workflow runs, which is well past 3.11 already.
wenzeslaus
enabled auto-merge (squash)
July 13, 2026 14:08
echoix
approved these changes
Jul 13, 2026
echoix
left a comment
Member
There was a problem hiding this comment.
I also searched for other instances that could be missed, and didn't find anything else
Member
|
Once we change the required checks to match 3.11, we’ll have to update the other PRs to allow to work (since we have specified the list of jobs that are required this morning for the duration of the sprint). |
Member
|
Should be fine now, but automerge didn't trigger yet after the change |
Member
|
I don’t want to disable automerge without knowing what the prepared message was |
echoix
pushed a commit
to wenzeslaus/grass
that referenced
this pull request
Jul 14, 2026
Python 3.10 receives security fixes only and reaches end of life in October 2026, before the next release. Per RFC 8, raise the minimum supported Python version from 3.10 to 3.11. Update the version in REQUIREMENTS.md, pyproject.toml (requires-python, Black, Pylint, Pyright, and isort) and CI (pytest matrix and MIN_PYTHON_VERSION). Update places in code which add code for the older version: - utils/mkdocs.py: datetime.fromisoformat parses the Z suffix used by recent Git natively since 3.11, so the fallback is no longer needed. - Use the datetime.UTC alias added in 3.11. Ruff enables this check (UP017) once it infers the higher target version from requires-python. - Drop the toml extra for bandit. It provided a TOML parser for reading the bandit configuration from pyproject.toml, which the standard library covers since 3.11 with tomllib. Here the deciding version is the one the workflow runs, which is well past 3.11 already.
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.
Raises the minimum supported Python version from 3.10 to 3.11.
Python 3.10 receives security fixes only and reaches end of life in October 2026, so assuming the next release happens around that it makes sense to raise the min Python version now which is aligned with our RFC 8 which allows raising the minimum when the current minimum reaches end of life.
Version declarations updated
REQUIREMENTS.mdpyproject.toml:requires-python, and the Black, Pylint, Pyright, and isort settings kept in sync with itMIN_PYTHON_VERSIONin the Python code quality workflowCode which supported the older version
utils/mkdocs.py:datetime.fromisoformatparses theZsuffix used by recent Git natively since 3.11, so the fallback which strippedZand appended+00:00is no longer needed.lib/init/grass.pyandgrass.script.setup: use thedatetime.UTCalias added in 3.11. Ruff enables this check (UP017) once it infers the higher target version fromrequires-python.datetime.UTCis an alias ofdatetime.timezone.utc, so the behavior is unchanged.tomlextra for bandit. It provided a TOML parser for reading the bandit configuration frompyproject.toml, which the standard library covers since 3.11 withtomllib. Note that the deciding version here is the one the workflow runs (PYTHON_VERSION, now 3.14), not the minimum supported one, so this was already unnecessary before this change. (Assuming the CI will pass.)Follow-up in grass-addons
RFC 8 asks for the matching branch in grass-addons to be updated at the same time. Its CI already runs Python 3.11 only, so it is in line with this change, but
pyproject.tomlon the grass8 branch still declaresrequires-python = ">=3.8"and a matching Blacktarget-versionlist. These seem to be stale, but at the same time, grass-addons grass8 branch supports also current and possibly even older releases, so we can't just bump the versions up as RFC suggests. We may need to revisit that.AI (Claude Code) was used to find the places to update and to prepare this change.