You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by ka...@apache.org on 2025/06/06 09:27:21 UTC
(airflow) 01/09: [v3-0-test] Fix automated switching of breeze for Airflow 2 (#51430) (#51437)
This is an automated email from the ASF dual-hosted git repository.
kaxilnaik pushed a commit to branch v3-0-test
in repository https://gitbox.apache.org/repos/asf/airflow.git
commit 0822e170abc9b314d0b8fb8b025fbce9f0e8cefd
Author: Jarek Potiuk <ja...@potiuk.com>
AuthorDate: Thu Jun 5 14:13:43 2025 +0200
[v3-0-test] Fix automated switching of breeze for Airflow 2 (#51430) (#51437)
When we removed hatch_build.py in Airflow 3 we changed the way
how we detect automatically if breeze should be reinstalled when
you switch to another directory and it stopped working when you
had Airflow 2 checked out (say v2-11-test) - this one brings
switching back (should be backported to v2-11-test to also allow
switching breeze automatically from v2-11-test branch.
(cherry picked from commit b09e661)
---
dev/breeze/src/airflow_breeze/utils/path_utils.py | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/dev/breeze/src/airflow_breeze/utils/path_utils.py b/dev/breeze/src/airflow_breeze/utils/path_utils.py
index 47a9cbd95e1..0edd3601a08 100644
--- a/dev/breeze/src/airflow_breeze/utils/path_utils.py
+++ b/dev/breeze/src/airflow_breeze/utils/path_utils.py
@@ -45,6 +45,13 @@ def search_upwards_for_airflow_root_path(start_from: Path) -> Path | None:
airflow_candidate_init_py = directory / "airflow-core" / "src" / "airflow" / "__init__.py"
if airflow_candidate_init_py.exists() and "airflow" in airflow_candidate_init_py.read_text().lower():
return directory
+ airflow_2_candidate_init_py = directory / "airflow" / "__init__.py"
+ if (
+ airflow_2_candidate_init_py.exists()
+ and "airflow" in airflow_2_candidate_init_py.read_text().lower()
+ and directory.parent.name != "src"
+ ):
+ return directory
directory = directory.parent
return None