Skip to content

Commit

Permalink
fix: deps reporting (#204)
Browse files Browse the repository at this point in the history
* test(deps): add unit test for the deps matrix reporting

* bump poetry plugin to 1.18.3

* bump cli version to 1.5.4
  • Loading branch information
DavidVujic committed Apr 25, 2024
1 parent afd8cfc commit 6d49440
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 2 deletions.
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.18.2"
version = "1.18.3"
description = "A Poetry plugin that adds tooling support for the Polylith Architecture"
authors = ["David Vujic"]
homepage = "https://davidvujic.github.io/python-polylith-docs/"
Expand Down
2 changes: 1 addition & 1 deletion projects/polylith_cli/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "polylith-cli"
version = "1.5.3"
version = "1.5.4"
description = "Python tooling support for the Polylith Architecture"
authors = ['David Vujic']
homepage = "https://davidvujic.github.io/python-polylith-docs/"
Expand Down
26 changes: 26 additions & 0 deletions test/components/polylith/deps/test_deps_report.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
from polylith.deps.report import create_rows

bases_in_workspace = {"x"}
components_in_workspace = {"a", "b"}


def test_to_row_returns_columns_for_all_bricks():
expected_length = len(bases_in_workspace) + len(components_in_workspace)

# the base x imports the component a
# the component a imports the component b
# the component b imports nothing
collected_import_data = {"x": {"a"}, "a": {"b"}}
flattened_imports = set().union(*collected_import_data.values())

rows = create_rows(
bases_in_workspace,
components_in_workspace,
collected_import_data,
flattened_imports,
)

assert len(rows) == expected_length

for columns in rows:
assert len(columns) == expected_length

0 comments on commit 6d49440

Please sign in to comment.