File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 77def _resolve_lbug_root (anchor : Path | None = None ) -> Path :
88 repo_root = (anchor or _REPO_ROOT ).resolve ()
99 for candidate in (repo_root , * repo_root .parents ):
10- if (candidate / "dataset" ).is_dir ():
11- return candidate
1210 if candidate .name == "python_api" and candidate .parent .name == "tools" :
1311 return candidate .parent .parent
12+ if (candidate / "dataset" ).is_dir ():
13+ return candidate
1414 if (candidate / "ladybug" / "dataset" ).is_dir ():
1515 return candidate / "ladybug"
1616 return repo_root
Original file line number Diff line number Diff line change @@ -24,3 +24,15 @@ def test_nested_ci_checkout_dataset_path_is_outside_python_api_tree() -> None:
2424 assert dataset_root .as_posix ().endswith (
2525 "/ladybug-python/ladybug-python/ladybug/dataset"
2626 )
27+
28+
29+ def test_nested_ci_checkout_prefers_parent_ladybug_root_over_local_dataset_dir () -> (
30+ None
31+ ):
32+ repo_root = Path (
33+ "/home/runner/work/ladybug-python/ladybug-python/ladybug/tools/python_api"
34+ )
35+
36+ resolved = _resolve_lbug_root (repo_root )
37+ assert resolved .name == "ladybug"
38+ assert "/tools/python_api" not in resolved .as_posix ()
You can’t perform that action at this time.
0 commit comments