Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions components/polylith/project/__init__.py
Original file line number Diff line number Diff line change
@@ -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",
]
13 changes: 2 additions & 11 deletions components/polylith/project/get.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from collections.abc import Generator
from pathlib import Path
from typing import List

Expand All @@ -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]:
Expand All @@ -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
]