Skip to content

Remove Python 3.10 compatibility shims - #74153

Open
shahar1 wants to merge 1 commit into
drop-py310/2-script-metadatafrom
drop-py310/3-compat-shims
Open

shahar1 wants to merge 1 commit into
drop-py310/2-script-metadatafrom
drop-py310/3-compat-shims

Conversation

@shahar1

@shahar1 shahar1 commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

My favorite PR in the series so far - this PR removes all 3.10 compatibility shims.

related: #74148

AI Summary CI no longer runs Python 3.10 (layer 1) and the prek hooks run on 3.11 (layer 2), so these shims have no version left to serve:
  • tomli fallbacks replaced by plain tomllib imports in breeze and the docs build. The same change in the prek scripts, dev/registry and docker-tests is deferred to layer 7: tomllib only sorts as a stdlib import once their pyproject.toml says 3.11, so doing it here would trip isort (I001).
  • typing_extensions imports of Self, Unpack, assert_never in typing_compat, shared/dagnode and shared/observability replaced by typing.
  • Task SDK BaseOperator.event_loop() uses asyncio.Runner directly; the 3.10 re-implementation and its _cancel_all_tasks helper are removed, and the test fixture that exercised the fallback goes with them.
  • sys.version_info < (3, 11) test skips removed; comments that explained 3.10-specific isinstance(list[X], type) behaviour rewritten.

Stack

Layer 3 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/3-compat-shims branch from 8b364cb to af79df4 Compare October 3, 2026 15:00
CI no longer runs Python 3.10, so the tomli fallbacks for tomllib, the
typing_extensions imports of Self, Unpack and assert_never, the
re-implementation of asyncio.Runner in the Task SDK and the version
gated test skips no longer have a version to serve.
@shahar1
shahar1 force-pushed the drop-py310/3-compat-shims branch from af79df4 to 48ba311 Compare October 3, 2026 20:05

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

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

1 participant