This is an automated email from the ASF dual-hosted git repository. potiuk pushed a commit to branch v2-8-test in repository https://gitbox.apache.org/repos/asf/airflow.git
commit cdb42956eb0fa8021179452e008e71a46566de7c 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. (cherry picked from commit a7307c599383d8700f8b02a58c2fdf6652346334) --- 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 6e115463b8..2d529a743c 100644 --- a/dev/breeze/src/airflow_breeze/commands/developer_commands.py +++ b/dev/breeze/src/airflow_breeze/commands/developer_commands.py @@ -370,6 +370,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, mssql_version=mssql_version, @@ -562,6 +563,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 7c7ee6063d..cbbf87992c 100755 --- a/scripts/in_container/install_airflow_and_providers.py +++ b/scripts/in_container/install_airflow_and_providers.py @@ -472,7 +472,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"] console.print("\n[bright_blue]Installing provider packages:") for provider_package in sorted(installation_spec.provider_packages):
