diff --git a/components/polylith/project/__init__.py b/components/polylith/project/__init__.py index cdf68e5e..5025cb48 100644 --- a/components/polylith/project/__init__.py +++ b/components/polylith/project/__init__.py @@ -1,15 +1,10 @@ from polylith.project.create import create_project -from polylith.project.get import ( - get_packages_for_projects, - get_project_name, - get_project_names_and_paths, -) +from polylith.project.get import get_packages_for_projects, get_project_name from polylith.project.parser import parse_package_paths __all__ = [ "create_project", "get_project_name", - "get_project_names_and_paths", "get_packages_for_projects", "parse_package_paths", ] diff --git a/components/polylith/project/get.py b/components/polylith/project/get.py index f68df96c..fd42b6ae 100644 --- a/components/polylith/project/get.py +++ b/components/polylith/project/get.py @@ -1,4 +1,3 @@ -from collections.abc import Generator from pathlib import Path from typing import List @@ -19,8 +18,8 @@ def get_toml(root: Path) -> tomlkit.TOMLDocument: return tomlkit.loads(f.read()) -def get_project_files(root: Path) -> Generator: - return root.glob(f"projects/**/{default_toml}") +def get_project_files(root: Path) -> List[Path]: + return sorted(root.glob(f"projects/**/{default_toml}")) def get_toml_files(root: Path) -> List[dict]: @@ -40,11 +39,3 @@ def get_packages_for_projects(root: Path) -> List[dict]: } for d in tomls ] - - -def get_project_names_and_paths(root: Path) -> List[dict]: - project_files = get_project_files(root) - - return [ - {"name": get_project_name(get_toml(p)), "path": p.parent} for p in project_files - ]