polylith-cli 1.1.2__tar.gz → 1.2.0__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.1.2 → polylith_cli-1.2.0}/PKG-INFO +1 -1
- {polylith_cli-1.1.2 → polylith_cli-1.2.0}/polylith_cli/polylith/commands/create.py +1 -1
- {polylith_cli-1.1.2 → polylith_cli-1.2.0}/polylith_cli/polylith/repo/repo.py +7 -3
- {polylith_cli-1.1.2 → polylith_cli-1.2.0}/polylith_cli/polylith/workspace/parser.py +2 -0
- {polylith_cli-1.1.2 → polylith_cli-1.2.0}/pyproject.toml +1 -1
- {polylith_cli-1.1.2 → polylith_cli-1.2.0}/README.md +0 -0
- {polylith_cli-1.1.2 → polylith_cli-1.2.0}/polylith_cli/polylith/alias/__init__.py +0 -0
- {polylith_cli-1.1.2 → polylith_cli-1.2.0}/polylith_cli/polylith/alias/core.py +0 -0
- {polylith_cli-1.1.2 → polylith_cli-1.2.0}/polylith_cli/polylith/bricks/__init__.py +0 -0
- {polylith_cli-1.1.2 → polylith_cli-1.2.0}/polylith_cli/polylith/bricks/base.py +0 -0
- {polylith_cli-1.1.2 → polylith_cli-1.2.0}/polylith_cli/polylith/bricks/brick.py +0 -0
- {polylith_cli-1.1.2 → polylith_cli-1.2.0}/polylith_cli/polylith/bricks/component.py +0 -0
- {polylith_cli-1.1.2 → polylith_cli-1.2.0}/polylith_cli/polylith/check/__init__.py +0 -0
- {polylith_cli-1.1.2 → polylith_cli-1.2.0}/polylith_cli/polylith/check/collect.py +0 -0
- {polylith_cli-1.1.2 → polylith_cli-1.2.0}/polylith_cli/polylith/check/grouping.py +0 -0
- {polylith_cli-1.1.2 → polylith_cli-1.2.0}/polylith_cli/polylith/check/report.py +0 -0
- {polylith_cli-1.1.2 → polylith_cli-1.2.0}/polylith_cli/polylith/cli/__init__.py +0 -0
- {polylith_cli-1.1.2 → polylith_cli-1.2.0}/polylith_cli/polylith/cli/__main__.py +0 -0
- {polylith_cli-1.1.2 → polylith_cli-1.2.0}/polylith_cli/polylith/cli/core.py +0 -0
- {polylith_cli-1.1.2 → polylith_cli-1.2.0}/polylith_cli/polylith/cli/create.py +0 -0
- {polylith_cli-1.1.2 → polylith_cli-1.2.0}/polylith_cli/polylith/cli/options.py +0 -0
- {polylith_cli-1.1.2 → polylith_cli-1.2.0}/polylith_cli/polylith/commands/__init__.py +0 -0
- {polylith_cli-1.1.2 → polylith_cli-1.2.0}/polylith_cli/polylith/commands/check.py +0 -0
- {polylith_cli-1.1.2 → polylith_cli-1.2.0}/polylith_cli/polylith/commands/diff.py +0 -0
- {polylith_cli-1.1.2 → polylith_cli-1.2.0}/polylith_cli/polylith/commands/info.py +0 -0
- {polylith_cli-1.1.2 → polylith_cli-1.2.0}/polylith_cli/polylith/commands/libs.py +0 -0
- {polylith_cli-1.1.2 → polylith_cli-1.2.0}/polylith_cli/polylith/commands/sync.py +0 -0
- {polylith_cli-1.1.2 → polylith_cli-1.2.0}/polylith_cli/polylith/development/__init__.py +0 -0
- {polylith_cli-1.1.2 → polylith_cli-1.2.0}/polylith_cli/polylith/development/development.py +0 -0
- {polylith_cli-1.1.2 → polylith_cli-1.2.0}/polylith_cli/polylith/diff/__init__.py +0 -0
- {polylith_cli-1.1.2 → polylith_cli-1.2.0}/polylith_cli/polylith/diff/collect.py +0 -0
- {polylith_cli-1.1.2 → polylith_cli-1.2.0}/polylith_cli/polylith/diff/report.py +0 -0
- {polylith_cli-1.1.2 → polylith_cli-1.2.0}/polylith_cli/polylith/dirs/__init__.py +0 -0
- {polylith_cli-1.1.2 → polylith_cli-1.2.0}/polylith_cli/polylith/dirs/dirs.py +0 -0
- {polylith_cli-1.1.2 → polylith_cli-1.2.0}/polylith_cli/polylith/distributions/__init__.py +0 -0
- {polylith_cli-1.1.2 → polylith_cli-1.2.0}/polylith_cli/polylith/distributions/collect.py +0 -0
- {polylith_cli-1.1.2 → polylith_cli-1.2.0}/polylith_cli/polylith/distributions/core.py +0 -0
- {polylith_cli-1.1.2 → polylith_cli-1.2.0}/polylith_cli/polylith/files/__init__.py +0 -0
- {polylith_cli-1.1.2 → polylith_cli-1.2.0}/polylith_cli/polylith/files/files.py +0 -0
- {polylith_cli-1.1.2 → polylith_cli-1.2.0}/polylith_cli/polylith/imports/__init__.py +0 -0
- {polylith_cli-1.1.2 → polylith_cli-1.2.0}/polylith_cli/polylith/imports/parser.py +0 -0
- {polylith_cli-1.1.2 → polylith_cli-1.2.0}/polylith_cli/polylith/info/__init__.py +0 -0
- {polylith_cli-1.1.2 → polylith_cli-1.2.0}/polylith_cli/polylith/info/collect.py +0 -0
- {polylith_cli-1.1.2 → polylith_cli-1.2.0}/polylith_cli/polylith/info/report.py +0 -0
- {polylith_cli-1.1.2 → polylith_cli-1.2.0}/polylith_cli/polylith/interface/__init__.py +0 -0
- {polylith_cli-1.1.2 → polylith_cli-1.2.0}/polylith_cli/polylith/interface/interfaces.py +0 -0
- {polylith_cli-1.1.2 → polylith_cli-1.2.0}/polylith_cli/polylith/libs/__init__.py +0 -0
- {polylith_cli-1.1.2 → polylith_cli-1.2.0}/polylith_cli/polylith/libs/grouping.py +0 -0
- {polylith_cli-1.1.2 → polylith_cli-1.2.0}/polylith_cli/polylith/libs/report.py +0 -0
- {polylith_cli-1.1.2 → polylith_cli-1.2.0}/polylith_cli/polylith/libs/stdlib.py +0 -0
- {polylith_cli-1.1.2 → polylith_cli-1.2.0}/polylith_cli/polylith/project/__init__.py +0 -0
- {polylith_cli-1.1.2 → polylith_cli-1.2.0}/polylith_cli/polylith/project/create.py +0 -0
- {polylith_cli-1.1.2 → polylith_cli-1.2.0}/polylith_cli/polylith/project/get.py +0 -0
- {polylith_cli-1.1.2 → polylith_cli-1.2.0}/polylith_cli/polylith/project/parser.py +0 -0
- {polylith_cli-1.1.2 → polylith_cli-1.2.0}/polylith_cli/polylith/project/templates.py +0 -0
- {polylith_cli-1.1.2 → polylith_cli-1.2.0}/polylith_cli/polylith/readme/__init__.py +0 -0
- {polylith_cli-1.1.2 → polylith_cli-1.2.0}/polylith_cli/polylith/readme/readme.py +0 -0
- {polylith_cli-1.1.2 → polylith_cli-1.2.0}/polylith_cli/polylith/repo/__init__.py +0 -0
- {polylith_cli-1.1.2 → polylith_cli-1.2.0}/polylith_cli/polylith/repo/get.py +0 -0
- {polylith_cli-1.1.2 → polylith_cli-1.2.0}/polylith_cli/polylith/reporting/__init__.py +0 -0
- {polylith_cli-1.1.2 → polylith_cli-1.2.0}/polylith_cli/polylith/reporting/theme.py +0 -0
- {polylith_cli-1.1.2 → polylith_cli-1.2.0}/polylith_cli/polylith/sync/__init__.py +0 -0
- {polylith_cli-1.1.2 → polylith_cli-1.2.0}/polylith_cli/polylith/sync/collect.py +0 -0
- {polylith_cli-1.1.2 → polylith_cli-1.2.0}/polylith_cli/polylith/sync/report.py +0 -0
- {polylith_cli-1.1.2 → polylith_cli-1.2.0}/polylith_cli/polylith/sync/update.py +0 -0
- {polylith_cli-1.1.2 → polylith_cli-1.2.0}/polylith_cli/polylith/test/__init__.py +0 -0
- {polylith_cli-1.1.2 → polylith_cli-1.2.0}/polylith_cli/polylith/test/tests.py +0 -0
- {polylith_cli-1.1.2 → polylith_cli-1.2.0}/polylith_cli/polylith/toml/__init__.py +0 -0
- {polylith_cli-1.1.2 → polylith_cli-1.2.0}/polylith_cli/polylith/toml/core.py +0 -0
- {polylith_cli-1.1.2 → polylith_cli-1.2.0}/polylith_cli/polylith/workspace/__init__.py +0 -0
- {polylith_cli-1.1.2 → polylith_cli-1.2.0}/polylith_cli/polylith/workspace/create.py +0 -0
- {polylith_cli-1.1.2 → polylith_cli-1.2.0}/polylith_cli/polylith/workspace/paths.py +0 -0
|
@@ -8,6 +8,6 @@ def create(name: Union[str, None], description: Union[str, None], fn):
|
|
|
8
8
|
if not name:
|
|
9
9
|
raise ValueError('Please add a name by using --name')
|
|
10
10
|
if not namespace:
|
|
11
|
-
raise ValueError("Didn't find a namespace. Expected to find it in workspace.toml.")
|
|
11
|
+
raise ValueError("Didn't find a namespace. Expected to find it under [tool.polylith] in workspace.toml or pyproject.toml.")
|
|
12
12
|
options = {'namespace': namespace, 'package': name, 'description': description, 'modulename': 'core'}
|
|
13
13
|
fn(root, options)
|
|
@@ -2,6 +2,7 @@ from pathlib import Path
|
|
|
2
2
|
from typing import Union
|
|
3
3
|
|
|
4
4
|
workspace_file = "workspace.toml"
|
|
5
|
+
root_file = ".git"
|
|
5
6
|
default_toml = "pyproject.toml"
|
|
6
7
|
readme_file = "README.md"
|
|
7
8
|
|
|
@@ -16,7 +17,7 @@ def is_drive_root(cwd: Path) -> bool:
|
|
|
16
17
|
|
|
17
18
|
|
|
18
19
|
def is_repo_root(cwd: Path) -> bool:
|
|
19
|
-
fullpath = cwd /
|
|
20
|
+
fullpath = cwd / root_file
|
|
20
21
|
|
|
21
22
|
return fullpath.exists()
|
|
22
23
|
|
|
@@ -43,7 +44,10 @@ def find_upwards_dir(cwd: Path, name: str) -> Union[Path, None]:
|
|
|
43
44
|
|
|
44
45
|
|
|
45
46
|
def find_workspace_root(cwd: Path) -> Union[Path, None]:
|
|
46
|
-
|
|
47
|
+
workspace_root = find_upwards_dir(cwd, workspace_file)
|
|
48
|
+
if workspace_root:
|
|
49
|
+
return workspace_root
|
|
50
|
+
return find_upwards_dir(cwd, root_file)
|
|
47
51
|
|
|
48
52
|
|
|
49
53
|
def get_workspace_root(cwd: Path) -> Path:
|
|
@@ -51,7 +55,7 @@ def get_workspace_root(cwd: Path) -> Path:
|
|
|
51
55
|
|
|
52
56
|
if not root:
|
|
53
57
|
raise ValueError(
|
|
54
|
-
"Didn't find the workspace root. Expected to find a workspace.toml file."
|
|
58
|
+
"Didn't find the workspace root. Expected to find a workspace.toml or .git file."
|
|
55
59
|
)
|
|
56
60
|
|
|
57
61
|
return root
|
|
@@ -7,6 +7,8 @@ from polylith_cli.polylith import repo
|
|
|
7
7
|
@lru_cache
|
|
8
8
|
def _load_workspace_config(path: Path) -> tomlkit.TOMLDocument:
|
|
9
9
|
fullpath = path / repo.workspace_file
|
|
10
|
+
if not fullpath.exists():
|
|
11
|
+
fullpath = path / repo.default_toml
|
|
10
12
|
content = fullpath.read_text()
|
|
11
13
|
return tomlkit.loads(content)
|
|
12
14
|
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|