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 b09e6613b5f Fix automated switching of breeze for Airflow 2 (#51430)
b09e6613b5f is described below
commit b09e6613b5f16a8c52c29889ff396a1c0004dd62
Author: Jarek Potiuk <[email protected]>
AuthorDate: Thu Jun 5 12:58:34 2025 +0200
Fix automated switching of breeze for Airflow 2 (#51430)
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.
---
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