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
27 changes: 27 additions & 0 deletions components/polylith/diff/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,30 @@ def print_diff_summary(tag: str, bases: List[str], components: List[str]) -> Non

if bases:
console.print(f"[base]Changed bases[/]: [data]{len(bases)}[/]")


def _changed_projects(
projects_data: List[dict], brick_type: str, bricks: List[str]
) -> set:
res = {
p["name"]: set(p.get(brick_type, [])).intersection(bricks)
for p in projects_data
}

return {k for k, v in res.items() if v}


def print_short_diff(
projects_data: List[dict],
projects: List[str],
bases: List[str],
components: List[str],
) -> None:

a = _changed_projects(projects_data, "components", components)
b = _changed_projects(projects_data, "bases", bases)

res = a | b | set(projects)

console = Console(theme=info_theme)
console.print(",".join(res))
2 changes: 1 addition & 1 deletion components/polylith/poetry/commands/diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def handle(self) -> int:
short = self.option("short")

if short:
self.line(",".join(projects))
diff.report.print_short_diff(projects_data, projects, bases, components)
else:
diff.report.print_diff_summary(tag, bases, components)
diff.report.print_detected_changes_in_projects(projects)
Expand Down
2 changes: 1 addition & 1 deletion projects/poetry_polylith_plugin/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "poetry-polylith-plugin"
version = "1.0.4"
version = "1.0.5"
description = "A Poetry plugin that adds tooling support for the Polylith Architecture"
authors = ["David Vujic"]
homepage = "https://github.com/davidvujic/python-polylith"
Expand Down