From 097ca094de7a1f502ba7e48ee1cfb1ee5766577b Mon Sep 17 00:00:00 2001 From: Jarek Potiuk Date: Fri, 9 Jan 2026 00:37:40 +0100 Subject: [PATCH] Fix constraint mode when installing from dist or version airflow 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. --- 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 2b4688de7a637..5337643f15275 100755 --- a/scripts/in_container/install_airflow_and_providers.py +++ b/scripts/in_container/install_airflow_and_providers.py @@ -391,6 +391,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, @@ -503,6 +505,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) @@ -511,6 +514,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,