Skip to content

Require Python 3.11 in all distributions - #74157

Open
shahar1 wants to merge 2 commits into
drop-py310/6-ruff-dev-scriptsfrom
drop-py310/7-pyproject-metadata
Open

shahar1 wants to merge 2 commits into
drop-py310/6-ruff-dev-scriptsfrom
drop-py310/7-pyproject-metadata

Conversation

@shahar1

@shahar1 shahar1 commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

As titled - this PR require Python 3.11 in all distributions.

related: #74148

AI Summary Every `pyproject.toml` (core, Task SDK, airflowctl, all providers, `shared/*`, dev and test distributions) now declares `requires-python = ">=3.11"`, drops the `Programming Language :: Python :: 3.10` classifier, the `tomli` build requirement that only 3.10 needed, and the 3.10-only dependency markers (`numpy`, `jpype1`). Lock files regenerated; the remaining `tomli` fallbacks in prek scripts, `dev/registry` and `docker-tests` become plain `tomllib` imports here (their isort placement depends on the py311 target); provider README/index requirement tables synced by `sync-provider-readme`; `tomli` dropped from prek hook `additional_dependencies`; `blacken-docs` and breeze `black` targets move to py311+.

With requires-python at 3.11 ruff infers the py311 target, which enables the PEP 646 fix applied here (Unpack[tuple[...]] → *tuple[...], UP044, 4 sites) and makes two rules reportable that are added to the ignore list with a rationale:

  • UP042 (str, Enum → StrEnum, 86 sites): changes what str()/format() return for serialized enum values.
  • ASYNC109 (async function with timeout parameter, 48 sites): the fix is dropping a public parameter in favour of asyncio.timeout.

Both need per-site judgement and are left for follow-ups.

Stack

Layer 7 of 9 of the Python 3.10 drop (supersedes #74144, which carried the whole change in one PR). Each layer is meant to be green on its own: the script metadata bump comes first because prek picks the hook interpreter from it, and the ruff fixes land before the requires-python bump because ruff infers its target per distribution from the nearest pyproject.toml.

  1. Drop Python 3.10 from CI, Breeze and the container images
  2. Bump inline script metadata to Python 3.11
  3. Remove Python 3.10 compatibility shims
  4. Apply ruff Python 3.11 fixes to core, Task SDK, shared and airflowctl
  5. Apply ruff Python 3.11 fixes to providers
  6. Apply ruff Python 3.11 fixes to dev tooling, scripts and test suites
  7. Require Python 3.11 in all distributions
  8. Update provider READMEs for the Python 3.11 baseline
  9. Update docs for the Python 3.11 baseline

Was generative AI tooling used to co-author this PR?
  • Yes — Claude Code (Fable 5.1)

Generated-by: Claude Code (Fable 5.1) following the guidelines

@shahar1
shahar1 force-pushed the drop-py310/7-pyproject-metadata branch from c4d62ba to 55366f7 Compare October 3, 2026 13:07
@shahar1
shahar1 added this pull request to stack #74160 October 3, 2026 13:08
@shahar1 shahar1 added full tests needed We need to run full set of tests for this PR to merge all versions If set, the CI build will be forced to use all versions of Python/K8S/DBs skip common compat check Skips common compat provider modification check labels Oct 3, 2026
@shahar1 shahar1 mentioned this pull request Oct 3, 2026
1 task done
@shahar1
shahar1 force-pushed the drop-py310/7-pyproject-metadata branch from 55366f7 to 63abf3f Compare October 3, 2026 13:38
@shahar1
shahar1 marked this pull request as ready for review October 3, 2026 13:57
@shahar1
shahar1 force-pushed the drop-py310/7-pyproject-metadata branch 2 times, most recently from b0e2669 to 5739fe2 Compare October 3, 2026 20:05

@jscheffl jscheffl left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good if CI get's green. Checked code and looks proper.

@shahar1
shahar1 force-pushed the drop-py310/7-pyproject-metadata branch from 5739fe2 to fa9a352 Compare October 4, 2026 17:53
@shahar1 shahar1 added the ready for maintainer review Set after triaging when all criteria pass. label Oct 4, 2026
@shahar1
shahar1 force-pushed the drop-py310/7-pyproject-metadata branch from fa9a352 to 5ac643e Compare October 4, 2026 18:57
Every pyproject.toml now declares requires-python >= 3.11 and drops
the Python 3.10 trove classifier, the tomli build requirement that
only existed for 3.10 and the per-version dependency markers for
3.10. Lock files are regenerated.

ruff infers py311 from the new requires-python, which enables the
PEP 646 star-index fix (UP044) applied here and makes two more rules
reportable: UP042 (str, Enum to StrEnum) alters what str() and
format() return for serialized enum values, and ASYNC109 means
dropping the public timeout parameter from async APIs. Both need
per-site judgement, so they go on the ignore list with that rationale.
With provider distributions now requiring Python 3.11, breeze can derive
requires-python and classifiers from the default and allowed versions
again. The datamodel-codegen target bump to 3.11 emits StrEnum, so the
Task SDK and airflowctl generated models are refreshed to match.
@potiuk
potiuk force-pushed the drop-py310/7-pyproject-metadata branch from 5ac643e to 35412c0 Compare October 4, 2026 23:43

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

all versions If set, the CI build will be forced to use all versions of Python/K8S/DBs full tests needed We need to run full set of tests for this PR to merge ready for maintainer review Set after triaging when all criteria pass. skip common compat check Skips common compat provider modification check

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants