From f850751ea3219c14d2d9fb2cec48bf652aae5401 Mon Sep 17 00:00:00 2001 From: Jarek Potiuk Date: Fri, 9 Jan 2026 02:39:08 +0100 Subject: [PATCH] [v3-1-test] Fix constraint mode when installing from dist or version airflow (#60304) When Airflow is installed in breeze with `--use-airflow-version` and it's either wheel, dist or version number, we should use PyPI constraints, rather than source constraints, because in some edge cases, pre-installed providers might be installed using different version than the version specified in PyPI constraints. This might happen if the dependency resolution run by uv will determine that another package is more important to be installed in higher version and that higher version conflicts with newer preinstalled provider version. In this case Fab Provider is pinned with fab provider and the version of fab provider in v3-1-test sources was pretty old. (cherry picked from commit e0c5458c3334544c6432d6bc6b5e9c6345363ef6) Co-authored-by: Jarek Potiuk --- scripts/in_container/install_airflow_and_providers.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/in_container/install_airflow_and_providers.py b/scripts/in_container/install_airflow_and_providers.py index 1b3341ef954eb..f42dfc9431f0f 100755 --- a/scripts/in_container/install_airflow_and_providers.py +++ b/scripts/in_container/install_airflow_and_providers.py @@ -383,6 +383,8 @@ def find_installation_spec( airflow_version = get_airflow_version_from_package(airflow_distribution_spec) if airflow_version: console.print(f"[bright_blue]Using airflow version retrieved from package: {airflow_version}") + console.print("[yellow]Constraints mode is forced to 'constraints': installation from dist") + airflow_constraints_mode = "constraints" airflow_constraints_location = get_airflow_constraints_location( install_airflow_with_constraints=install_airflow_with_constraints, airflow_constraints_mode=airflow_constraints_mode, @@ -494,6 +496,7 @@ def find_installation_spec( ) sys.exit(1) else: + # Install specific airflow version compile_ui_assets = False if use_airflow_version.startswith("2"): airflow_extras = _add_pydantic_to_extras(airflow_extras) @@ -502,6 +505,8 @@ def find_installation_spec( airflow_core_distribution_spec = ( f"apache-airflow-core=={use_airflow_version}" if not use_airflow_version.startswith("2") else None ) + console.print("[yellow]Constraints mode is forced to 'constraints': installation from PyPI") + airflow_constraints_mode = "constraints" airflow_constraints_location = get_airflow_constraints_location( install_airflow_with_constraints=install_airflow_with_constraints, airflow_constraints_mode=airflow_constraints_mode,