Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

breeze python 3.12 support #36748

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions airflow/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
PY39 = sys.version_info >= (3, 9)
PY310 = sys.version_info >= (3, 10)
PY311 = sys.version_info >= (3, 11)
PY312 = sys.version_info >= (3, 12)

# Things to lazy import in form {local_name: ('target_module', 'target_name', 'deprecated')}
__lazy_imports: dict[str, tuple[str, str, bool]] = {
Expand Down
2 changes: 1 addition & 1 deletion dev/README_RELEASE_AIRFLOW.md
Original file line number Diff line number Diff line change
Expand Up @@ -872,7 +872,7 @@ the older branches, you should set the "skip" field to true.
## Verify production images

```shell script
for PYTHON in 3.8 3.9 3.10 3.11
for PYTHON in 3.8 3.9 3.10 3.11 3.12
do
docker pull apache/airflow:${VERSION}-python${PYTHON}
breeze prod-image verify --image-name apache/airflow:${VERSION}-python${PYTHON}
Expand Down
2 changes: 1 addition & 1 deletion dev/breeze/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,6 @@ PLEASE DO NOT MODIFY THE HASH BELOW! IT IS AUTOMATICALLY UPDATED BY PRE-COMMIT.

---------------------------------------------------------------------------------------------------------

Package config hash: 5253de328868bc7e725254e1efe2daa57e7b1faee1b0be68aa8609569e47d08a1e0be4760bf889f422c4ce5c2884577c1300cd2f2292f2cb4677b1d1d160916c
Package config hash: c139c08b4272b97467c4a3d079237d69c1e4c489955a4a2e819ed7243fd6dcdd07f541f7c8d6c80594047446d3ede455191f6d9fc47904d77ddf17dab0aa70f8

---------------------------------------------------------------------------------------------------------
2 changes: 1 addition & 1 deletion dev/breeze/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ name = "airflow_breeze"

[tool.black]
line-length = 110
target-version = ['py37', 'py38', 'py39', 'py310']
target-version = ['py37', 'py38', 'py39', 'py310', 'py311', 'py312']

[tool.pytest.ini_options]
addopts = "-rasl --verbosity=2 -p no:flaky -p no:nose -p no:legacypath"
Expand Down
7 changes: 4 additions & 3 deletions dev/breeze/src/airflow_breeze/global_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
APACHE_AIRFLOW_GITHUB_REPOSITORY = "apache/airflow"

# Checked before putting in build cache
ALLOWED_PYTHON_MAJOR_MINOR_VERSIONS = ["3.8", "3.9", "3.10", "3.11"]
ALLOWED_PYTHON_MAJOR_MINOR_VERSIONS = ["3.8", "3.9", "3.10", "3.11", "3.12"]
DEFAULT_PYTHON_MAJOR_MINOR_VERSION = ALLOWED_PYTHON_MAJOR_MINOR_VERSIONS[0]
ALLOWED_ARCHITECTURES = [Architecture.X86_64, Architecture.ARM]
# Database Backends used when starting Breeze. The "none" value means that invalid configuration
Expand Down Expand Up @@ -193,7 +193,7 @@ def all_helm_test_packages() -> list[str]:
ALLOWED_USE_AIRFLOW_VERSIONS = ["none", "wheel", "sdist"]


ALL_HISTORICAL_PYTHON_VERSIONS = ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11"]
ALL_HISTORICAL_PYTHON_VERSIONS = ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]


def get_default_platform_machine() -> str:
Expand All @@ -219,7 +219,7 @@ def get_default_platform_machine() -> str:
PYTHONDONTWRITEBYTECODE = True

PRODUCTION_IMAGE = False
ALL_PYTHON_MAJOR_MINOR_VERSIONS = ["3.8", "3.9", "3.10", "3.11"]
ALL_PYTHON_MAJOR_MINOR_VERSIONS = ["3.8", "3.9", "3.10", "3.11", "3.12"]
CURRENT_PYTHON_MAJOR_MINOR_VERSIONS = ALL_PYTHON_MAJOR_MINOR_VERSIONS
CURRENT_POSTGRES_VERSIONS = ["12", "13", "14", "15", "16"]
DEFAULT_POSTGRES_VERSION = CURRENT_POSTGRES_VERSIONS[0]
Expand Down Expand Up @@ -267,6 +267,7 @@ def get_default_platform_machine() -> str:
"2.7.1": ["3.8", "3.9", "3.10", "3.11"],
"2.7.2": ["3.8", "3.9", "3.10", "3.11"],
"2.7.3": ["3.8", "3.9", "3.10", "3.11"],
"2.8.0": ["3.8", "3.9", "3.10", "3.11"],
}

DB_RESET = False
Expand Down
1 change: 1 addition & 0 deletions dev/breeze/src/airflow_breeze/utils/cdxgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,7 @@ def build_all_airflow_versions_base_image(
"3.9": "e698dbfe25da10d09c5810938f586535633928a4",
"3.10": "e698dbfe25da10d09c5810938f586535633928a4",
"3.11": "e698dbfe25da10d09c5810938f586535633928a4",
"3.12": "e698dbfe25da10d09c5810938f586535633928a4",
}
"""
image_name = get_all_airflow_versions_image_name(python_version=python_version)
Expand Down
4 changes: 2 additions & 2 deletions dev/breeze/tests/test_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
[
("backend", "mysql", (True, ["sqlite", "mysql", "postgres", "none"]), None),
("backend", "xxx", (False, ["sqlite", "mysql", "postgres", "none"]), None),
("python_major_minor_version", "3.8", (True, ["3.8", "3.9", "3.10", "3.11"]), None),
("python_major_minor_version", "3.7", (False, ["3.8", "3.9", "3.10", "3.11"]), None),
("python_major_minor_version", "3.8", (True, ["3.8", "3.9", "3.10", "3.11", "3.12"]), None),
("python_major_minor_version", "3.7", (False, ["3.8", "3.9", "3.10", "3.11", "3.12"]), None),
("missing", "value", None, AttributeError),
],
)
Expand Down
2 changes: 1 addition & 1 deletion dev/breeze/tests/test_packages.py
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ def test_provider_jinja_context():
"VERSION_SUFFIX": ".rc1",
"PROVIDER_DESCRIPTION": "Amazon integration (including `Amazon Web Services (AWS) <https://aws.amazon.com/>`__).\n",
"CHANGELOG_RELATIVE_PATH": "../../airflow/providers/amazon",
"SUPPORTED_PYTHON_VERSIONS": ["3.8", "3.9", "3.10", "3.11"],
"SUPPORTED_PYTHON_VERSIONS": ["3.8", "3.9", "3.10", "3.11", "3.12"],
"PLUGINS": [],
"MIN_AIRFLOW_VERSION": "2.6.0",
"PROVIDER_REMOVED": False,
Expand Down
64 changes: 32 additions & 32 deletions dev/breeze/tests/test_selective_checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -429,10 +429,10 @@ def assert_outputs_are_printed(expected_outputs: dict[str, str], stderr: str):
("pyproject.toml",),
{
"affected-providers-list-as-string": ALL_PROVIDERS_AFFECTED,
"all-python-versions": "['3.8', '3.9', '3.10', '3.11']",
"all-python-versions-list-as-string": "3.8 3.9 3.10 3.11",
"python-versions": "['3.8', '3.9', '3.10', '3.11']",
"python-versions-list-as-string": "3.8 3.9 3.10 3.11",
"all-python-versions": "['3.8', '3.9', '3.10', '3.11', '3.12']",
"all-python-versions-list-as-string": "3.8 3.9 3.10 3.11 3.12",
"python-versions": "['3.8', '3.9', '3.10', '3.11', '3.12']",
"python-versions-list-as-string": "3.8 3.9 3.10 3.11 3.12",
"ci-image-build": "true",
"prod-image-build": "true",
"needs-helm-tests": "true",
Expand All @@ -455,10 +455,10 @@ def assert_outputs_are_printed(expected_outputs: dict[str, str], stderr: str):
("generated/provider_dependencies.json",),
{
"affected-providers-list-as-string": ALL_PROVIDERS_AFFECTED,
"all-python-versions": "['3.8', '3.9', '3.10', '3.11']",
"all-python-versions-list-as-string": "3.8 3.9 3.10 3.11",
"python-versions": "['3.8', '3.9', '3.10', '3.11']",
"python-versions-list-as-string": "3.8 3.9 3.10 3.11",
"all-python-versions": "['3.8', '3.9', '3.10', '3.11', '3.12']",
"all-python-versions-list-as-string": "3.8 3.9 3.10 3.11 3.12",
"python-versions": "['3.8', '3.9', '3.10', '3.11', '3.12']",
"python-versions-list-as-string": "3.8 3.9 3.10 3.11 3.12",
"ci-image-build": "true",
"prod-image-build": "true",
"needs-helm-tests": "true",
Expand Down Expand Up @@ -605,10 +605,10 @@ def test_expected_output_pull_request_main(
"main",
{
"affected-providers-list-as-string": ALL_PROVIDERS_AFFECTED,
"all-python-versions": "['3.8', '3.9', '3.10', '3.11']",
"all-python-versions-list-as-string": "3.8 3.9 3.10 3.11",
"python-versions": "['3.8', '3.9', '3.10', '3.11']",
"python-versions-list-as-string": "3.8 3.9 3.10 3.11",
"all-python-versions": "['3.8', '3.9', '3.10', '3.11', '3.12']",
"all-python-versions-list-as-string": "3.8 3.9 3.10 3.11 3.12",
"python-versions": "['3.8', '3.9', '3.10', '3.11', '3.12']",
"python-versions-list-as-string": "3.8 3.9 3.10 3.11 3.12",
"ci-image-build": "true",
"prod-image-build": "true",
"run-tests": "true",
Expand All @@ -634,10 +634,10 @@ def test_expected_output_pull_request_main(
"main",
{
"affected-providers-list-as-string": ALL_PROVIDERS_AFFECTED,
"all-python-versions": "['3.8', '3.9', '3.10', '3.11']",
"all-python-versions-list-as-string": "3.8 3.9 3.10 3.11",
"python-versions": "['3.8', '3.9', '3.10', '3.11']",
"python-versions-list-as-string": "3.8 3.9 3.10 3.11",
"all-python-versions": "['3.8', '3.9', '3.10', '3.11', '3.12']",
"all-python-versions-list-as-string": "3.8 3.9 3.10 3.11 3.12",
"python-versions": "['3.8', '3.9', '3.10', '3.11', '3.12']",
"python-versions-list-as-string": "3.8 3.9 3.10 3.11 3.12",
"ci-image-build": "true",
"prod-image-build": "true",
"run-tests": "true",
Expand All @@ -661,10 +661,10 @@ def test_expected_output_pull_request_main(
"main",
{
"affected-providers-list-as-string": ALL_PROVIDERS_AFFECTED,
"all-python-versions": "['3.8', '3.9', '3.10', '3.11']",
"all-python-versions-list-as-string": "3.8 3.9 3.10 3.11",
"python-versions": "['3.8', '3.9', '3.10', '3.11']",
"python-versions-list-as-string": "3.8 3.9 3.10 3.11",
"all-python-versions": "['3.8', '3.9', '3.10', '3.11', '3.12']",
"all-python-versions-list-as-string": "3.8 3.9 3.10 3.11 3.12",
"python-versions": "['3.8', '3.9', '3.10', '3.11', '3.12']",
"python-versions-list-as-string": "3.8 3.9 3.10 3.11 3.12",
"ci-image-build": "true",
"prod-image-build": "true",
"run-tests": "true",
Expand All @@ -688,10 +688,10 @@ def test_expected_output_pull_request_main(
"v2-7-stable",
{
"affected-providers-list-as-string": ALL_PROVIDERS_AFFECTED,
"all-python-versions": "['3.8', '3.9', '3.10', '3.11']",
"all-python-versions-list-as-string": "3.8 3.9 3.10 3.11",
"python-versions": "['3.8', '3.9', '3.10', '3.11']",
"python-versions-list-as-string": "3.8 3.9 3.10 3.11",
"all-python-versions": "['3.8', '3.9', '3.10', '3.11', '3.12']",
"all-python-versions-list-as-string": "3.8 3.9 3.10 3.11 3.12",
"python-versions": "['3.8', '3.9', '3.10', '3.11', '3.12']",
"python-versions-list-as-string": "3.8 3.9 3.10 3.11 3.12",
"ci-image-build": "true",
"prod-image-build": "true",
"run-tests": "true",
Expand Down Expand Up @@ -1037,8 +1037,8 @@ def test_expected_output_pull_request_target(
"main",
{
"affected-providers-list-as-string": ALL_PROVIDERS_AFFECTED,
"all-python-versions": "['3.8', '3.9', '3.10', '3.11']",
"all-python-versions-list-as-string": "3.8 3.9 3.10 3.11",
"all-python-versions": "['3.8', '3.9', '3.10', '3.11', '3.12']",
"all-python-versions-list-as-string": "3.8 3.9 3.10 3.11 3.12",
"ci-image-build": "true",
"prod-image-build": "true",
"needs-helm-tests": "true",
Expand All @@ -1059,8 +1059,8 @@ def test_expected_output_pull_request_target(
"v2-3-stable",
{
"affected-providers-list-as-string": ALL_PROVIDERS_AFFECTED,
"all-python-versions": "['3.8', '3.9', '3.10', '3.11']",
"all-python-versions-list-as-string": "3.8 3.9 3.10 3.11",
"all-python-versions": "['3.8', '3.9', '3.10', '3.11', '3.12']",
"all-python-versions-list-as-string": "3.8 3.9 3.10 3.11 3.12",
"ci-image-build": "true",
"prod-image-build": "true",
"needs-helm-tests": "false",
Expand All @@ -1083,8 +1083,8 @@ def test_expected_output_pull_request_target(
"main",
{
"affected-providers-list-as-string": ALL_PROVIDERS_AFFECTED,
"all-python-versions": "['3.8', '3.9', '3.10', '3.11']",
"all-python-versions-list-as-string": "3.8 3.9 3.10 3.11",
"all-python-versions": "['3.8', '3.9', '3.10', '3.11', '3.12']",
"all-python-versions-list-as-string": "3.8 3.9 3.10 3.11 3.12",
"ci-image-build": "true",
"prod-image-build": "true",
"needs-helm-tests": "true",
Expand Down Expand Up @@ -1137,8 +1137,8 @@ def test_no_commit_provided_trigger_full_build_for_any_event_type(github_event):
)
assert_outputs_are_printed(
{
"all-python-versions": "['3.8', '3.9', '3.10', '3.11']",
"all-python-versions-list-as-string": "3.8 3.9 3.10 3.11",
"all-python-versions": "['3.8', '3.9', '3.10', '3.11', '3.12']",
"all-python-versions-list-as-string": "3.8 3.9 3.10 3.11 3.12",
"ci-image-build": "true",
"prod-image-build": "true",
"needs-helm-tests": "true",
Expand Down
2 changes: 1 addition & 1 deletion dev/retag_docker_images.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

import rich_click as click

PYTHON_VERSIONS = ["3.8", "3.9", "3.10", "3.11"]
PYTHON_VERSIONS = ["3.8", "3.9", "3.10", "3.11", "3.12"]

GHCR_IO_PREFIX = "ghcr.io"

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -1249,7 +1249,7 @@ artifacts = [

[tool.black]
line-length = 110
target-version = ['py38', 'py39', 'py310', 'py311']
target-version = ['py38', 'py39', 'py310', 'py311', 'py312']

[tool.ruff]
target-version = "py38"
Expand Down
Loading