Skip to content
Merged
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
10 changes: 8 additions & 2 deletions components/polylith/bricks/component.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,17 @@
from polylith.test import create_test


def create_component(path: Path, namespace: str, package: str, description: Union[str, None]) -> None:
def create_component(
path: Path, namespace: str, package: str, description: Union[str, None]
) -> None:
create_brick(path, components_dir, namespace, package, description)
create_test(path, components_dir, namespace, package)


def is_brick_dir(p: Path) -> bool:
return p.is_dir() and p.name not in {"__pycache__", ".venv", ".mypy_cache"}


def get_component_dirs(root: Path, top_dir, ns) -> list:
theme = workspace.parser.get_theme_from_config(root)
dirs = top_dir if theme == "tdd" else f"{top_dir}/{ns}"
Expand All @@ -21,7 +27,7 @@ def get_component_dirs(root: Path, top_dir, ns) -> list:
if not component_dir.exists():
return []

return [f for f in component_dir.iterdir() if f.is_dir()]
return [f for f in component_dir.iterdir() if is_brick_dir(f)]


def get_components_data(
Expand Down