polylith-cli 1.44.0__tar.gz → 1.45.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {polylith_cli-1.44.0 → polylith_cli-1.45.1}/PKG-INFO +1 -1
- {polylith_cli-1.44.0 → polylith_cli-1.45.1}/polylith_cli/polylith/commands/deps.py +9 -0
- {polylith_cli-1.44.0 → polylith_cli-1.45.1}/polylith_cli/polylith/deps/report.py +6 -3
- {polylith_cli-1.44.0 → polylith_cli-1.45.1}/polylith_cli/polylith/interface/report.py +3 -4
- {polylith_cli-1.44.0 → polylith_cli-1.45.1}/polylith_cli/polylith/sync/update.py +5 -9
- {polylith_cli-1.44.0 → polylith_cli-1.45.1}/pyproject.toml +1 -1
- {polylith_cli-1.44.0 → polylith_cli-1.45.1}/README.md +0 -0
- {polylith_cli-1.44.0 → polylith_cli-1.45.1}/polylith_cli/polylith/alias/__init__.py +0 -0
- {polylith_cli-1.44.0 → polylith_cli-1.45.1}/polylith_cli/polylith/alias/core.py +0 -0
- {polylith_cli-1.44.0 → polylith_cli-1.45.1}/polylith_cli/polylith/bricks/__init__.py +0 -0
- {polylith_cli-1.44.0 → polylith_cli-1.45.1}/polylith_cli/polylith/bricks/base.py +0 -0
- {polylith_cli-1.44.0 → polylith_cli-1.45.1}/polylith_cli/polylith/bricks/brick.py +0 -0
- {polylith_cli-1.44.0 → polylith_cli-1.45.1}/polylith_cli/polylith/bricks/component.py +0 -0
- {polylith_cli-1.44.0 → polylith_cli-1.45.1}/polylith_cli/polylith/building/__init__.py +0 -0
- {polylith_cli-1.44.0 → polylith_cli-1.45.1}/polylith_cli/polylith/building/core.py +0 -0
- {polylith_cli-1.44.0 → polylith_cli-1.45.1}/polylith_cli/polylith/building/paths.py +0 -0
- {polylith_cli-1.44.0 → polylith_cli-1.45.1}/polylith_cli/polylith/check/__init__.py +0 -0
- {polylith_cli-1.44.0 → polylith_cli-1.45.1}/polylith_cli/polylith/check/collect.py +0 -0
- {polylith_cli-1.44.0 → polylith_cli-1.45.1}/polylith_cli/polylith/check/report.py +0 -0
- {polylith_cli-1.44.0 → polylith_cli-1.45.1}/polylith_cli/polylith/cli/__init__.py +0 -0
- {polylith_cli-1.44.0 → polylith_cli-1.45.1}/polylith_cli/polylith/cli/__main__.py +0 -0
- {polylith_cli-1.44.0 → polylith_cli-1.45.1}/polylith_cli/polylith/cli/build.py +0 -0
- {polylith_cli-1.44.0 → polylith_cli-1.45.1}/polylith_cli/polylith/cli/core.py +0 -0
- {polylith_cli-1.44.0 → polylith_cli-1.45.1}/polylith_cli/polylith/cli/create.py +0 -0
- {polylith_cli-1.44.0 → polylith_cli-1.45.1}/polylith_cli/polylith/cli/env.py +0 -0
- {polylith_cli-1.44.0 → polylith_cli-1.45.1}/polylith_cli/polylith/cli/options.py +0 -0
- {polylith_cli-1.44.0 → polylith_cli-1.45.1}/polylith_cli/polylith/cli/test.py +0 -0
- {polylith_cli-1.44.0 → polylith_cli-1.45.1}/polylith_cli/polylith/commands/__init__.py +0 -0
- {polylith_cli-1.44.0 → polylith_cli-1.45.1}/polylith_cli/polylith/commands/check.py +0 -0
- {polylith_cli-1.44.0 → polylith_cli-1.45.1}/polylith_cli/polylith/commands/create.py +0 -0
- {polylith_cli-1.44.0 → polylith_cli-1.45.1}/polylith_cli/polylith/commands/diff.py +0 -0
- {polylith_cli-1.44.0 → polylith_cli-1.45.1}/polylith_cli/polylith/commands/info.py +0 -0
- {polylith_cli-1.44.0 → polylith_cli-1.45.1}/polylith_cli/polylith/commands/libs.py +0 -0
- {polylith_cli-1.44.0 → polylith_cli-1.45.1}/polylith_cli/polylith/commands/sync.py +0 -0
- {polylith_cli-1.44.0 → polylith_cli-1.45.1}/polylith_cli/polylith/commands/test.py +0 -0
- {polylith_cli-1.44.0 → polylith_cli-1.45.1}/polylith_cli/polylith/configuration/__init__.py +0 -0
- {polylith_cli-1.44.0 → polylith_cli-1.45.1}/polylith_cli/polylith/configuration/core.py +0 -0
- {polylith_cli-1.44.0 → polylith_cli-1.45.1}/polylith_cli/polylith/deps/__init__.py +0 -0
- {polylith_cli-1.44.0 → polylith_cli-1.45.1}/polylith_cli/polylith/deps/core.py +0 -0
- {polylith_cli-1.44.0 → polylith_cli-1.45.1}/polylith_cli/polylith/development/__init__.py +0 -0
- {polylith_cli-1.44.0 → polylith_cli-1.45.1}/polylith_cli/polylith/development/development.py +0 -0
- {polylith_cli-1.44.0 → polylith_cli-1.45.1}/polylith_cli/polylith/diff/__init__.py +0 -0
- {polylith_cli-1.44.0 → polylith_cli-1.45.1}/polylith_cli/polylith/diff/collect.py +0 -0
- {polylith_cli-1.44.0 → polylith_cli-1.45.1}/polylith_cli/polylith/diff/report.py +0 -0
- {polylith_cli-1.44.0 → polylith_cli-1.45.1}/polylith_cli/polylith/dirs/__init__.py +0 -0
- {polylith_cli-1.44.0 → polylith_cli-1.45.1}/polylith_cli/polylith/dirs/dirs.py +0 -0
- {polylith_cli-1.44.0 → polylith_cli-1.45.1}/polylith_cli/polylith/distributions/__init__.py +0 -0
- {polylith_cli-1.44.0 → polylith_cli-1.45.1}/polylith_cli/polylith/distributions/caching.py +0 -0
- {polylith_cli-1.44.0 → polylith_cli-1.45.1}/polylith_cli/polylith/distributions/collect.py +0 -0
- {polylith_cli-1.44.0 → polylith_cli-1.45.1}/polylith_cli/polylith/distributions/core.py +0 -0
- {polylith_cli-1.44.0 → polylith_cli-1.45.1}/polylith_cli/polylith/environment/__init__.py +0 -0
- {polylith_cli-1.44.0 → polylith_cli-1.45.1}/polylith_cli/polylith/environment/core.py +0 -0
- {polylith_cli-1.44.0 → polylith_cli-1.45.1}/polylith_cli/polylith/files/__init__.py +0 -0
- {polylith_cli-1.44.0 → polylith_cli-1.45.1}/polylith_cli/polylith/files/files.py +0 -0
- {polylith_cli-1.44.0 → polylith_cli-1.45.1}/polylith_cli/polylith/imports/__init__.py +0 -0
- {polylith_cli-1.44.0 → polylith_cli-1.45.1}/polylith_cli/polylith/imports/grouping.py +0 -0
- {polylith_cli-1.44.0 → polylith_cli-1.45.1}/polylith_cli/polylith/imports/parser.py +0 -0
- {polylith_cli-1.44.0 → polylith_cli-1.45.1}/polylith_cli/polylith/imports/usages.py +0 -0
- {polylith_cli-1.44.0 → polylith_cli-1.45.1}/polylith_cli/polylith/info/__init__.py +0 -0
- {polylith_cli-1.44.0 → polylith_cli-1.45.1}/polylith_cli/polylith/info/collect.py +0 -0
- {polylith_cli-1.44.0 → polylith_cli-1.45.1}/polylith_cli/polylith/info/report.py +0 -0
- {polylith_cli-1.44.0 → polylith_cli-1.45.1}/polylith_cli/polylith/interactive/__init__.py +0 -0
- {polylith_cli-1.44.0 → polylith_cli-1.45.1}/polylith_cli/polylith/interactive/project.py +0 -0
- {polylith_cli-1.44.0 → polylith_cli-1.45.1}/polylith_cli/polylith/interface/__init__.py +0 -0
- {polylith_cli-1.44.0 → polylith_cli-1.45.1}/polylith_cli/polylith/interface/collect.py +0 -0
- {polylith_cli-1.44.0 → polylith_cli-1.45.1}/polylith_cli/polylith/interface/interfaces.py +0 -0
- {polylith_cli-1.44.0 → polylith_cli-1.45.1}/polylith_cli/polylith/interface/parser.py +0 -0
- {polylith_cli-1.44.0 → polylith_cli-1.45.1}/polylith_cli/polylith/interface/usage.py +0 -0
- {polylith_cli-1.44.0 → polylith_cli-1.45.1}/polylith_cli/polylith/libs/__init__.py +0 -0
- {polylith_cli-1.44.0 → polylith_cli-1.45.1}/polylith_cli/polylith/libs/grouping.py +0 -0
- {polylith_cli-1.44.0 → polylith_cli-1.45.1}/polylith_cli/polylith/libs/lock_files.py +0 -0
- {polylith_cli-1.44.0 → polylith_cli-1.45.1}/polylith_cli/polylith/libs/report.py +0 -0
- {polylith_cli-1.44.0 → polylith_cli-1.45.1}/polylith_cli/polylith/libs/stdlib.py +0 -0
- {polylith_cli-1.44.0 → polylith_cli-1.45.1}/polylith_cli/polylith/output/__init__.py +0 -0
- {polylith_cli-1.44.0 → polylith_cli-1.45.1}/polylith_cli/polylith/output/core.py +0 -0
- {polylith_cli-1.44.0 → polylith_cli-1.45.1}/polylith_cli/polylith/parsing/__init__.py +0 -0
- {polylith_cli-1.44.0 → polylith_cli-1.45.1}/polylith_cli/polylith/parsing/core.py +0 -0
- {polylith_cli-1.44.0 → polylith_cli-1.45.1}/polylith_cli/polylith/parsing/rewrite.py +0 -0
- {polylith_cli-1.44.0 → polylith_cli-1.45.1}/polylith_cli/polylith/project/__init__.py +0 -0
- {polylith_cli-1.44.0 → polylith_cli-1.45.1}/polylith_cli/polylith/project/create.py +0 -0
- {polylith_cli-1.44.0 → polylith_cli-1.45.1}/polylith_cli/polylith/project/get.py +0 -0
- {polylith_cli-1.44.0 → polylith_cli-1.45.1}/polylith_cli/polylith/project/parser.py +0 -0
- {polylith_cli-1.44.0 → polylith_cli-1.45.1}/polylith_cli/polylith/project/templates.py +0 -0
- {polylith_cli-1.44.0 → polylith_cli-1.45.1}/polylith_cli/polylith/readme/__init__.py +0 -0
- {polylith_cli-1.44.0 → polylith_cli-1.45.1}/polylith_cli/polylith/readme/readme.py +0 -0
- {polylith_cli-1.44.0 → polylith_cli-1.45.1}/polylith_cli/polylith/repo/__init__.py +0 -0
- {polylith_cli-1.44.0 → polylith_cli-1.45.1}/polylith_cli/polylith/repo/get.py +0 -0
- {polylith_cli-1.44.0 → polylith_cli-1.45.1}/polylith_cli/polylith/repo/repo.py +0 -0
- {polylith_cli-1.44.0 → polylith_cli-1.45.1}/polylith_cli/polylith/reporting/__init__.py +0 -0
- {polylith_cli-1.44.0 → polylith_cli-1.45.1}/polylith_cli/polylith/reporting/theme.py +0 -0
- {polylith_cli-1.44.0 → polylith_cli-1.45.1}/polylith_cli/polylith/sync/__init__.py +0 -0
- {polylith_cli-1.44.0 → polylith_cli-1.45.1}/polylith_cli/polylith/sync/collect.py +0 -0
- {polylith_cli-1.44.0 → polylith_cli-1.45.1}/polylith_cli/polylith/sync/report.py +0 -0
- {polylith_cli-1.44.0 → polylith_cli-1.45.1}/polylith_cli/polylith/test/__init__.py +0 -0
- {polylith_cli-1.44.0 → polylith_cli-1.45.1}/polylith_cli/polylith/test/core.py +0 -0
- {polylith_cli-1.44.0 → polylith_cli-1.45.1}/polylith_cli/polylith/test/report.py +0 -0
- {polylith_cli-1.44.0 → polylith_cli-1.45.1}/polylith_cli/polylith/test/tests.py +0 -0
- {polylith_cli-1.44.0 → polylith_cli-1.45.1}/polylith_cli/polylith/toml/__init__.py +0 -0
- {polylith_cli-1.44.0 → polylith_cli-1.45.1}/polylith_cli/polylith/toml/core.py +0 -0
- {polylith_cli-1.44.0 → polylith_cli-1.45.1}/polylith_cli/polylith/workspace/__init__.py +0 -0
- {polylith_cli-1.44.0 → polylith_cli-1.45.1}/polylith_cli/polylith/workspace/create.py +0 -0
- {polylith_cli-1.44.0 → polylith_cli-1.45.1}/polylith_cli/polylith/workspace/paths.py +0 -0
- {polylith_cli-1.44.0 → polylith_cli-1.45.1}/polylith_cli/polylith/yaml/__init__.py +0 -0
- {polylith_cli-1.44.0 → polylith_cli-1.45.1}/polylith_cli/polylith/yaml/core.py +0 -0
|
@@ -27,6 +27,13 @@ def used_by_as_bricks(bricks: dict, brick_deps: dict) -> dict:
|
|
|
27
27
|
used_by = brick_deps['used_by']
|
|
28
28
|
return {'bases': {b for b in used_by if b in bases}, 'components': {b for b in used_by if b in components}}
|
|
29
29
|
|
|
30
|
+
def print_possible_invalid_bricks_interfaces_usage(root: Path, ns: str, bricks: dict, bricks_deps: dict) -> None:
|
|
31
|
+
flattened_bricks = set().union(*bricks.values())
|
|
32
|
+
bricks_with_deps = {b: bricks_deps[b] for b in flattened_bricks if b in bricks_deps}
|
|
33
|
+
for brick, brick_deps in bricks_with_deps.items():
|
|
34
|
+
used_bricks = used_by_as_bricks(bricks, brick_deps)
|
|
35
|
+
interface.report.print_brick_interface_invalid_usage(root, ns, brick, used_bricks)
|
|
36
|
+
|
|
30
37
|
def run(root: Path, ns: str, options: dict):
|
|
31
38
|
directory = options.get('directory')
|
|
32
39
|
brick = options.get('brick')
|
|
@@ -49,4 +56,6 @@ def run(root: Path, ns: str, options: dict):
|
|
|
49
56
|
deps.print_brick_with_circular_deps(brick, circular_deps, bricks)
|
|
50
57
|
return
|
|
51
58
|
deps.print_deps(bricks, imports, options)
|
|
59
|
+
if show_interface:
|
|
60
|
+
print_possible_invalid_bricks_interfaces_usage(root, ns, bricks, bricks_deps)
|
|
52
61
|
deps.print_bricks_with_circular_deps(circular_bricks, bricks)
|
|
@@ -98,7 +98,7 @@ def print_brick_deps(brick: str, bricks: dict, brick_deps: dict, options: dict):
|
|
|
98
98
|
if save:
|
|
99
99
|
output.save(table, options, f'deps_{brick}')
|
|
100
100
|
|
|
101
|
-
def print_brick_with_circular_deps(brick: str, deps: Set[str], bricks: dict) -> None:
|
|
101
|
+
def print_brick_with_circular_deps(brick: str, deps: Set[str], bricks: dict, padding: Union[tuple, None]=None) -> None:
|
|
102
102
|
bases = bricks['bases']
|
|
103
103
|
console = Console(theme=theme.poly_theme)
|
|
104
104
|
tag = calculate_tag(brick, bases)
|
|
@@ -106,8 +106,11 @@ def print_brick_with_circular_deps(brick: str, deps: Set[str], bricks: dict) ->
|
|
|
106
106
|
others = '[data],[/] '.join(with_tags)
|
|
107
107
|
prefix = ':information:'
|
|
108
108
|
message = f'[{tag}]{brick}[/] [data]is used by[/] {others} [data]and also uses[/] {others}[data].[/]'
|
|
109
|
-
|
|
109
|
+
pad = padding or (1, 0, 0, 1)
|
|
110
|
+
console.print(Padding(f'{prefix} {message}', pad), overflow='ellipsis')
|
|
110
111
|
|
|
111
112
|
def print_bricks_with_circular_deps(circular_bricks: dict, bricks: dict) -> None:
|
|
113
|
+
console = Console(theme=theme.poly_theme)
|
|
114
|
+
console.print()
|
|
112
115
|
for brick, deps in circular_bricks.items():
|
|
113
|
-
print_brick_with_circular_deps(brick, deps, bricks)
|
|
116
|
+
print_brick_with_circular_deps(brick, deps, bricks, (0, 0, 0, 1))
|
|
@@ -3,6 +3,7 @@ from polylith_cli.polylith.interface.collect import get_brick_interface
|
|
|
3
3
|
from polylith_cli.polylith.interface.usage import check_brick_interface_usage, unified_usages
|
|
4
4
|
from polylith_cli.polylith.reporting import theme
|
|
5
5
|
from rich.console import Console
|
|
6
|
+
from rich.padding import Padding
|
|
6
7
|
from rich.table import Table
|
|
7
8
|
|
|
8
9
|
def print_brick_interface(root: Path, ns: str, brick: str, bricks: dict) -> None:
|
|
@@ -17,7 +18,7 @@ def print_brick_interface(root: Path, ns: str, brick: str, bricks: dict) -> None
|
|
|
17
18
|
for endpoint in sorted(brick_interface):
|
|
18
19
|
*_ns, exposes = str.split(endpoint, '.')
|
|
19
20
|
table.add_row(f'[data]{exposes}[/]')
|
|
20
|
-
console.print(table, overflow='ellipsis')
|
|
21
|
+
console.print(Padding(table, (0, 0, 1, 0)), overflow='ellipsis')
|
|
21
22
|
|
|
22
23
|
def print_brick_interface_invalid_usage(root: Path, ns: str, brick: str, bricks: dict) -> None:
|
|
23
24
|
res = check_brick_interface_usage(root, ns, brick, bricks)
|
|
@@ -25,7 +26,6 @@ def print_brick_interface_invalid_usage(root: Path, ns: str, brick: str, bricks:
|
|
|
25
26
|
if not invalid_usage:
|
|
26
27
|
return
|
|
27
28
|
console = Console(theme=theme.poly_theme)
|
|
28
|
-
table = Table(box=None)
|
|
29
29
|
tag = 'base' if brick in bricks['bases'] else 'comp'
|
|
30
30
|
for using_brick, usages in invalid_usage.items():
|
|
31
31
|
using_tag = 'base' if using_brick in bricks['bases'] else 'comp'
|
|
@@ -34,5 +34,4 @@ def print_brick_interface_invalid_usage(root: Path, ns: str, brick: str, bricks:
|
|
|
34
34
|
prefix = f'Found in [{using_tag}]{using_brick}[/]'
|
|
35
35
|
middle = f'[data]{used}[/] is not part of the public interface of [{tag}]{brick}[/]'
|
|
36
36
|
message = f':information: {prefix}: {middle}.'
|
|
37
|
-
|
|
38
|
-
console.print(table, overflow='ellipsis')
|
|
37
|
+
console.print(Padding(f'{message}', (0, 0, 0, 1)), overflow='ellipsis')
|
|
@@ -32,12 +32,7 @@ def generate_updated_pep_621_project(data: TOMLDocument, bricks_to_add: dict) ->
|
|
|
32
32
|
copy['tool']['polylith']['bricks'][k] = v
|
|
33
33
|
return tomlkit.dumps(copy)
|
|
34
34
|
|
|
35
|
-
def
|
|
36
|
-
bricks_to_add: dict = reduce(to_key_value_include, packages, {})
|
|
37
|
-
return generate_updated_pep_621_project(data, bricks_to_add)
|
|
38
|
-
|
|
39
|
-
def generate_updated_hatch_project(data: TOMLDocument, packages: List[dict]) -> str:
|
|
40
|
-
bricks_to_add: dict = reduce(to_key_value_include, packages, {})
|
|
35
|
+
def generate_updated_hatch_project(data: TOMLDocument, bricks_to_add: dict) -> str:
|
|
41
36
|
has_polylith = data.get('tool', {}).get('polylith', {}).get('bricks')
|
|
42
37
|
has_hatch = data.get('tool', {}).get('hatch', {}).get('build', {}).get('force-include')
|
|
43
38
|
if not has_polylith and has_hatch:
|
|
@@ -59,10 +54,11 @@ def generate_updated_poetry_project(data: TOMLDocument, packages: List[dict]) ->
|
|
|
59
54
|
def generate_updated_project(data: TOMLDocument, packages: List[dict]) -> Union[str, None]:
|
|
60
55
|
if repo.is_poetry(data):
|
|
61
56
|
return generate_updated_poetry_project(data, packages)
|
|
57
|
+
bricks_to_add: dict = reduce(to_key_value_include, packages, {})
|
|
62
58
|
if repo.is_hatch(data):
|
|
63
|
-
return generate_updated_hatch_project(data,
|
|
64
|
-
if repo.
|
|
65
|
-
return
|
|
59
|
+
return generate_updated_hatch_project(data, bricks_to_add)
|
|
60
|
+
if repo.is_pep_621_ready(data):
|
|
61
|
+
return generate_updated_pep_621_project(data, bricks_to_add)
|
|
66
62
|
return None
|
|
67
63
|
|
|
68
64
|
def to_packages(root: Path, namespace: str, diff: dict) -> List[dict]:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{polylith_cli-1.44.0 → polylith_cli-1.45.1}/polylith_cli/polylith/development/development.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|