This is an automated email from the ASF dual-hosted git repository.

ephraimanierobi pushed a commit to branch v2-8-test
in repository https://gitbox.apache.org/repos/asf/airflow.git

commit 72d610a35472806c4c330a7c77d2c02aa2d9272c
Author: Jarek Potiuk <[email protected]>
AuthorDate: Fri Dec 1 14:08:59 2023 +0100

    Switch "latest" image to point to newest supported Python version (#36003)
    
    Following the lazy consensus to change the "latest" image
    to point to "newest" Python version, we are changing the release
    method to follow it.
    
    https://lists.apache.org/thread/0oxnvct24xlqsj76z42w2ttw2d043oy3
    (cherry picked from commit 4117f1b013323d851613ba7b69b3d987cf213ead)
---
 .../commands/release_management_commands.py        | 26 +++++++++++-----------
 docs/docker-stack/changelog.rst                    |  8 +++++++
 2 files changed, 21 insertions(+), 13 deletions(-)

diff --git 
a/dev/breeze/src/airflow_breeze/commands/release_management_commands.py 
b/dev/breeze/src/airflow_breeze/commands/release_management_commands.py
index 5aa1f65bf1..42a55111ea 100644
--- a/dev/breeze/src/airflow_breeze/commands/release_management_commands.py
+++ b/dev/breeze/src/airflow_breeze/commands/release_management_commands.py
@@ -38,6 +38,7 @@ from airflow_breeze.commands.release_management_group import 
release_management
 from airflow_breeze.global_constants import (
     ALLOWED_DEBIAN_VERSIONS,
     ALLOWED_PLATFORMS,
+    ALLOWED_PYTHON_MAJOR_MINOR_VERSIONS,
     APACHE_AIRFLOW_GITHUB_REPOSITORY,
     CURRENT_PYTHON_MAJOR_MINOR_VERSIONS,
     DEFAULT_PYTHON_MAJOR_MINOR_VERSION,
@@ -1368,19 +1369,18 @@ def release_prod_images(
                     f"{dockerhub_repo}:{airflow_version}-python{python}",
                     f"{dockerhub_repo}:latest-python{python}",
                 )
-        if python == DEFAULT_PYTHON_MAJOR_MINOR_VERSION:
-            # only tag latest  "default" image when we build default python 
version
-            # otherwise if the non-default images complete before the default 
one, their jobs will fail
-            if slim_images:
-                alias_image(
-                    f"{dockerhub_repo}:slim-{airflow_version}",
-                    f"{dockerhub_repo}:slim-latest",
-                )
-            else:
-                alias_image(
-                    f"{dockerhub_repo}:{airflow_version}",
-                    f"{dockerhub_repo}:latest",
-                )
+            if python == ALLOWED_PYTHON_MAJOR_MINOR_VERSIONS[-1]:
+                # only tag latest "default" image when we build the latest 
allowed python version
+                if slim_images:
+                    alias_image(
+                        f"{dockerhub_repo}:slim-{airflow_version}",
+                        f"{dockerhub_repo}:slim-latest",
+                    )
+                else:
+                    alias_image(
+                        f"{dockerhub_repo}:{airflow_version}",
+                        f"{dockerhub_repo}:latest",
+                    )
 
 
 def is_package_in_dist(dist_files: list[str], package: str) -> bool:
diff --git a/docs/docker-stack/changelog.rst b/docs/docker-stack/changelog.rst
index ad71d49221..6e77799779 100644
--- a/docs/docker-stack/changelog.rst
+++ b/docs/docker-stack/changelog.rst
@@ -47,6 +47,14 @@ Airflow 2.8
      working with ``Debian Bookworm``. While all reference images of Airflow 
2.8.0 are built on ``Debian Bookworm``,
      it is still possible to build deprecated custom ``Debian Bullseye`` based 
image in 2.8.0 following the
 
+   * The "latest" image (i.e. default Airflow image when ``apache/airflow`` is 
used or
+     ``apache/airflow:slim-latest``) uses now the newest supported Python 
version. Previously it was using
+     the "default" Python version which was Python 3.8 as of Airflow 2.7. With 
Airflow reference images
+     released for Airflow 2.8.0, the images are going to use Python 3.11 as 
this is the latest supported
+     version for Airflow 2.8 line. Users can use Python 3.8 by using 
``apache/airflow:2.8.0-python3.8`` and
+     ``apache/airflow:slim-2.8.0-python-3.8`` images respectively so while the 
change is potentially
+     breaking, it is very easy to switch to the previous behaviour.
+
 
 Airflow 2.7
 ~~~~~~~~~~~

Reply via email to