modwire-cli 1.0.0__py3-none-any.whl
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.
- modwire_cli/__init__.py +6 -0
- modwire_cli/_version.py +24 -0
- modwire_cli/main.py +65 -0
- modwire_cli/py.typed +1 -0
- modwire_cli-1.0.0.dist-info/METADATA +78 -0
- modwire_cli-1.0.0.dist-info/RECORD +12 -0
- modwire_cli-1.0.0.dist-info/WHEEL +5 -0
- modwire_cli-1.0.0.dist-info/entry_points.txt +2 -0
- modwire_cli-1.0.0.dist-info/licenses/LICENSE +21 -0
- modwire_cli-1.0.0.dist-info/scm_file_list.json +26 -0
- modwire_cli-1.0.0.dist-info/scm_version.json +8 -0
- modwire_cli-1.0.0.dist-info/top_level.txt +1 -0
modwire_cli/__init__.py
ADDED
modwire_cli/_version.py
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# file generated by vcs-versioning
|
|
2
|
+
# don't change, don't track in version control
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
__all__ = [
|
|
6
|
+
"__version__",
|
|
7
|
+
"__version_tuple__",
|
|
8
|
+
"version",
|
|
9
|
+
"version_tuple",
|
|
10
|
+
"__commit_id__",
|
|
11
|
+
"commit_id",
|
|
12
|
+
]
|
|
13
|
+
|
|
14
|
+
version: str
|
|
15
|
+
__version__: str
|
|
16
|
+
__version_tuple__: tuple[int | str, ...]
|
|
17
|
+
version_tuple: tuple[int | str, ...]
|
|
18
|
+
commit_id: str | None
|
|
19
|
+
__commit_id__: str | None
|
|
20
|
+
|
|
21
|
+
__version__ = version = '1.0.0'
|
|
22
|
+
__version_tuple__ = version_tuple = (1, 0, 0)
|
|
23
|
+
|
|
24
|
+
__commit_id__ = commit_id = None
|
modwire_cli/main.py
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
from pathlib import Path
|
|
2
|
+
|
|
3
|
+
import click
|
|
4
|
+
|
|
5
|
+
from modwire import Modwire
|
|
6
|
+
from modwire.shared.config import ArchitectureConfig, BoundariesConfig, ShapeConfig
|
|
7
|
+
from modwire_extraction import ModwireExtraction
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
CONTEXT_SETTINGS = {"help_option_names": ["-h", "--help"]}
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def load_config(config_dir: Path | None) -> ArchitectureConfig:
|
|
14
|
+
if config_dir is None:
|
|
15
|
+
return ArchitectureConfig()
|
|
16
|
+
try:
|
|
17
|
+
boundaries = BoundariesConfig.from_yaml(
|
|
18
|
+
(config_dir / "boundaries.yaml").read_text(encoding="utf-8")
|
|
19
|
+
)
|
|
20
|
+
shape = ShapeConfig.from_yaml(
|
|
21
|
+
(config_dir / "shape.yaml").read_text(encoding="utf-8")
|
|
22
|
+
)
|
|
23
|
+
except Exception as error:
|
|
24
|
+
raise click.ClickException(f"Unable to load configuration: {error}") from error
|
|
25
|
+
return ArchitectureConfig(boundaries=boundaries, shape=shape)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
@click.group(context_settings=CONTEXT_SETTINGS)
|
|
29
|
+
@click.option(
|
|
30
|
+
"--config-dir",
|
|
31
|
+
"-d",
|
|
32
|
+
type=click.Path(exists=True, file_okay=False, path_type=Path),
|
|
33
|
+
help="Directory containing boundaries.yaml and shape.yaml.",
|
|
34
|
+
)
|
|
35
|
+
@click.version_option(package_name="modwire-cli", prog_name="modwire")
|
|
36
|
+
@click.pass_context
|
|
37
|
+
def cli(context: click.Context, config_dir: Path | None) -> None:
|
|
38
|
+
"""Print Modwire architecture reports."""
|
|
39
|
+
|
|
40
|
+
context.obj = load_config(config_dir)
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
@cli.group()
|
|
44
|
+
def architecture() -> None:
|
|
45
|
+
"""Print architecture catalog and health reports."""
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
@architecture.command()
|
|
49
|
+
@click.pass_obj
|
|
50
|
+
def reports(config: ArchitectureConfig) -> None:
|
|
51
|
+
click.echo(Modwire().architecture(config).reports().to_json())
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
@architecture.command()
|
|
55
|
+
@click.argument("root", type=click.Path(exists=True, file_okay=False, path_type=Path))
|
|
56
|
+
@click.argument("language")
|
|
57
|
+
@click.pass_obj
|
|
58
|
+
def health(config: ArchitectureConfig, root: Path, language: str) -> None:
|
|
59
|
+
try:
|
|
60
|
+
code_map = ModwireExtraction(root).generate_queryable_map(language)
|
|
61
|
+
report_nodes = Modwire().architecture(config).report(code_map)
|
|
62
|
+
except Exception as error:
|
|
63
|
+
raise click.ClickException(f"Unable to produce reports: {error}") from error
|
|
64
|
+
for report in report_nodes:
|
|
65
|
+
click.echo(report.to_json())
|
modwire_cli/py.typed
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: modwire-cli
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Command-line runtime for the Modwire ecosystem.
|
|
5
|
+
Author: Tomasz Szpak
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/modwire/modwire-cli
|
|
8
|
+
Project-URL: Repository, https://github.com/modwire/modwire-cli
|
|
9
|
+
Project-URL: Issues, https://github.com/modwire/modwire-cli/issues
|
|
10
|
+
Project-URL: Changelog, https://github.com/modwire/modwire-cli/blob/main/CHANGELOG.md
|
|
11
|
+
Keywords: architecture,cli,code-analysis,modwire,static-analysis
|
|
12
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
13
|
+
Classifier: Environment :: Console
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: Operating System :: OS Independent
|
|
16
|
+
Classifier: Programming Language :: Python
|
|
17
|
+
Classifier: Programming Language :: Python :: 3
|
|
18
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
22
|
+
Classifier: Typing :: Typed
|
|
23
|
+
Classifier: Topic :: Software Development :: Quality Assurance
|
|
24
|
+
Requires-Python: >=3.12
|
|
25
|
+
Description-Content-Type: text/markdown
|
|
26
|
+
License-File: LICENSE
|
|
27
|
+
Requires-Dist: click>=8.1
|
|
28
|
+
Requires-Dist: modwire<6,>=5
|
|
29
|
+
Requires-Dist: modwire-extraction<3,>=2
|
|
30
|
+
Provides-Extra: dev
|
|
31
|
+
Requires-Dist: build>=1.2; extra == "dev"
|
|
32
|
+
Requires-Dist: pytest>=8; extra == "dev"
|
|
33
|
+
Requires-Dist: ruff>=0.8; extra == "dev"
|
|
34
|
+
Requires-Dist: twine>=5; extra == "dev"
|
|
35
|
+
Dynamic: license-file
|
|
36
|
+
|
|
37
|
+
# modwire-cli
|
|
38
|
+
|
|
39
|
+
The thin command-line reporter for the Modwire ecosystem. It extracts a source
|
|
40
|
+
map, calls Modwire, and prints Modwire's reports.
|
|
41
|
+
|
|
42
|
+
## Installation
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
python -m pip install modwire-cli
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Python 3.12 or newer is required.
|
|
49
|
+
|
|
50
|
+
## Usage
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
modwire architecture reports
|
|
54
|
+
modwire --config-dir .modwire architecture health src python
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
For development:
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
uv sync --all-groups
|
|
61
|
+
uv run pytest
|
|
62
|
+
uv build
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Run the same checks used by CI with `make verify`.
|
|
66
|
+
|
|
67
|
+
## Release
|
|
68
|
+
|
|
69
|
+
Releases use strict `vX.Y.Z` tags. Before creating the first release, configure
|
|
70
|
+
the `pypi` environment and a Trusted Publisher for the `modwire/modwire-cli`
|
|
71
|
+
GitHub repository on PyPI. Then publish a GitHub release:
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
gh release create v1.0.0 --target main --generate-notes --title v1.0.0
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
The release workflow verifies the tag and distribution metadata, publishes to
|
|
78
|
+
PyPI without a long-lived token, and attaches the distributions to the release.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
modwire_cli/__init__.py,sha256=fn0qYs4J3CaCZcCUK4oUL6RGH7Ifl3JPA6Eyrj9yx_s,145
|
|
2
|
+
modwire_cli/_version.py,sha256=JAAyU3al4wmBf3BF-Umm1J_GrCIT-yS_yWEGHqKRVHc,520
|
|
3
|
+
modwire_cli/main.py,sha256=MvWGpjmXPrealuT8qyv2K6km8z3KO6NYYvqmhsDbe24,2140
|
|
4
|
+
modwire_cli/py.typed,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
|
5
|
+
modwire_cli-1.0.0.dist-info/licenses/LICENSE,sha256=DxXQa2s8pS_YG13iuO5CsomZ7N2BQc8BA41Il8nu5F4,1069
|
|
6
|
+
modwire_cli-1.0.0.dist-info/METADATA,sha256=LKWsxaTSMgAfYBn9f6eSm3VM3xUDdikLHAG8Z37kZdg,2416
|
|
7
|
+
modwire_cli-1.0.0.dist-info/WHEEL,sha256=K260EYznzXsJYBQGqmI8VTxEdiZYNvDZwW9cBh9-_MA,91
|
|
8
|
+
modwire_cli-1.0.0.dist-info/entry_points.txt,sha256=4b52m8nrabKD6g3wwsxi5D1LOndxPxAG96NqMhrLmJQ,44
|
|
9
|
+
modwire_cli-1.0.0.dist-info/scm_file_list.json,sha256=IJ6W1-nziLwk-yqtnEyRJDi0jlEB8yJ87E4jbIZUPd0,679
|
|
10
|
+
modwire_cli-1.0.0.dist-info/scm_version.json,sha256=a3dOJsC5TN-huuWvYubLbeliUABJu6gXy_JH4XdPABM,160
|
|
11
|
+
modwire_cli-1.0.0.dist-info/top_level.txt,sha256=YPg1MUQZIrur2bqK66KoW1TYkyVHty5C_YQVijq6kCg,12
|
|
12
|
+
modwire_cli-1.0.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Tomasz Szpak
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"files": [
|
|
3
|
+
"README.md",
|
|
4
|
+
"uv.lock",
|
|
5
|
+
"Makefile",
|
|
6
|
+
"LICENSE",
|
|
7
|
+
"pyproject.toml",
|
|
8
|
+
"CHANGELOG.md",
|
|
9
|
+
"MANIFEST.in",
|
|
10
|
+
".gitignore",
|
|
11
|
+
"scripts/verify_release.py",
|
|
12
|
+
"src/modwire_cli/py.typed",
|
|
13
|
+
"src/modwire_cli/__init__.py",
|
|
14
|
+
"src/modwire_cli/main.py",
|
|
15
|
+
"tests/test_release.py",
|
|
16
|
+
"tests/test_cli.py",
|
|
17
|
+
".github/ISSUE_TEMPLATE/bug_report.yml",
|
|
18
|
+
".github/ISSUE_TEMPLATE/config.yml",
|
|
19
|
+
".github/ISSUE_TEMPLATE/feature_request.yml",
|
|
20
|
+
".github/ISSUE_TEMPLATE/task.yml",
|
|
21
|
+
".github/workflows/release.yml",
|
|
22
|
+
".github/workflows/issue-metadata.yml",
|
|
23
|
+
".github/workflows/ci.yml",
|
|
24
|
+
".github/workflows/human-approval.yml"
|
|
25
|
+
]
|
|
26
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
modwire_cli
|