Skip to content

Commit 3ca47a0

Browse files
committed
Unify selecting constraints option when installing airflow
Due to the way how it historically got added - we had two ways of selecting whether we are installing airlfow dyanmically in breeze with or without constraints: * --install-airflow-with-constraints - was used in a few places * --skip-airflow-constraints - was used in other places The logic to handle those were broken at places where they contradicted each other. This PR unifies it and only uses the --install-airflow-with-constraints flag in all the places where we need to determine whether constraints are used or not and it fixes the logic.
1 parent 84a3acb commit 3ca47a0

19 files changed

Lines changed: 334 additions & 301 deletions

.github/workflows/test-providers.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,8 @@ jobs:
138138
- name: "Install and verify wheel provider distributions"
139139
env:
140140
DISTRIBUTION_FORMAT: ${{ matrix.package-format }}
141-
AIRFLOW_SKIP_CONSTRAINTS: "${{ inputs.upgrade-to-newer-dependencies }}"
141+
# yamllint disable rule:line-length
142+
INSTALL_AIRFLOW_WITH_CONSTRAINTS: "${{ inputs.upgrade-to-newer-dependencies == 'true' && 'false' || 'true' }}"
142143
run: >
143144
breeze release-management verify-provider-distributions
144145
--use-distributions-from-dist

dev/breeze/doc/images/output_release-management_install-provider-distributions.svg

Lines changed: 107 additions & 55 deletions
Loading
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
cfe5f24c120f2db2847a2417ef25c611
1+
c04ca4aa246f2fd444efed0308474fa1

dev/breeze/doc/images/output_release-management_verify-provider-distributions.svg

Lines changed: 45 additions & 49 deletions
Loading
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0e329f01241fba5f0dcab0c7e2d77870
1+
26b34f4a3b053d7114ffc7dee194c87b

dev/breeze/doc/images/output_shell.svg

Lines changed: 79 additions & 83 deletions
Loading
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
f26f35825705d41fba54a52a5383f02e
1+
00e479003b0f0fd2e7e81d0703a4b829

dev/breeze/doc/images/output_start-airflow.svg

Lines changed: 56 additions & 40 deletions
Loading
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
a99b51b3e51bd9e82e88d4944279dcd9
1+
055a450825e9a8ff29477615629cffc2

dev/breeze/src/airflow_breeze/commands/common_options.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -443,6 +443,22 @@ def _set_default_from_parent(ctx: click.core.Context, option: click.core.Option,
443443
type=VerboseOption(),
444444
callback=_set_default_from_parent,
445445
)
446+
option_install_airflow_with_constraints = click.option(
447+
"--install-airflow-with-constraints/--no-install-airflow-with-constraints",
448+
is_flag=True,
449+
default=False,
450+
show_default=True,
451+
envvar="INSTALL_AIRFLOW_WITH_CONSTRAINTS",
452+
help="Install airflow in a separate step, with constraints determined from package or airflow version.",
453+
)
454+
option_install_airflow_with_constraints_default_true = click.option(
455+
"--install-airflow-with-constraints/--no-install-airflow-with-constraints",
456+
is_flag=True,
457+
default=True,
458+
show_default=True,
459+
envvar="INSTALL_AIRFLOW_WITH_CONSTRAINTS",
460+
help="Install airflow in a separate step, with constraints determined from package or airflow version.",
461+
)
446462

447463

448464
def _is_number_greater_than_expected(value: str) -> bool:

0 commit comments

Comments
 (0)