Skip to content

packaging: Update min Python version to 3.11 - #7684

Merged
wenzeslaus merged 2 commits into
OSGeo:mainfrom
wenzeslaus:python-3.11-minimum
Jul 13, 2026
Merged

wenzeslaus merged 2 commits into
OSGeo:mainfrom
wenzeslaus:python-3.11-minimum

Conversation

@wenzeslaus

@wenzeslaus wenzeslaus commented Jul 13, 2026 •

Copy link
Copy Markdown
Member

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.md
  • pyproject.toml: requires-python, and the Black, Pylint, Pyright, and isort settings kept in sync with it
  • CI: the pytest matrix and MIN_PYTHON_VERSION in the Python code quality workflow

Code which supported the older version

  • utils/mkdocs.py: datetime.fromisoformat parses the Z suffix used by recent Git natively since 3.11, so the fallback which stripped Z and appended +00:00 is no longer needed.
  • lib/init/grass.py and grass.script.setup: use the datetime.UTC alias added in 3.11. Ruff enables this check (UP017) once it infers the higher target version from requires-python. datetime.UTC is an alias of datetime.timezone.utc, so the behavior is unchanged.
  • Python code quality workflow: 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. 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.toml on the grass8 branch still declares requires-python = ">=3.8" and a matching Black target-version list. 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.

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
wenzeslaus requested a review from echoix July 13, 2026 14:08
@wenzeslaus
wenzeslaus enabled auto-merge (squash) July 13, 2026 14:08

@echoix echoix left a comment

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.

I also searched for other instances that could be missed, and didn't find anything else

@github-actions github-actions Bot added CI Continuous integration Python Related code is in Python libraries docs markdown Related to markdown, markdown files labels Jul 13, 2026
@echoix

echoix commented Jul 13, 2026

Copy link
Copy Markdown
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).

@echoix

echoix commented Jul 13, 2026

Copy link
Copy Markdown
Member

Should be fine now, but automerge didn't trigger yet after the change

@echoix

echoix commented Jul 13, 2026

Copy link
Copy Markdown
Member

I don’t want to disable automerge without knowing what the prepared message was

@wenzeslaus
wenzeslaus merged commit 425d460 into OSGeo:main Jul 13, 2026
25 checks passed
@wenzeslaus
wenzeslaus deleted the python-3.11-minimum branch July 13, 2026 23:32
@github-actions github-actions Bot added this to the 8.6.0 milestone Jul 13, 2026
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI Continuous integration docs libraries markdown Related to markdown, markdown files Python Related code is in Python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants