From 5ddd67a9a670caf210fbcd15e033561ebe4404d8 Mon Sep 17 00:00:00 2001 From: Jarek Potiuk Date: Sat, 23 Dec 2023 14:42:34 +0100 Subject: [PATCH] Fix --use-airflow-version constraints (#36378) When `--use-airflow-version` is a numeric or rc version, the constraints should be specific for that version when installing airflow. For example when we install 2.7.3rc1, `constraints-2.7.3rc1` should be used. This has been lost when fixing version in CI. This PR introduces these fixes: * default varlue for airflow constraints is DEFAULT_AIRFLOW_CONSTRAINTS_BRANCH * when --use-airflow-version is numeric version and default value is used for constraints (DEFAULT_AIRFLOW_CONSTRAINTS_BRANCH) then it is replaced with `constraints-VERSION` * when we print out constraints used, we print which are the constraints used by Airflow and which by providers. --- .../common_package_installation_options.py | 5 +- ...e-management_install-provider-packages.svg | 92 ++++++++-------- ...e-management_install-provider-packages.txt | 2 +- ...se-management_verify-provider-packages.svg | 74 ++++++------- ...se-management_verify-provider-packages.txt | 2 +- images/breeze/output_shell.svg | 104 +++++++++--------- images/breeze/output_shell.txt | 2 +- images/breeze/output_start-airflow.svg | 82 +++++++------- images/breeze/output_start-airflow.txt | 2 +- .../install_airflow_and_providers.py | 5 +- 10 files changed, 179 insertions(+), 191 deletions(-) diff --git a/dev/breeze/src/airflow_breeze/commands/common_package_installation_options.py b/dev/breeze/src/airflow_breeze/commands/common_package_installation_options.py index 5a5d4288866ef..d0b85e82e88a6 100644 --- a/dev/breeze/src/airflow_breeze/commands/common_package_installation_options.py +++ b/dev/breeze/src/airflow_breeze/commands/common_package_installation_options.py @@ -19,13 +19,14 @@ import click +from airflow_breeze.branch_defaults import DEFAULT_AIRFLOW_CONSTRAINTS_BRANCH from airflow_breeze.global_constants import ALLOWED_CONSTRAINTS_MODES_CI, ALLOWED_CONSTRAINTS_MODES_PROD from airflow_breeze.utils.custom_param_types import BetterChoice option_airflow_constraints_reference = click.option( "--airflow-constraints-reference", - help="Constraint reference to use for airflow installation (used in calculated constraints URL). " - "Can be 'default' in which case the default constraints-reference is used.", + default=DEFAULT_AIRFLOW_CONSTRAINTS_BRANCH, + help="Constraint reference to use for airflow installation (used in calculated constraints URL).", envvar="AIRFLOW_CONSTRAINTS_REFERENCE", ) option_airflow_constraints_location = click.option( diff --git a/images/breeze/output_release-management_install-provider-packages.svg b/images/breeze/output_release-management_install-provider-packages.svg index 42a8725c2990f..dd728de859be8 100644 --- a/images/breeze/output_release-management_install-provider-packages.svg +++ b/images/breeze/output_release-management_install-provider-packages.svg @@ -1,4 +1,4 @@ - +