Skip to content

Commit

Permalink
Add missing "airflow-constraints-reference" parameter (apache#23844)
Browse files Browse the repository at this point in the history
The build commands were missing "airflow-constraints-reference"
parameter and it always defaulted to constraints-main
  • Loading branch information
potiuk authored May 21, 2022
1 parent 5802e4e commit cc3ab43
Show file tree
Hide file tree
Showing 6 changed files with 172 additions and 156 deletions.
8 changes: 8 additions & 0 deletions dev/breeze/src/airflow_breeze/commands/ci_image_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

import click

from airflow_breeze.branch_defaults import DEFAULT_AIRFLOW_CONSTRAINTS_BRANCH
from airflow_breeze.commands.main_command import main
from airflow_breeze.params.build_ci_params import BuildCiParams
from airflow_breeze.params.shell_params import ShellParams
Expand Down Expand Up @@ -124,6 +125,7 @@
"options": [
"--install-providers-from-sources",
"--airflow-constraints-mode",
"--airflow-constraints-reference",
"--additional-python-deps",
"--runtime-apt-deps",
"--runtime-apt-command",
Expand Down Expand Up @@ -219,6 +221,12 @@
@option_runtime_apt_deps
@option_force_build
@option_airflow_constraints_mode_ci
@click.option(
"--airflow-constraints-reference",
default=DEFAULT_AIRFLOW_CONSTRAINTS_BRANCH,
help="Constraint reference to use when building the image.",
envvar='AIRFLOW_CONSTRAINTS_REFERENCE',
)
@option_tag_as_latest
def build_image(
verbose: bool,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

import click

from airflow_breeze.branch_defaults import DEFAULT_AIRFLOW_CONSTRAINTS_BRANCH
from airflow_breeze.commands.main_command import main
from airflow_breeze.global_constants import ALLOWED_INSTALLATION_METHODS, DEFAULT_EXTRAS
from airflow_breeze.params.build_prod_params import BuildProdParams
Expand Down Expand Up @@ -113,6 +114,7 @@
"--install-providers-from-sources",
"--airflow-extras",
"--airflow-constraints-mode",
"--airflow-constraints-reference",
"--additional-python-deps",
"--additional-extras",
"--additional-runtime-apt-deps",
Expand Down Expand Up @@ -247,6 +249,12 @@
'--install-airflow-reference',
help="Install Airflow using GitHub tag or branch.",
)
@click.option(
"--airflow-constraints-reference",
default=DEFAULT_AIRFLOW_CONSTRAINTS_BRANCH,
help="Constraint reference to use when building the image.",
envvar='AIRFLOW_CONSTRAINTS_REFERENCE',
)
@click.option('-V', '--install-airflow-version', help="Install version of Airflow from PyPI.")
@option_additional_extras
@option_additional_dev_apt_deps
Expand Down
2 changes: 0 additions & 2 deletions dev/breeze/src/airflow_breeze/utils/common_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

import click

from airflow_breeze.branch_defaults import DEFAULT_AIRFLOW_CONSTRAINTS_BRANCH
from airflow_breeze.global_constants import (
ALLOWED_BACKENDS,
ALLOWED_BUILD_CACHE,
Expand Down Expand Up @@ -414,7 +413,6 @@
)
option_airflow_constraints_reference = click.option(
"--airflow-constraints-reference",
default=DEFAULT_AIRFLOW_CONSTRAINTS_BRANCH,
help="Constraint reference to use. Useful with --use-airflow-version parameter to specify "
"constraints for the installed version and to find newer dependencies",
envvar='AIRFLOW_CONSTRAINTS_REFERENCE',
Expand Down
Loading

0 comments on commit cc3ab43

Please sign in to comment.