This is an automated email from the ASF dual-hosted git repository.
potiuk pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new a7307c5993 Bring back installing airflow with constraints
(--use-airflow-version) (#37487)
a7307c5993 is described below
commit a7307c599383d8700f8b02a58c2fdf6652346334
Author: Jarek Potiuk <[email protected]>
AuthorDate: Fri Feb 16 21:40:24 2024 +0100
Bring back installing airflow with constraints (--use-airflow-version)
(#37487)
The #37362 introduced --install-airflow-with-constraints flag to be
able to check FAB provider installation in CI, but the value of that
flag was falee for `shell` and `start-airlfow` command - and
there was a mistake in the condition installing airlfow that if that
flag was not set AND providers were not installed together, airflow
was not installed at all - resulting in `missing airflow.__main`.
This PR fixes it - the flag is set to true also the condition for
installation is such that even if providers are not installed, airflow
will be installed without constraints if
--install-airflow-with-constraints flag is not set.
---
dev/breeze/src/airflow_breeze/commands/developer_commands.py | 2 ++
scripts/in_container/install_airflow_and_providers.py | 2 +-
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/dev/breeze/src/airflow_breeze/commands/developer_commands.py
b/dev/breeze/src/airflow_breeze/commands/developer_commands.py
index 71907f0047..63119113c3 100644
--- a/dev/breeze/src/airflow_breeze/commands/developer_commands.py
+++ b/dev/breeze/src/airflow_breeze/commands/developer_commands.py
@@ -367,6 +367,7 @@ def shell(
image_tag=image_tag,
include_mypy_volume=include_mypy_volume,
install_selected_providers=install_selected_providers,
+ install_airflow_with_constraints=True,
integration=integration,
mount_sources=mount_sources,
mysql_version=mysql_version,
@@ -556,6 +557,7 @@ def start_airflow(
image_tag=image_tag,
integration=integration,
install_selected_providers=install_selected_providers,
+ install_airflow_with_constraints=True,
load_default_connections=load_default_connections,
load_example_dags=load_example_dags,
mount_sources=mount_sources,
diff --git a/scripts/in_container/install_airflow_and_providers.py
b/scripts/in_container/install_airflow_and_providers.py
index a637fe43e7..eb38708d05 100755
--- a/scripts/in_container/install_airflow_and_providers.py
+++ b/scripts/in_container/install_airflow_and_providers.py
@@ -482,7 +482,7 @@ def install_airflow_and_providers(
install_airflow_cmd.extend(["--constraint",
installation_spec.airflow_constraints_location])
console.print()
run_command(install_airflow_cmd, github_actions=github_actions,
check=True)
- if installation_spec.provider_packages:
+ if installation_spec.provider_packages or not
install_airflow_with_constraints:
install_providers_cmd = ["pip", "install", "--root-user-action",
"ignore"]
if not install_airflow_with_constraints and
installation_spec.airflow_package:
install_providers_cmd.append(installation_spec.airflow_package)