diff --git a/components/polylith/commands/test.py b/components/polylith/commands/test.py index 346ed4c1..f5b8691b 100644 --- a/components/polylith/commands/test.py +++ b/components/polylith/commands/test.py @@ -8,9 +8,9 @@ def get_imported_bricks_in_tests( root: Path, ns: str, tag_name: Union[str, None], theme: str ) -> Set[str]: files = test.get_changed_files(root, tag_name) - imports = test.get_brick_imports_in_tests(root, ns, theme, files) + brick_imports = test.get_brick_imports_in_tests(root, ns, theme, files) - return set().union(*imports.values()) + return set().union(*brick_imports.values()) def extract_brick_names(bricks_data: List[dict], imported_bricks: Set[str]) -> Set[str]: diff --git a/components/polylith/test/core.py b/components/polylith/test/core.py index 6ac21b22..3115b326 100644 --- a/components/polylith/test/core.py +++ b/components/polylith/test/core.py @@ -1,7 +1,7 @@ from pathlib import Path from typing import List, Union -from polylith import check, diff +from polylith import check, diff, imports def is_test(root: Path, ns: str, path: Path, theme: str) -> bool: @@ -30,4 +30,8 @@ def get_brick_imports_in_tests( ) -> dict: matched = {f for f in files if is_test(root, ns, f, theme)} - return check.collect.extract_bricks(matched, ns) + listed_imports = [imports.list_imports(m) for m in matched] + + all_imports = {k: v for k, v in enumerate(listed_imports)} + + return check.grouping.extract_brick_imports(all_imports, ns) diff --git a/projects/poetry_polylith_plugin/pyproject.toml b/projects/poetry_polylith_plugin/pyproject.toml index 04e2910a..faff4a26 100644 --- a/projects/poetry_polylith_plugin/pyproject.toml +++ b/projects/poetry_polylith_plugin/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "poetry-polylith-plugin" -version = "1.37.0" +version = "1.37.1" description = "A Poetry plugin that adds tooling support for the Polylith Architecture" authors = ["David Vujic"] homepage = "https://davidvujic.github.io/python-polylith-docs/" diff --git a/projects/polylith_cli/pyproject.toml b/projects/polylith_cli/pyproject.toml index 1a821393..f3897cf8 100644 --- a/projects/polylith_cli/pyproject.toml +++ b/projects/polylith_cli/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "polylith-cli" -version = "1.27.0" +version = "1.27.1" description = "Python tooling support for the Polylith Architecture" authors = ['David Vujic'] homepage = "https://davidvujic.github.io/python-polylith-docs/"