mirror of
https://github.com/apache/airflow.git
synced 2026-11-04 07:12:48 +00:00
Require Python 3.11 in all distributions (#74157)
* Require Python 3.11 in all distributions Every pyproject.toml that declares requires-python now says >= 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. With 3.10 gone, the tomli fallbacks in scripts, dev tooling and tests go too, along with the tomli additional_dependencies of the prek hooks and the blacken-docs py310 target. The tomllib imports that only sat inside functions because of the fallback move to the top of their modules. The four dev/registry and scripts/ci/prek modules left out of the earlier UP017 pass also take their timezone.utc to datetime.UTC fixes here. The minimum host Python checked by check-min-python-version, the default Python of run_generate_constraints.py and the provider cut-off date parsing (fromisoformat, which reads a trailing Z from 3.11) follow the new baseline. 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. The datamodel-codegen target moves to 3.11 too, with use-specialized-enum turned off for the same reason: otherwise the generated Task SDK and airflowctl enums would switch from (str, Enum) to StrEnum. * Drop the Python 3.10 provider metadata shim With provider distributions now requiring Python 3.11, breeze can derive requires-python and classifiers from the default and allowed versions again. The patch-exclusion test and the matching example in MANAGING_PROVIDERS_LIFECYCLE.rst move from 3.10.0 to 3.11.0, the oldest patch release CI still covers. * Keep Breeze's locked dependency versions when dropping Python 3.10 Relocking Breeze for the Python 3.11 baseline ran while recently bumped versions were still inside the 4-day exclude-newer window, so it downgraded pyjwt (reverting #73969), prek, boto3/botocore and filelock. Relocking from the previous lock keeps them and only drops the packages Python 3.11 no longer needs. Generated-by: Claude Opus 5 --------- Co-authored-by: Jarek Potiuk <jarek@potiuk.com>
This commit is contained in:
1 parent
dafc96e67c
commit
3e0ed979c1
178 files changed
+363
-2710
No files matched your search
@@ -22,7 +22,6 @@ requires = [
|
||||
"packaging==26.3",
|
||||
"pathspec==1.1.1",
|
||||
"pluggy==1.6.0",
|
||||
"tomli==2.4.1; python_version < '3.11'",
|
||||
"tomlkit==0.15.1",
|
||||
"trove-classifiers==2026.9.21.13",
|
||||
]
|
||||
@@ -34,7 +33,7 @@ description = "Docker tests for Apache Airflow"
|
||||
classifiers = [
|
||||
"Private :: Do Not Upload",
|
||||
]
|
||||
requires-python = ">=3.10,!=3.15"
|
||||
requires-python = ">=3.11,!=3.15"
|
||||
authors = [
|
||||
{ name = "Apache Software Foundation", email = "dev@airflow.apache.org" },
|
||||
]
|
||||
|
||||
@@ -19,6 +19,7 @@ from __future__ import annotations
|
||||
import json
|
||||
import os
|
||||
from importlib.util import find_spec
|
||||
from tomllib import loads as load_tomllib
|
||||
|
||||
import pytest
|
||||
import yaml
|
||||
@@ -36,11 +37,6 @@ from docker_tests.docker_utils import (
|
||||
PROD_IMAGE_PROVIDERS_FILE_PATH = AIRFLOW_ROOT_PATH / "prod_image_installed_providers.txt"
|
||||
AIRFLOW_CORE_PYPROJECT_TOML = AIRFLOW_ROOT_PATH / "airflow-core" / "pyproject.toml"
|
||||
|
||||
try:
|
||||
from tomllib import loads as load_tomllib
|
||||
except ImportError:
|
||||
from tomli import loads as load_tomllib # type: ignore[no-redef]
|
||||
|
||||
airflow_core_pyproject_toml = load_tomllib(AIRFLOW_CORE_PYPROJECT_TOML.read_text())
|
||||
|
||||
SLIM_IMAGE_PROVIDERS = []
|
||||
|
||||
Reference in new issue
Block a user