modwire 2.2.0__tar.gz → 3.0.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.
- {modwire-2.2.0 → modwire-3.0.0}/.github/ISSUE_TEMPLATE/bug_report.yml +10 -10
- {modwire-2.2.0 → modwire-3.0.0}/.github/ISSUE_TEMPLATE/feature_request.yml +6 -7
- {modwire-2.2.0 → modwire-3.0.0}/.github/workflows/ci.yml +0 -15
- {modwire-2.2.0 → modwire-3.0.0}/.github/workflows/release.yml +0 -15
- modwire-3.0.0/CHANGELOG.md +31 -0
- {modwire-2.2.0 → modwire-3.0.0}/CONTRIBUTING.md +6 -11
- modwire-3.0.0/PKG-INFO +175 -0
- modwire-3.0.0/README.md +141 -0
- modwire-3.0.0/docs/wiki/Development-checks.md +18 -0
- modwire-3.0.0/docs/wiki/Home.md +25 -0
- {modwire-2.2.0 → modwire-3.0.0}/docs/wiki/Reporting-bugs.md +5 -7
- {modwire-2.2.0 → modwire-3.0.0}/pyproject.toml +5 -7
- modwire-3.0.0/src/modwire/__init__.py +6 -0
- {modwire-2.2.0 → modwire-3.0.0}/src/modwire/_version.py +3 -3
- modwire-3.0.0/src/modwire/architecture/__init__.py +26 -0
- modwire-3.0.0/src/modwire/architecture/boundaries/__init__.py +0 -0
- modwire-3.0.0/src/modwire/architecture/boundaries/analyzers/__init__.py +0 -0
- modwire-3.0.0/src/modwire/architecture/boundaries/analyzers/backward.py +35 -0
- modwire-3.0.0/src/modwire/architecture/boundaries/analyzers/no_cycles.py +88 -0
- modwire-3.0.0/src/modwire/architecture/boundaries/analyzers/no_reentry.py +74 -0
- modwire-3.0.0/src/modwire/architecture/boundaries/base.py +93 -0
- modwire-3.0.0/src/modwire/architecture/boundaries/config.py +43 -0
- modwire-3.0.0/src/modwire/architecture/boundaries/map.py +155 -0
- modwire-3.0.0/src/modwire/architecture/boundaries/pipeline.py +108 -0
- modwire-3.0.0/src/modwire/architecture/boundaries/tags/__init__.py +0 -0
- modwire-3.0.0/src/modwire/architecture/boundaries/tags/matcher.py +131 -0
- modwire-3.0.0/src/modwire/architecture/boundaries/tags/tag_map.py +24 -0
- modwire-3.0.0/src/modwire/architecture/config.py +14 -0
- modwire-3.0.0/src/modwire/architecture/insight/__init__.py +0 -0
- modwire-3.0.0/src/modwire/architecture/insight/base.py +14 -0
- modwire-3.0.0/src/modwire/architecture/insight/pipeline.py +92 -0
- modwire-3.0.0/src/modwire/architecture/insight/reports/__init__.py +22 -0
- modwire-3.0.0/src/modwire/architecture/insight/reports/callables.py +54 -0
- modwire-3.0.0/src/modwire/architecture/insight/reports/clusters.py +119 -0
- modwire-3.0.0/src/modwire/architecture/insight/reports/coherence.py +56 -0
- modwire-3.0.0/src/modwire/architecture/insight/reports/exports.py +64 -0
- modwire-3.0.0/src/modwire/architecture/insight/reports/hotspots.py +57 -0
- modwire-3.0.0/src/modwire/architecture/report.py +102 -0
- modwire-3.0.0/src/modwire/architecture/root.py +18 -0
- modwire-3.0.0/src/modwire/architecture/shape/__init__.py +0 -0
- modwire-3.0.0/src/modwire/architecture/shape/base.py +52 -0
- modwire-3.0.0/src/modwire/architecture/shape/config.py +45 -0
- modwire-3.0.0/src/modwire/architecture/shape/pipeline.py +95 -0
- modwire-3.0.0/src/modwire/architecture/shape/rules/__init__.py +20 -0
- modwire-3.0.0/src/modwire/architecture/shape/rules/abstract_class_resolver.py +60 -0
- modwire-3.0.0/src/modwire/architecture/shape/rules/callable_resolver.py +129 -0
- modwire-3.0.0/src/modwire/architecture/shape/rules/class_resolver.py +89 -0
- modwire-3.0.0/src/modwire/architecture/shape/rules/file_resolver.py +57 -0
- modwire-3.0.0/src/modwire/architecture/shape/rules/import_resolver.py +58 -0
- modwire-3.0.0/src/modwire/architecture/shape/rules/property_resolver.py +81 -0
- modwire-3.0.0/src/modwire/architecture/shape/rules/signature_resolver.py +75 -0
- modwire-3.0.0/src/modwire/architecture/shape/rules/symbol_resolver.py +34 -0
- modwire-3.0.0/src/modwire.egg-info/PKG-INFO +175 -0
- modwire-3.0.0/src/modwire.egg-info/SOURCES.txt +67 -0
- {modwire-2.2.0 → modwire-3.0.0}/src/modwire.egg-info/requires.txt +1 -0
- modwire-3.0.0/src/modwire.egg-info/scm_file_list.json +63 -0
- modwire-3.0.0/src/modwire.egg-info/scm_version.json +8 -0
- modwire-3.0.0/tests/architecture/boundaries/test_map.py +69 -0
- modwire-3.0.0/tests/architecture/boundaries/test_pipeline.py +122 -0
- modwire-3.0.0/tests/architecture/test_report.py +110 -0
- {modwire-2.2.0 → modwire-3.0.0}/uv.lock +64 -41
- modwire-2.2.0/.github/workflows/large-repo-fixtures.yml +0 -88
- modwire-2.2.0/PKG-INFO +0 -252
- modwire-2.2.0/README.md +0 -219
- modwire-2.2.0/docs/wiki/Development-checks.md +0 -23
- modwire-2.2.0/docs/wiki/Home.md +0 -31
- modwire-2.2.0/show_test_source_files.py +0 -28
- modwire-2.2.0/src/modwire/__init__.py +0 -96
- modwire-2.2.0/src/modwire/architecture/__init__.py +0 -59
- modwire-2.2.0/src/modwire/architecture/analyzers.py +0 -159
- modwire-2.2.0/src/modwire/architecture/config.py +0 -126
- modwire-2.2.0/src/modwire/architecture/insights.py +0 -246
- modwire-2.2.0/src/modwire/architecture/matching.py +0 -153
- modwire-2.2.0/src/modwire/architecture/policy.py +0 -69
- modwire-2.2.0/src/modwire/architecture/render.py +0 -99
- modwire-2.2.0/src/modwire/architecture/violations.py +0 -47
- modwire-2.2.0/src/modwire/callables.py +0 -162
- modwire-2.2.0/src/modwire/definitions.py +0 -200
- modwire-2.2.0/src/modwire/exports.py +0 -188
- modwire-2.2.0/src/modwire/extraction/__init__.py +0 -33
- modwire-2.2.0/src/modwire/extraction/cache.py +0 -92
- modwire-2.2.0/src/modwire/extraction/manifest.py +0 -98
- modwire-2.2.0/src/modwire/extraction/models.py +0 -199
- modwire-2.2.0/src/modwire/extraction/roots.py +0 -100
- modwire-2.2.0/src/modwire/extraction/serialization.py +0 -107
- modwire-2.2.0/src/modwire/extraction/service.py +0 -100
- modwire-2.2.0/src/modwire/extractors/__init__.py +0 -5
- modwire-2.2.0/src/modwire/extractors/base.py +0 -781
- modwire-2.2.0/src/modwire/extractors/loader.py +0 -36
- modwire-2.2.0/src/modwire/extractors/php.py +0 -348
- modwire-2.2.0/src/modwire/extractors/python.py +0 -472
- modwire-2.2.0/src/modwire/extractors/resources.py +0 -29
- modwire-2.2.0/src/modwire/extractors/scripts/__init__.py +0 -2
- modwire-2.2.0/src/modwire/extractors/scripts/php_extractor.php +0 -1344
- modwire-2.2.0/src/modwire/extractors/scripts/python_extractor.py +0 -1000
- modwire-2.2.0/src/modwire/extractors/scripts/typescript_extractor.js +0 -1727
- modwire-2.2.0/src/modwire/extractors/typescript.py +0 -97
- modwire-2.2.0/src/modwire/graph.py +0 -116
- modwire-2.2.0/src/modwire/metadata.py +0 -124
- modwire-2.2.0/src/modwire/shape/__init__.py +0 -16
- modwire-2.2.0/src/modwire/shape/config.py +0 -93
- modwire-2.2.0/src/modwire/shape/evaluator.py +0 -32
- modwire-2.2.0/src/modwire/shape/rules.py +0 -389
- modwire-2.2.0/src/modwire/shape/violations.py +0 -23
- modwire-2.2.0/src/modwire/testing/__init__.py +0 -24
- modwire-2.2.0/src/modwire/testing/factories.py +0 -277
- modwire-2.2.0/src/modwire.egg-info/PKG-INFO +0 -252
- modwire-2.2.0/src/modwire.egg-info/SOURCES.txt +0 -87
- modwire-2.2.0/tests/apps/php/ignored/generated.php +0 -6
- modwire-2.2.0/tests/apps/php/src/application/use_cases/activate.php +0 -28
- modwire-2.2.0/tests/apps/php/src/domain/model/user.php +0 -16
- modwire-2.2.0/tests/apps/php/src/domain/services/policy.php +0 -17
- modwire-2.2.0/tests/apps/php/src/interfaces/http/controller.php +0 -18
- modwire-2.2.0/tests/apps/python/ignored/generated.py +0 -5
- modwire-2.2.0/tests/apps/python/src/application/use_cases/activate.py +0 -26
- modwire-2.2.0/tests/apps/python/src/domain/model/user.py +0 -11
- modwire-2.2.0/tests/apps/python/src/domain/services/policy.py +0 -10
- modwire-2.2.0/tests/apps/python/src/interfaces/http/controller.py +0 -14
- modwire-2.2.0/tests/apps/typescript/ignored/generated.ts +0 -3
- modwire-2.2.0/tests/apps/typescript/src/application/use_cases/activate.ts +0 -24
- modwire-2.2.0/tests/apps/typescript/src/domain/model/profile.tsx +0 -5
- modwire-2.2.0/tests/apps/typescript/src/domain/model/user.ts +0 -11
- modwire-2.2.0/tests/apps/typescript/src/domain/services/audit.js +0 -3
- modwire-2.2.0/tests/apps/typescript/src/domain/services/policy.ts +0 -11
- modwire-2.2.0/tests/apps/typescript/src/interfaces/http/controller.ts +0 -13
- modwire-2.2.0/tests/apps/typescript/src/interfaces/http/view.jsx +0 -3
- modwire-2.2.0/tests/large_projects/README.md +0 -47
- modwire-2.2.0/tests/large_projects/fixtures.json +0 -242
- modwire-2.2.0/tests/large_projects/run_large_project_fixtures.py +0 -534
- modwire-2.2.0/tests/test_api.py +0 -2234
- modwire-2.2.0/tests/test_architecture_api.py +0 -360
- modwire-2.2.0/tests/test_standalone.py +0 -44
- {modwire-2.2.0 → modwire-3.0.0}/.github/ISSUE_TEMPLATE/config.yml +0 -0
- {modwire-2.2.0 → modwire-3.0.0}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
- {modwire-2.2.0 → modwire-3.0.0}/.gitignore +0 -0
- {modwire-2.2.0 → modwire-3.0.0}/LICENSE +0 -0
- {modwire-2.2.0 → modwire-3.0.0}/docs/wiki/Requesting-features.md +0 -0
- {modwire-2.2.0 → modwire-3.0.0}/setup.cfg +0 -0
- {modwire-2.2.0 → modwire-3.0.0}/src/modwire.egg-info/dependency_links.txt +0 -0
- {modwire-2.2.0 → modwire-3.0.0}/src/modwire.egg-info/top_level.txt +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
name: Bug report
|
|
2
|
-
description: Report incorrect
|
|
2
|
+
description: Report incorrect architecture analysis, graph output, package metadata, or report output.
|
|
3
3
|
title: "Bug: "
|
|
4
4
|
labels:
|
|
5
5
|
- bug
|
|
@@ -7,7 +7,7 @@ body:
|
|
|
7
7
|
- type: markdown
|
|
8
8
|
attributes:
|
|
9
9
|
value: |
|
|
10
|
-
Thanks for reporting a bug. Clear reproduction details make it much easier to fix issues in
|
|
10
|
+
Thanks for reporting a bug. Clear reproduction details make it much easier to fix issues in architecture analysis, report output, and package metadata.
|
|
11
11
|
|
|
12
12
|
- type: textarea
|
|
13
13
|
id: summary
|
|
@@ -23,11 +23,11 @@ body:
|
|
|
23
23
|
attributes:
|
|
24
24
|
label: Affected area
|
|
25
25
|
options:
|
|
26
|
-
-
|
|
27
|
-
- TypeScript/JavaScript extractor
|
|
28
|
-
- PHP extractor
|
|
29
|
-
- Dependency graph
|
|
26
|
+
- Dependency graph report
|
|
30
27
|
- Architecture policy API
|
|
28
|
+
- Shape policy API
|
|
29
|
+
- Callable report
|
|
30
|
+
- Unused export report
|
|
31
31
|
- Packaging or installation
|
|
32
32
|
- Documentation
|
|
33
33
|
- Other
|
|
@@ -59,7 +59,7 @@ body:
|
|
|
59
59
|
id: expected
|
|
60
60
|
attributes:
|
|
61
61
|
label: Expected output
|
|
62
|
-
description: Describe the graph,
|
|
62
|
+
description: Describe the graph, report entries, or violations you expected.
|
|
63
63
|
validations:
|
|
64
64
|
required: false
|
|
65
65
|
|
|
@@ -83,9 +83,9 @@ body:
|
|
|
83
83
|
- type: input
|
|
84
84
|
id: runtime-versions
|
|
85
85
|
attributes:
|
|
86
|
-
label:
|
|
87
|
-
description:
|
|
88
|
-
placeholder: "
|
|
86
|
+
label: modwire-extraction version, if relevant
|
|
87
|
+
description: Include the producer version when the issue depends on source metadata.
|
|
88
|
+
placeholder: "1.0.1 or not applicable"
|
|
89
89
|
validations:
|
|
90
90
|
required: false
|
|
91
91
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
name: Feature request
|
|
2
|
-
description: Suggest a new
|
|
2
|
+
description: Suggest a new architecture, graph, shape, callable, export, or integration capability.
|
|
3
3
|
title: "Feature: "
|
|
4
4
|
labels:
|
|
5
5
|
- enhancement
|
|
@@ -23,13 +23,12 @@ body:
|
|
|
23
23
|
attributes:
|
|
24
24
|
label: Feature area
|
|
25
25
|
options:
|
|
26
|
-
-
|
|
27
|
-
- Python extractor
|
|
28
|
-
- TypeScript/JavaScript extractor
|
|
29
|
-
- PHP extractor
|
|
30
|
-
- Dependency graph
|
|
26
|
+
- Dependency graph report
|
|
31
27
|
- Architecture policy API
|
|
32
|
-
-
|
|
28
|
+
- Shape policy API
|
|
29
|
+
- Callable report
|
|
30
|
+
- Unused export report
|
|
31
|
+
- Integrations
|
|
33
32
|
- Documentation
|
|
34
33
|
- Other
|
|
35
34
|
validations:
|
|
@@ -27,16 +27,6 @@ jobs:
|
|
|
27
27
|
with:
|
|
28
28
|
python-version: ${{ matrix.python-version }}
|
|
29
29
|
|
|
30
|
-
- name: Set up Node.js
|
|
31
|
-
uses: actions/setup-node@v4
|
|
32
|
-
with:
|
|
33
|
-
node-version: "20"
|
|
34
|
-
|
|
35
|
-
- name: Set up PHP
|
|
36
|
-
uses: shivammathur/setup-php@v2
|
|
37
|
-
with:
|
|
38
|
-
php-version: "8.3"
|
|
39
|
-
|
|
40
30
|
- name: Clean packaging artifacts
|
|
41
31
|
run: rm -rf .dev build dist src/*.egg-info
|
|
42
32
|
|
|
@@ -48,11 +38,6 @@ jobs:
|
|
|
48
38
|
- name: Run unit tests
|
|
49
39
|
run: python -m pytest
|
|
50
40
|
|
|
51
|
-
- name: Validate extractor syntax
|
|
52
|
-
run: |
|
|
53
|
-
node --check src/modwire/extractors/scripts/typescript_extractor.js
|
|
54
|
-
php -l src/modwire/extractors/scripts/php_extractor.php
|
|
55
|
-
|
|
56
41
|
- name: Build distributions
|
|
57
42
|
run: python -m build --outdir dist
|
|
58
43
|
|
|
@@ -51,16 +51,6 @@ jobs:
|
|
|
51
51
|
with:
|
|
52
52
|
python-version: "3.12"
|
|
53
53
|
|
|
54
|
-
- name: Set up Node.js
|
|
55
|
-
uses: actions/setup-node@v4
|
|
56
|
-
with:
|
|
57
|
-
node-version: "20"
|
|
58
|
-
|
|
59
|
-
- name: Set up PHP
|
|
60
|
-
uses: shivammathur/setup-php@v2
|
|
61
|
-
with:
|
|
62
|
-
php-version: "8.3"
|
|
63
|
-
|
|
64
54
|
- name: Clean packaging artifacts
|
|
65
55
|
run: rm -rf .dev build dist src/*.egg-info
|
|
66
56
|
|
|
@@ -93,11 +83,6 @@ jobs:
|
|
|
93
83
|
- name: Run tests
|
|
94
84
|
run: python -m pytest
|
|
95
85
|
|
|
96
|
-
- name: Validate extractor syntax
|
|
97
|
-
run: |
|
|
98
|
-
node --check src/modwire/extractors/scripts/typescript_extractor.js
|
|
99
|
-
php -l src/modwire/extractors/scripts/php_extractor.php
|
|
100
|
-
|
|
101
86
|
- name: Build distributions
|
|
102
87
|
run: python -m build --outdir dist
|
|
103
88
|
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 3.0.0 - Unreleased
|
|
4
|
+
|
|
5
|
+
### Breaking Changes
|
|
6
|
+
|
|
7
|
+
- Replaced the previous function-style public API with an OOP-first architecture
|
|
8
|
+
reporting API.
|
|
9
|
+
- Removed legacy helper entry points documented by older releases, including
|
|
10
|
+
`evaluate_shape`, `render_callable_report`, `structured_callable_report`,
|
|
11
|
+
`find_unused_exports`, `map_code`, `find_hotspots`, and `coherence_summary`.
|
|
12
|
+
- Consolidated architecture mapping, flow violations, shape violations, and
|
|
13
|
+
insights into `ArchitectureReportRunner`.
|
|
14
|
+
|
|
15
|
+
### Added
|
|
16
|
+
|
|
17
|
+
- `ArchitectureReportRunner`, returning a typed `ArchitectureReport`.
|
|
18
|
+
- Normalized report sections for map data, violations, and insights.
|
|
19
|
+
- Public exports for the configuration objects needed to build reports from
|
|
20
|
+
`modwire.architecture`.
|
|
21
|
+
|
|
22
|
+
### Migration
|
|
23
|
+
|
|
24
|
+
Use `ArchitectureReportRunner(config).run(code_map)` instead of calling
|
|
25
|
+
individual helper functions:
|
|
26
|
+
|
|
27
|
+
```python
|
|
28
|
+
from modwire.architecture import ArchitectureConfig, ArchitectureReportRunner
|
|
29
|
+
|
|
30
|
+
report = ArchitectureReportRunner(ArchitectureConfig(language="python")).run(code_map)
|
|
31
|
+
```
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
# Contributing to Modwire
|
|
2
2
|
|
|
3
|
-
Modwire is a Python package for
|
|
4
|
-
|
|
5
|
-
projects.
|
|
3
|
+
Modwire is a Python package for architecture mapping, violation evaluation, and
|
|
4
|
+
code-map reports produced from `modwire-extraction` data.
|
|
6
5
|
|
|
7
6
|
## Requesting Features
|
|
8
7
|
|
|
9
8
|
Use the `Feature request` issue form for new capabilities, such as:
|
|
10
9
|
|
|
11
|
-
-
|
|
12
|
-
- richer
|
|
10
|
+
- architecture mapping for another framework convention
|
|
11
|
+
- richer architecture analysis, shape reports, callable reports, or export checks
|
|
13
12
|
- new architecture analyzers or policy matching behavior
|
|
14
13
|
- export formats or integrations with other tools
|
|
15
14
|
- documentation examples for common workflows
|
|
@@ -21,22 +20,18 @@ solved, a small example input, and the desired API or output shape.
|
|
|
21
20
|
|
|
22
21
|
Use the `Bug report` issue form for incorrect current behavior, such as:
|
|
23
22
|
|
|
24
|
-
- missing or incorrect imports, symbols, source IDs, or graph edges
|
|
25
23
|
- incorrect architecture-policy violations
|
|
26
|
-
-
|
|
24
|
+
- incorrect shape, callable, unused-export, or graph reports
|
|
27
25
|
- packaging, installation, or compatibility problems
|
|
28
26
|
- documentation that contradicts the implemented behavior
|
|
29
27
|
|
|
30
28
|
Bug reports should include a minimal reproduction, the expected output, the
|
|
31
|
-
actual output, and relevant versions for Python, Modwire,
|
|
29
|
+
actual output, and relevant versions for Python, Modwire, and modwire-extraction.
|
|
32
30
|
|
|
33
31
|
## Pull Requests
|
|
34
32
|
|
|
35
33
|
Before opening a pull request, run the local checks documented in
|
|
36
34
|
[Development checks](docs/wiki/Development-checks.md).
|
|
37
35
|
|
|
38
|
-
Extractor changes should include focused tests under `tests/` and, when
|
|
39
|
-
relevant, a small fixture under `tests/apps/`.
|
|
40
|
-
|
|
41
36
|
Keep pull requests scoped to one behavior change. If an issue exists, link it in
|
|
42
37
|
the pull request description.
|
modwire-3.0.0/PKG-INFO
ADDED
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: modwire
|
|
3
|
+
Version: 3.0.0
|
|
4
|
+
Summary: Map architecture boundaries and analyze extracted code maps.
|
|
5
|
+
Author: Tomasz Szpak
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/9orky/modwire
|
|
8
|
+
Project-URL: Repository, https://github.com/9orky/modwire
|
|
9
|
+
Project-URL: Issues, https://github.com/9orky/modwire/issues
|
|
10
|
+
Keywords: architecture,code-analysis,dependency-graph,static-analysis
|
|
11
|
+
Classifier: Development Status :: 3 - Alpha
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: Operating System :: OS Independent
|
|
14
|
+
Classifier: Programming Language :: Python
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
20
|
+
Classifier: Topic :: Software Development
|
|
21
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
22
|
+
Classifier: Topic :: Software Development :: Quality Assurance
|
|
23
|
+
Requires-Python: >=3.11
|
|
24
|
+
Description-Content-Type: text/markdown
|
|
25
|
+
License-File: LICENSE
|
|
26
|
+
Requires-Dist: modwire-extraction>=1.0.1
|
|
27
|
+
Requires-Dist: pydantic>=2.8
|
|
28
|
+
Provides-Extra: dev
|
|
29
|
+
Requires-Dist: build>=1.2; extra == "dev"
|
|
30
|
+
Requires-Dist: pytest>=8.0; extra == "dev"
|
|
31
|
+
Requires-Dist: ruff>=0.8; extra == "dev"
|
|
32
|
+
Requires-Dist: twine>=5.1; extra == "dev"
|
|
33
|
+
Dynamic: license-file
|
|
34
|
+
|
|
35
|
+
# modwire
|
|
36
|
+
|
|
37
|
+
`modwire` turns code maps from
|
|
38
|
+
[`modwire-extraction`](https://github.com/9orky/modwire-extraction) into
|
|
39
|
+
architecture reports: boundary maps, dependency-flow violations, shape-policy
|
|
40
|
+
violations, and architecture insights.
|
|
41
|
+
|
|
42
|
+
## Installation
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
python -m pip install modwire
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Quick Start
|
|
49
|
+
|
|
50
|
+
```python
|
|
51
|
+
from pathlib import Path
|
|
52
|
+
|
|
53
|
+
from modwire.architecture import (
|
|
54
|
+
ArchitectureConfig,
|
|
55
|
+
ArchitectureReportRunner,
|
|
56
|
+
BoundariesConfig,
|
|
57
|
+
FlowRealm,
|
|
58
|
+
FlowRules,
|
|
59
|
+
ShapeConfig,
|
|
60
|
+
TagRule,
|
|
61
|
+
)
|
|
62
|
+
from modwire_extraction import ModwireExtraction
|
|
63
|
+
|
|
64
|
+
code_map = ModwireExtraction(Path("src")).generate_map("python")
|
|
65
|
+
|
|
66
|
+
config = ArchitectureConfig(
|
|
67
|
+
language="python",
|
|
68
|
+
boundaries=BoundariesConfig(
|
|
69
|
+
tags=(
|
|
70
|
+
TagRule(name="module", match="features/*"),
|
|
71
|
+
TagRule(name="ui", match="features/*/ui"),
|
|
72
|
+
TagRule(name="domain", match="features/*/domain"),
|
|
73
|
+
),
|
|
74
|
+
flow=FlowRules(
|
|
75
|
+
module_tag="module",
|
|
76
|
+
realms=(
|
|
77
|
+
FlowRealm(
|
|
78
|
+
name="feature",
|
|
79
|
+
layers=("domain", "ui"),
|
|
80
|
+
),
|
|
81
|
+
),
|
|
82
|
+
),
|
|
83
|
+
),
|
|
84
|
+
shape=ShapeConfig(
|
|
85
|
+
max_functions_per_file=8,
|
|
86
|
+
max_methods_per_class=12,
|
|
87
|
+
allow_import_aliases=False,
|
|
88
|
+
),
|
|
89
|
+
)
|
|
90
|
+
|
|
91
|
+
report = ArchitectureReportRunner(config).run(code_map)
|
|
92
|
+
|
|
93
|
+
print(report.map.modules)
|
|
94
|
+
print(report.violations.flow.violations)
|
|
95
|
+
print(report.violations.shape.violations)
|
|
96
|
+
print(report.insights.hotspots[:5])
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
## Report Sections
|
|
100
|
+
|
|
101
|
+
`ArchitectureReportRunner` returns a typed `ArchitectureReport` with three
|
|
102
|
+
top-level sections:
|
|
103
|
+
|
|
104
|
+
- `map`: normalized module and layer groupings plus unknown files
|
|
105
|
+
- `violations`: dependency-flow and shape-policy violations
|
|
106
|
+
- `insights`: clusters, hotspots, dependency coherence, callable graph, and
|
|
107
|
+
unused exports
|
|
108
|
+
|
|
109
|
+
Reports are Pydantic models, so they can be serialized with `model_dump()` or
|
|
110
|
+
`model_dump_json()`.
|
|
111
|
+
|
|
112
|
+
```python
|
|
113
|
+
payload = report.model_dump(mode="json")
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
## Configuration
|
|
117
|
+
|
|
118
|
+
Boundary tags classify source IDs. Flow rules then use those tags to detect
|
|
119
|
+
backward dependencies, module cycles, and module re-entry.
|
|
120
|
+
|
|
121
|
+
```python
|
|
122
|
+
from modwire.architecture import BoundariesConfig, FlowRules, TagRule
|
|
123
|
+
|
|
124
|
+
boundaries = BoundariesConfig(
|
|
125
|
+
tags=(
|
|
126
|
+
TagRule(name="module", match="features/*"),
|
|
127
|
+
TagRule(name="api", match="features/*/api"),
|
|
128
|
+
TagRule(name="domain", match="features/*/domain"),
|
|
129
|
+
),
|
|
130
|
+
flow=FlowRules(
|
|
131
|
+
module_tag="module",
|
|
132
|
+
layers=("domain", "api"),
|
|
133
|
+
),
|
|
134
|
+
)
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
Shape limits are disabled with `-1` and enabled with non-negative integers.
|
|
138
|
+
|
|
139
|
+
```python
|
|
140
|
+
from modwire.architecture import ShapeConfig
|
|
141
|
+
|
|
142
|
+
shape = ShapeConfig(
|
|
143
|
+
max_classes_per_file=3,
|
|
144
|
+
max_function_lines=40,
|
|
145
|
+
require_joined_imports=True,
|
|
146
|
+
)
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
## Migration
|
|
150
|
+
|
|
151
|
+
The current API is intentionally OOP-first. Older helper functions such as
|
|
152
|
+
`evaluate_shape`, `render_callable_report`, `structured_callable_report`,
|
|
153
|
+
`find_unused_exports`, `map_code`, `find_hotspots`, and
|
|
154
|
+
`coherence_summary` have been replaced by `ArchitectureReportRunner`.
|
|
155
|
+
|
|
156
|
+
See [CHANGELOG.md](CHANGELOG.md) before publishing or upgrading across the next
|
|
157
|
+
major release.
|
|
158
|
+
|
|
159
|
+
## Development
|
|
160
|
+
|
|
161
|
+
See [Development checks](docs/wiki/Development-checks.md) for the local command
|
|
162
|
+
set used before pull requests and releases.
|
|
163
|
+
|
|
164
|
+
## Contributing
|
|
165
|
+
|
|
166
|
+
Feature requests and bug reports are tracked through GitHub Issues:
|
|
167
|
+
|
|
168
|
+
- Open a feature request for architecture analyzers, output formats, or
|
|
169
|
+
integrations.
|
|
170
|
+
- Open a bug report for incorrect architecture violations, graph output, shape
|
|
171
|
+
reports, callable reports, unused export reports, packaging problems, or
|
|
172
|
+
documentation mismatches.
|
|
173
|
+
|
|
174
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md) for the information to include and the
|
|
175
|
+
checks to run before opening a pull request.
|
modwire-3.0.0/README.md
ADDED
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
# modwire
|
|
2
|
+
|
|
3
|
+
`modwire` turns code maps from
|
|
4
|
+
[`modwire-extraction`](https://github.com/9orky/modwire-extraction) into
|
|
5
|
+
architecture reports: boundary maps, dependency-flow violations, shape-policy
|
|
6
|
+
violations, and architecture insights.
|
|
7
|
+
|
|
8
|
+
## Installation
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
python -m pip install modwire
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Quick Start
|
|
15
|
+
|
|
16
|
+
```python
|
|
17
|
+
from pathlib import Path
|
|
18
|
+
|
|
19
|
+
from modwire.architecture import (
|
|
20
|
+
ArchitectureConfig,
|
|
21
|
+
ArchitectureReportRunner,
|
|
22
|
+
BoundariesConfig,
|
|
23
|
+
FlowRealm,
|
|
24
|
+
FlowRules,
|
|
25
|
+
ShapeConfig,
|
|
26
|
+
TagRule,
|
|
27
|
+
)
|
|
28
|
+
from modwire_extraction import ModwireExtraction
|
|
29
|
+
|
|
30
|
+
code_map = ModwireExtraction(Path("src")).generate_map("python")
|
|
31
|
+
|
|
32
|
+
config = ArchitectureConfig(
|
|
33
|
+
language="python",
|
|
34
|
+
boundaries=BoundariesConfig(
|
|
35
|
+
tags=(
|
|
36
|
+
TagRule(name="module", match="features/*"),
|
|
37
|
+
TagRule(name="ui", match="features/*/ui"),
|
|
38
|
+
TagRule(name="domain", match="features/*/domain"),
|
|
39
|
+
),
|
|
40
|
+
flow=FlowRules(
|
|
41
|
+
module_tag="module",
|
|
42
|
+
realms=(
|
|
43
|
+
FlowRealm(
|
|
44
|
+
name="feature",
|
|
45
|
+
layers=("domain", "ui"),
|
|
46
|
+
),
|
|
47
|
+
),
|
|
48
|
+
),
|
|
49
|
+
),
|
|
50
|
+
shape=ShapeConfig(
|
|
51
|
+
max_functions_per_file=8,
|
|
52
|
+
max_methods_per_class=12,
|
|
53
|
+
allow_import_aliases=False,
|
|
54
|
+
),
|
|
55
|
+
)
|
|
56
|
+
|
|
57
|
+
report = ArchitectureReportRunner(config).run(code_map)
|
|
58
|
+
|
|
59
|
+
print(report.map.modules)
|
|
60
|
+
print(report.violations.flow.violations)
|
|
61
|
+
print(report.violations.shape.violations)
|
|
62
|
+
print(report.insights.hotspots[:5])
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Report Sections
|
|
66
|
+
|
|
67
|
+
`ArchitectureReportRunner` returns a typed `ArchitectureReport` with three
|
|
68
|
+
top-level sections:
|
|
69
|
+
|
|
70
|
+
- `map`: normalized module and layer groupings plus unknown files
|
|
71
|
+
- `violations`: dependency-flow and shape-policy violations
|
|
72
|
+
- `insights`: clusters, hotspots, dependency coherence, callable graph, and
|
|
73
|
+
unused exports
|
|
74
|
+
|
|
75
|
+
Reports are Pydantic models, so they can be serialized with `model_dump()` or
|
|
76
|
+
`model_dump_json()`.
|
|
77
|
+
|
|
78
|
+
```python
|
|
79
|
+
payload = report.model_dump(mode="json")
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
## Configuration
|
|
83
|
+
|
|
84
|
+
Boundary tags classify source IDs. Flow rules then use those tags to detect
|
|
85
|
+
backward dependencies, module cycles, and module re-entry.
|
|
86
|
+
|
|
87
|
+
```python
|
|
88
|
+
from modwire.architecture import BoundariesConfig, FlowRules, TagRule
|
|
89
|
+
|
|
90
|
+
boundaries = BoundariesConfig(
|
|
91
|
+
tags=(
|
|
92
|
+
TagRule(name="module", match="features/*"),
|
|
93
|
+
TagRule(name="api", match="features/*/api"),
|
|
94
|
+
TagRule(name="domain", match="features/*/domain"),
|
|
95
|
+
),
|
|
96
|
+
flow=FlowRules(
|
|
97
|
+
module_tag="module",
|
|
98
|
+
layers=("domain", "api"),
|
|
99
|
+
),
|
|
100
|
+
)
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
Shape limits are disabled with `-1` and enabled with non-negative integers.
|
|
104
|
+
|
|
105
|
+
```python
|
|
106
|
+
from modwire.architecture import ShapeConfig
|
|
107
|
+
|
|
108
|
+
shape = ShapeConfig(
|
|
109
|
+
max_classes_per_file=3,
|
|
110
|
+
max_function_lines=40,
|
|
111
|
+
require_joined_imports=True,
|
|
112
|
+
)
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
## Migration
|
|
116
|
+
|
|
117
|
+
The current API is intentionally OOP-first. Older helper functions such as
|
|
118
|
+
`evaluate_shape`, `render_callable_report`, `structured_callable_report`,
|
|
119
|
+
`find_unused_exports`, `map_code`, `find_hotspots`, and
|
|
120
|
+
`coherence_summary` have been replaced by `ArchitectureReportRunner`.
|
|
121
|
+
|
|
122
|
+
See [CHANGELOG.md](CHANGELOG.md) before publishing or upgrading across the next
|
|
123
|
+
major release.
|
|
124
|
+
|
|
125
|
+
## Development
|
|
126
|
+
|
|
127
|
+
See [Development checks](docs/wiki/Development-checks.md) for the local command
|
|
128
|
+
set used before pull requests and releases.
|
|
129
|
+
|
|
130
|
+
## Contributing
|
|
131
|
+
|
|
132
|
+
Feature requests and bug reports are tracked through GitHub Issues:
|
|
133
|
+
|
|
134
|
+
- Open a feature request for architecture analyzers, output formats, or
|
|
135
|
+
integrations.
|
|
136
|
+
- Open a bug report for incorrect architecture violations, graph output, shape
|
|
137
|
+
reports, callable reports, unused export reports, packaging problems, or
|
|
138
|
+
documentation mismatches.
|
|
139
|
+
|
|
140
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md) for the information to include and the
|
|
141
|
+
checks to run before opening a pull request.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Development Checks
|
|
2
|
+
|
|
3
|
+
Run these checks before opening a pull request:
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
uv run ruff check .
|
|
7
|
+
uv run --with pytest python -m pytest
|
|
8
|
+
uv run --with build python -m build --outdir dist
|
|
9
|
+
uv run --with twine python -m twine check dist/*
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
This page is the canonical local-check list; README and contributor guidance
|
|
13
|
+
link here to avoid release-process drift.
|
|
14
|
+
|
|
15
|
+
The CI workflow currently validates:
|
|
16
|
+
|
|
17
|
+
- Python 3.11, 3.12, and 3.13
|
|
18
|
+
- package build and distribution metadata
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Modwire Wiki
|
|
2
|
+
|
|
3
|
+
Modwire maps architecture boundaries and evaluates policies from code maps
|
|
4
|
+
produced by `modwire-extraction`.
|
|
5
|
+
|
|
6
|
+
## Start Here
|
|
7
|
+
|
|
8
|
+
- README examples cover the OOP architecture report runner, including boundary
|
|
9
|
+
maps, flow violations, shape violations, callable insights, hotspots, and
|
|
10
|
+
unused export checks.
|
|
11
|
+
- [Reporting bugs](Reporting-bugs.md)
|
|
12
|
+
- [Requesting features](Requesting-features.md)
|
|
13
|
+
- [Development checks](Development-checks.md)
|
|
14
|
+
|
|
15
|
+
## Useful Project Links
|
|
16
|
+
|
|
17
|
+
- Repository: https://github.com/9orky/modwire
|
|
18
|
+
- Issues: https://github.com/9orky/modwire/issues
|
|
19
|
+
- Bug report form: https://github.com/9orky/modwire/issues/new?template=bug_report.yml
|
|
20
|
+
- Feature request form: https://github.com/9orky/modwire/issues/new?template=feature_request.yml
|
|
21
|
+
|
|
22
|
+
## Code Maps
|
|
23
|
+
|
|
24
|
+
Use `modwire-extraction` to produce `CodeMap` objects. Pass those maps into
|
|
25
|
+
`ArchitectureReportRunner` to produce a full architecture report.
|
|
@@ -5,20 +5,18 @@ Use the GitHub `Bug report` issue form when Modwire behaves incorrectly.
|
|
|
5
5
|
## Good Bug Reports Include
|
|
6
6
|
|
|
7
7
|
- a short summary of what went wrong
|
|
8
|
-
- the affected area, such as
|
|
9
|
-
|
|
8
|
+
- the affected area, such as architecture mapping, dependency graph reporting,
|
|
9
|
+
shape policy, callable reports, or unused exports
|
|
10
10
|
- the smallest source snippet or fixture that reproduces the problem
|
|
11
11
|
- the actual output, traceback, graph edges, or violations
|
|
12
12
|
- the expected output
|
|
13
|
-
- Modwire,
|
|
13
|
+
- Modwire, modwire-extraction, Python, and operating-system versions where relevant
|
|
14
14
|
|
|
15
15
|
## Examples of Bugs
|
|
16
16
|
|
|
17
|
-
- an import is missed or linked to the wrong source ID
|
|
18
|
-
- a symbol is extracted with incorrect metadata
|
|
19
17
|
- graph edges are missing, duplicated, or pointed at the wrong node
|
|
20
|
-
- an architecture policy
|
|
21
|
-
-
|
|
18
|
+
- an architecture policy returns the wrong violation
|
|
19
|
+
- shape, callable, or unused-export reports omit or misclassify source metadata
|
|
22
20
|
- package installation or distribution metadata is broken
|
|
23
21
|
|
|
24
22
|
Open a bug report at:
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "modwire"
|
|
7
|
-
description = "
|
|
7
|
+
description = "Map architecture boundaries and analyze extracted code maps."
|
|
8
8
|
readme = "README.md"
|
|
9
9
|
requires-python = ">=3.11"
|
|
10
10
|
license = "MIT"
|
|
@@ -33,6 +33,7 @@ classifiers = [
|
|
|
33
33
|
"Topic :: Software Development :: Quality Assurance",
|
|
34
34
|
]
|
|
35
35
|
dependencies = [
|
|
36
|
+
"modwire-extraction>=1.0.1",
|
|
36
37
|
"pydantic>=2.8",
|
|
37
38
|
]
|
|
38
39
|
|
|
@@ -57,6 +58,9 @@ dev = [
|
|
|
57
58
|
"twine>=5.1",
|
|
58
59
|
]
|
|
59
60
|
|
|
61
|
+
[tool.uv.sources]
|
|
62
|
+
modwire-extraction = { path = "../modwire-extraction", editable = true }
|
|
63
|
+
|
|
60
64
|
[tool.pytest.ini_options]
|
|
61
65
|
testpaths = ["tests"]
|
|
62
66
|
cache_dir = ".dev/pytest_cache"
|
|
@@ -71,12 +75,6 @@ include-package-data = true
|
|
|
71
75
|
[tool.setuptools.packages.find]
|
|
72
76
|
where = ["src"]
|
|
73
77
|
|
|
74
|
-
[tool.setuptools.package-data]
|
|
75
|
-
"modwire.extractors.scripts" = [
|
|
76
|
-
"*.js",
|
|
77
|
-
"*.php",
|
|
78
|
-
]
|
|
79
|
-
|
|
80
78
|
[tool.setuptools_scm]
|
|
81
79
|
fallback_version = "0.0.0.dev0"
|
|
82
80
|
local_scheme = "no-local-version"
|
|
@@ -18,7 +18,7 @@ version_tuple: tuple[int | str, ...]
|
|
|
18
18
|
commit_id: str | None
|
|
19
19
|
__commit_id__: str | None
|
|
20
20
|
|
|
21
|
-
__version__ = version = '
|
|
22
|
-
__version_tuple__ = version_tuple = (
|
|
21
|
+
__version__ = version = '3.0.0'
|
|
22
|
+
__version_tuple__ = version_tuple = (3, 0, 0)
|
|
23
23
|
|
|
24
|
-
__commit_id__ = commit_id = '
|
|
24
|
+
__commit_id__ = commit_id = 'g84d5eeaca'
|