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

potiuk pushed a commit to branch v3-1-test
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/v3-1-test by this push:
     new 323fd8e863b [v3-1-test] Protect against reproducibility issue with 
Python client (#57390) (#57391)
323fd8e863b is described below

commit 323fd8e863bd9e0943216b2ec748bdcf4d16357c
Author: github-actions[bot] 
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Tue Oct 28 01:44:40 2025 +0100

    [v3-1-test] Protect against reproducibility issue with Python client 
(#57390) (#57391)
    
    When you are preparing python client with non-default Python
    version, the preparation step will fail and let you know how to
    reinstall breeze with the default version - because different
    versions of Python might produce different generated ast code.
    (cherry picked from commit a68df282e8afb4f856160c7abff611024925d238)
    
    Co-authored-by: Jarek Potiuk <[email protected]>
---
 .../commands/release_management_commands.py               | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

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 35a152f0b7e..2ee47aac219 100644
--- a/dev/breeze/src/airflow_breeze/commands/release_management_commands.py
+++ b/dev/breeze/src/airflow_breeze/commands/release_management_commands.py
@@ -3443,6 +3443,21 @@ def prepare_python_client(
         - Locates the `_dict = self.model_dump(...)` line in `to_dict()`
         - Inserts a conditional to add `"logical_date": None` if it's missing
         """
+        current_python_version = 
f"{sys.version_info.major}.{sys.version_info.minor}"
+        if current_python_version != DEFAULT_PYTHON_MAJOR_MINOR_VERSION:
+            get_console().print(
+                f"[error]Python version mismatch: current version is 
{current_python_version}, "
+                f"but default version is {DEFAULT_PYTHON_MAJOR_MINOR_VERSION} 
- this might cause "
+                f"reproducibility problems with prepared package.[/]"
+            )
+            get_console().print(
+                f"[info]Please reinstall breeze with uv using Python 
{DEFAULT_PYTHON_MAJOR_MINOR_VERSION}:[/]"
+            )
+            get_console().print(
+                f"\nuv tool install --python 
{DEFAULT_PYTHON_MAJOR_MINOR_VERSION} -e ./dev/breeze --force\n"
+            )
+            sys.exit(1)
+
         TRIGGER_MODEL_PATH = PYTHON_CLIENT_TMP_DIR / Path(
             "airflow_client/client/models/trigger_dag_run_post_body.py"
         )

Reply via email to