archunitpython 1.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.
- archunitpython-1.0.0/.editorconfig +19 -0
- archunitpython-1.0.0/.gitattributes +2 -0
- archunitpython-1.0.0/.github/ISSUE_TEMPLATE/bug_report.md +30 -0
- archunitpython-1.0.0/.github/ISSUE_TEMPLATE/documentation.md +54 -0
- archunitpython-1.0.0/.github/ISSUE_TEMPLATE/feature_request.md +55 -0
- archunitpython-1.0.0/.github/ISSUE_TEMPLATE/question.md +37 -0
- archunitpython-1.0.0/.github/PAGES.md +32 -0
- archunitpython-1.0.0/.github/dependabot.yml +39 -0
- archunitpython-1.0.0/.github/pull_request_template.md +10 -0
- archunitpython-1.0.0/.github/workflows/docs.yaml +59 -0
- archunitpython-1.0.0/.github/workflows/integrate.yaml +77 -0
- archunitpython-1.0.0/.github/workflows/stale.yaml +23 -0
- archunitpython-1.0.0/.gitignore +26 -0
- archunitpython-1.0.0/.releaserc.json +27 -0
- archunitpython-1.0.0/CHANGELOG.md +47 -0
- archunitpython-1.0.0/CONTRIBUTING.md +83 -0
- archunitpython-1.0.0/LICENSE +7 -0
- archunitpython-1.0.0/PKG-INFO +660 -0
- archunitpython-1.0.0/README.md +628 -0
- archunitpython-1.0.0/TODO.md +18 -0
- archunitpython-1.0.0/pyproject.toml +89 -0
- archunitpython-1.0.0/src/archunitpython/__init__.py +45 -0
- archunitpython-1.0.0/src/archunitpython/common/__init__.py +18 -0
- archunitpython-1.0.0/src/archunitpython/common/assertion/__init__.py +3 -0
- archunitpython-1.0.0/src/archunitpython/common/assertion/violation.py +21 -0
- archunitpython-1.0.0/src/archunitpython/common/error/__init__.py +3 -0
- archunitpython-1.0.0/src/archunitpython/common/error/errors.py +13 -0
- archunitpython-1.0.0/src/archunitpython/common/extraction/__init__.py +13 -0
- archunitpython-1.0.0/src/archunitpython/common/extraction/extract_graph.py +345 -0
- archunitpython-1.0.0/src/archunitpython/common/extraction/graph.py +39 -0
- archunitpython-1.0.0/src/archunitpython/common/fluentapi/__init__.py +3 -0
- archunitpython-1.0.0/src/archunitpython/common/fluentapi/checkable.py +28 -0
- archunitpython-1.0.0/src/archunitpython/common/logging/__init__.py +3 -0
- archunitpython-1.0.0/src/archunitpython/common/logging/types.py +18 -0
- archunitpython-1.0.0/src/archunitpython/common/pattern_matching.py +80 -0
- archunitpython-1.0.0/src/archunitpython/common/projection/__init__.py +30 -0
- archunitpython-1.0.0/src/archunitpython/common/projection/cycles/__init__.py +4 -0
- archunitpython-1.0.0/src/archunitpython/common/projection/cycles/cycle_utils.py +49 -0
- archunitpython-1.0.0/src/archunitpython/common/projection/cycles/cycles.py +26 -0
- archunitpython-1.0.0/src/archunitpython/common/projection/cycles/johnsons_apsp.py +110 -0
- archunitpython-1.0.0/src/archunitpython/common/projection/cycles/model.py +22 -0
- archunitpython-1.0.0/src/archunitpython/common/projection/cycles/tarjan_scc.py +86 -0
- archunitpython-1.0.0/src/archunitpython/common/projection/edge_projections.py +36 -0
- archunitpython-1.0.0/src/archunitpython/common/projection/project_cycles.py +85 -0
- archunitpython-1.0.0/src/archunitpython/common/projection/project_edges.py +43 -0
- archunitpython-1.0.0/src/archunitpython/common/projection/project_nodes.py +49 -0
- archunitpython-1.0.0/src/archunitpython/common/projection/types.py +40 -0
- archunitpython-1.0.0/src/archunitpython/common/regex_factory.py +76 -0
- archunitpython-1.0.0/src/archunitpython/common/types.py +29 -0
- archunitpython-1.0.0/src/archunitpython/common/util/__init__.py +3 -0
- archunitpython-1.0.0/src/archunitpython/common/util/declaration_detector.py +115 -0
- archunitpython-1.0.0/src/archunitpython/common/util/logger.py +100 -0
- archunitpython-1.0.0/src/archunitpython/files/__init__.py +3 -0
- archunitpython-1.0.0/src/archunitpython/files/assertion/__init__.py +28 -0
- archunitpython-1.0.0/src/archunitpython/files/assertion/custom_file_logic.py +107 -0
- archunitpython-1.0.0/src/archunitpython/files/assertion/cycle_free.py +29 -0
- archunitpython-1.0.0/src/archunitpython/files/assertion/depend_on_files.py +67 -0
- archunitpython-1.0.0/src/archunitpython/files/assertion/matching_files.py +64 -0
- archunitpython-1.0.0/src/archunitpython/files/fluentapi/__init__.py +3 -0
- archunitpython-1.0.0/src/archunitpython/files/fluentapi/files.py +403 -0
- archunitpython-1.0.0/src/archunitpython/metrics/__init__.py +3 -0
- archunitpython-1.0.0/src/archunitpython/metrics/assertion/__init__.py +0 -0
- archunitpython-1.0.0/src/archunitpython/metrics/assertion/metric_thresholds.py +51 -0
- archunitpython-1.0.0/src/archunitpython/metrics/calculation/__init__.py +0 -0
- archunitpython-1.0.0/src/archunitpython/metrics/calculation/count.py +148 -0
- archunitpython-1.0.0/src/archunitpython/metrics/calculation/distance.py +110 -0
- archunitpython-1.0.0/src/archunitpython/metrics/calculation/lcom.py +177 -0
- archunitpython-1.0.0/src/archunitpython/metrics/common/__init__.py +19 -0
- archunitpython-1.0.0/src/archunitpython/metrics/common/types.py +67 -0
- archunitpython-1.0.0/src/archunitpython/metrics/extraction/__init__.py +0 -0
- archunitpython-1.0.0/src/archunitpython/metrics/extraction/extract_class_info.py +246 -0
- archunitpython-1.0.0/src/archunitpython/metrics/fluentapi/__init__.py +3 -0
- archunitpython-1.0.0/src/archunitpython/metrics/fluentapi/export_utils.py +89 -0
- archunitpython-1.0.0/src/archunitpython/metrics/fluentapi/metrics.py +589 -0
- archunitpython-1.0.0/src/archunitpython/metrics/projection/__init__.py +0 -0
- archunitpython-1.0.0/src/archunitpython/py.typed +0 -0
- archunitpython-1.0.0/src/archunitpython/slices/__init__.py +3 -0
- archunitpython-1.0.0/src/archunitpython/slices/assertion/__init__.py +13 -0
- archunitpython-1.0.0/src/archunitpython/slices/assertion/admissible_edges.py +108 -0
- archunitpython-1.0.0/src/archunitpython/slices/fluentapi/__init__.py +3 -0
- archunitpython-1.0.0/src/archunitpython/slices/fluentapi/slices.py +220 -0
- archunitpython-1.0.0/src/archunitpython/slices/projection/__init__.py +8 -0
- archunitpython-1.0.0/src/archunitpython/slices/projection/slicing_projections.py +128 -0
- archunitpython-1.0.0/src/archunitpython/slices/uml/__init__.py +4 -0
- archunitpython-1.0.0/src/archunitpython/slices/uml/export_diagram.py +31 -0
- archunitpython-1.0.0/src/archunitpython/slices/uml/generate_rules.py +71 -0
- archunitpython-1.0.0/src/archunitpython/testing/__init__.py +3 -0
- archunitpython-1.0.0/src/archunitpython/testing/assertion.py +47 -0
- archunitpython-1.0.0/src/archunitpython/testing/common/__init__.py +4 -0
- archunitpython-1.0.0/src/archunitpython/testing/common/color_utils.py +57 -0
- archunitpython-1.0.0/src/archunitpython/testing/common/violation_factory.py +97 -0
- archunitpython-1.0.0/src/archunitpython/testing/pytest_plugin/__init__.py +0 -0
- archunitpython-1.0.0/tests/__init__.py +0 -0
- archunitpython-1.0.0/tests/common/__init__.py +0 -0
- archunitpython-1.0.0/tests/common/test_core_types.py +150 -0
- archunitpython-1.0.0/tests/common/test_cycles.py +186 -0
- archunitpython-1.0.0/tests/common/test_declaration_detector.py +108 -0
- archunitpython-1.0.0/tests/common/test_extract_graph.py +160 -0
- archunitpython-1.0.0/tests/common/test_logger.py +72 -0
- archunitpython-1.0.0/tests/common/test_pattern_matching.py +177 -0
- archunitpython-1.0.0/tests/common/test_projection.py +151 -0
- archunitpython-1.0.0/tests/files/__init__.py +0 -0
- archunitpython-1.0.0/tests/files/test_file_assertions.py +159 -0
- archunitpython-1.0.0/tests/files/test_files_fluentapi.py +174 -0
- archunitpython-1.0.0/tests/fixtures/metrics_project/service.py +68 -0
- archunitpython-1.0.0/tests/fixtures/sample_project/__init__.py +0 -0
- archunitpython-1.0.0/tests/fixtures/sample_project/architecture.puml +8 -0
- archunitpython-1.0.0/tests/fixtures/sample_project/controllers/__init__.py +0 -0
- archunitpython-1.0.0/tests/fixtures/sample_project/controllers/controller.py +11 -0
- archunitpython-1.0.0/tests/fixtures/sample_project/models/__init__.py +0 -0
- archunitpython-1.0.0/tests/fixtures/sample_project/models/model.py +7 -0
- archunitpython-1.0.0/tests/fixtures/sample_project/services/__init__.py +0 -0
- archunitpython-1.0.0/tests/fixtures/sample_project/services/service.py +8 -0
- archunitpython-1.0.0/tests/fixtures/sample_project/services/service_a.py +7 -0
- archunitpython-1.0.0/tests/fixtures/sample_project/services/service_b.py +8 -0
- archunitpython-1.0.0/tests/fixtures/sample_project/utils/__init__.py +0 -0
- archunitpython-1.0.0/tests/fixtures/sample_project/utils/helpers.py +10 -0
- archunitpython-1.0.0/tests/integration/__init__.py +0 -0
- archunitpython-1.0.0/tests/integration/test_e2e.py +203 -0
- archunitpython-1.0.0/tests/metrics/__init__.py +0 -0
- archunitpython-1.0.0/tests/metrics/test_export.py +50 -0
- archunitpython-1.0.0/tests/metrics/test_metrics.py +256 -0
- archunitpython-1.0.0/tests/metrics/test_metrics_fluentapi.py +137 -0
- archunitpython-1.0.0/tests/slices/__init__.py +0 -0
- archunitpython-1.0.0/tests/slices/test_slices.py +266 -0
- archunitpython-1.0.0/tests/test_setup.py +7 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
root = true
|
|
2
|
+
|
|
3
|
+
[*]
|
|
4
|
+
indent_style = space
|
|
5
|
+
indent_size = 4
|
|
6
|
+
end_of_line = lf
|
|
7
|
+
charset = utf-8
|
|
8
|
+
trim_trailing_whitespace = true
|
|
9
|
+
insert_final_newline = true
|
|
10
|
+
|
|
11
|
+
[*.md]
|
|
12
|
+
indent_size = 2
|
|
13
|
+
trim_trailing_whitespace = false
|
|
14
|
+
|
|
15
|
+
[*.yml]
|
|
16
|
+
indent_size = 2
|
|
17
|
+
|
|
18
|
+
[*.yaml]
|
|
19
|
+
indent_size = 2
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Bug Report
|
|
3
|
+
about: Create a report to help us improve ArchUnitPython
|
|
4
|
+
title: '[BUG] '
|
|
5
|
+
labels: ['bug']
|
|
6
|
+
assignees: []
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Bug Report
|
|
10
|
+
|
|
11
|
+
Describe what the bug is and what you expected to happen.
|
|
12
|
+
|
|
13
|
+
## Steps to Reproduce
|
|
14
|
+
|
|
15
|
+
1.
|
|
16
|
+
2.
|
|
17
|
+
3.
|
|
18
|
+
|
|
19
|
+
## Environment
|
|
20
|
+
|
|
21
|
+
- OS: [e.g. Windows 11, macOS, Ubuntu]
|
|
22
|
+
- Python: [e.g. 3.12.0]
|
|
23
|
+
- ArchUnitPython: [e.g. 0.1.0]
|
|
24
|
+
- Testing Framework: [e.g. pytest, unittest]
|
|
25
|
+
|
|
26
|
+
## Code Sample
|
|
27
|
+
|
|
28
|
+
```python
|
|
29
|
+
# Minimal reproduction case
|
|
30
|
+
```
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Documentation
|
|
3
|
+
about: Request documentation improvements or report documentation issues
|
|
4
|
+
title: '[DOCS] '
|
|
5
|
+
labels: ['documentation']
|
|
6
|
+
assignees: []
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Documentation Issue
|
|
10
|
+
|
|
11
|
+
Describe what documentation needs to be improved or what's unclear.
|
|
12
|
+
|
|
13
|
+
## What's Missing
|
|
14
|
+
|
|
15
|
+
- [ ] README.md
|
|
16
|
+
- [ ] API Documentation
|
|
17
|
+
- [ ] Examples
|
|
18
|
+
- [ ] Contributing Guide
|
|
19
|
+
- [ ] Other: **__**
|
|
20
|
+
|
|
21
|
+
## Suggested Improvement
|
|
22
|
+
|
|
23
|
+
What would make the documentation better?
|
|
24
|
+
|
|
25
|
+
## Specific Sections
|
|
26
|
+
|
|
27
|
+
**Which sections need attention?**
|
|
28
|
+
Point to specific sections, methods, or examples that need work.
|
|
29
|
+
|
|
30
|
+
## Target Audience
|
|
31
|
+
|
|
32
|
+
**Who is this documentation for?**
|
|
33
|
+
|
|
34
|
+
- [ ] New users getting started
|
|
35
|
+
- [ ] Experienced developers
|
|
36
|
+
- [ ] Contributors
|
|
37
|
+
- [ ] Specific framework users (pytest, unittest, etc.)
|
|
38
|
+
|
|
39
|
+
## Content Suggestions
|
|
40
|
+
|
|
41
|
+
**Do you have specific content to suggest?**
|
|
42
|
+
If you have ideas for the content, examples, or improvements, please share them.
|
|
43
|
+
|
|
44
|
+
## Volunteer
|
|
45
|
+
|
|
46
|
+
**Would you like to help improve this documentation?**
|
|
47
|
+
|
|
48
|
+
- [ ] Yes, I can submit a PR for this
|
|
49
|
+
- [ ] Yes, but I need guidance
|
|
50
|
+
- [ ] No, just reporting the issue
|
|
51
|
+
|
|
52
|
+
## Additional Context
|
|
53
|
+
|
|
54
|
+
Add any other context about the documentation request here.
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Feature Request
|
|
3
|
+
about: Suggest an idea for ArchUnitPython
|
|
4
|
+
title: '[FEATURE] '
|
|
5
|
+
labels: ['enhancement']
|
|
6
|
+
assignees: []
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Feature Request
|
|
10
|
+
|
|
11
|
+
Describe the feature you'd like to see added.
|
|
12
|
+
|
|
13
|
+
## Problem
|
|
14
|
+
|
|
15
|
+
What problem does this solve? Is your feature request related to a problem?
|
|
16
|
+
|
|
17
|
+
## Proposed Solution
|
|
18
|
+
|
|
19
|
+
How would this feature work? What would the API look like?
|
|
20
|
+
|
|
21
|
+
```python
|
|
22
|
+
# Example usage
|
|
23
|
+
from archunitpython import project_files
|
|
24
|
+
|
|
25
|
+
rule = project_files("src/").in_folder("src").should().your_new_feature()
|
|
26
|
+
assert_passes(rule)
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Use Case
|
|
30
|
+
|
|
31
|
+
How would you use this feature in your project?
|
|
32
|
+
|
|
33
|
+
## Alternatives Considered
|
|
34
|
+
|
|
35
|
+
Describe alternatives you've considered.
|
|
36
|
+
|
|
37
|
+
## Impact Assessment
|
|
38
|
+
|
|
39
|
+
What areas would this affect?
|
|
40
|
+
|
|
41
|
+
- [ ] Core architecture testing
|
|
42
|
+
- [ ] File dependencies
|
|
43
|
+
- [ ] Metrics calculation
|
|
44
|
+
- [ ] Slice testing
|
|
45
|
+
- [ ] Error messages
|
|
46
|
+
- [ ] Test framework integration
|
|
47
|
+
- [ ] Performance
|
|
48
|
+
- [ ] Documentation
|
|
49
|
+
|
|
50
|
+
## Checklist
|
|
51
|
+
|
|
52
|
+
- [ ] I have searched existing issues to make sure this isn't a duplicate
|
|
53
|
+
- [ ] I have provided a clear use case
|
|
54
|
+
- [ ] I have considered the API design
|
|
55
|
+
- [ ] I have thought about backward compatibility
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Question
|
|
3
|
+
about: Ask a question about using ArchUnitPython
|
|
4
|
+
title: '[QUESTION] '
|
|
5
|
+
labels: ['question']
|
|
6
|
+
assignees: []
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Question
|
|
10
|
+
|
|
11
|
+
What would you like to know about ArchUnitPython?
|
|
12
|
+
|
|
13
|
+
## What I'm Trying to Do
|
|
14
|
+
|
|
15
|
+
Describe your goal or what you're trying to achieve.
|
|
16
|
+
|
|
17
|
+
## Code Context
|
|
18
|
+
|
|
19
|
+
```python
|
|
20
|
+
# Your code here (if applicable)
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Environment
|
|
24
|
+
|
|
25
|
+
- Python Version: [e.g. 3.12.0]
|
|
26
|
+
- ArchUnitPython Version: [e.g. 0.1.0]
|
|
27
|
+
- Testing Framework: [e.g. pytest, unittest]
|
|
28
|
+
|
|
29
|
+
## Documentation Checked
|
|
30
|
+
|
|
31
|
+
- [ ] README.md
|
|
32
|
+
- [ ] Examples
|
|
33
|
+
- [ ] GitHub Issues
|
|
34
|
+
|
|
35
|
+
## Additional Context
|
|
36
|
+
|
|
37
|
+
Add any other context about your question here.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# GitHub Pages Configuration for ArchUnitPython Documentation
|
|
2
|
+
|
|
3
|
+
## Documentation Site
|
|
4
|
+
|
|
5
|
+
- **URL**: https://lukasniessen.github.io/ArchUnitPython/
|
|
6
|
+
- **Source**: `docs/` folder generated by pdoc
|
|
7
|
+
- **Updates**: Automatically on push to `main` branch
|
|
8
|
+
|
|
9
|
+
## Documentation Generation
|
|
10
|
+
|
|
11
|
+
- **Tool**: [pdoc](https://pdoc.dev/)
|
|
12
|
+
- **Entry Point**: `src/archunitpython/`
|
|
13
|
+
- **Output**: `docs/` folder
|
|
14
|
+
- **Theme**: Default pdoc theme
|
|
15
|
+
|
|
16
|
+
## GitHub Actions
|
|
17
|
+
|
|
18
|
+
- **Documentation Deployment**: `.github/workflows/docs.yaml`
|
|
19
|
+
- **Integration Tests**: `.github/workflows/integrate.yaml`
|
|
20
|
+
|
|
21
|
+
## Local Development
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
# Install pdoc
|
|
25
|
+
pip install pdoc
|
|
26
|
+
|
|
27
|
+
# Generate documentation
|
|
28
|
+
pdoc src/archunitpython/ -o docs/
|
|
29
|
+
|
|
30
|
+
# Serve locally
|
|
31
|
+
pdoc src/archunitpython/
|
|
32
|
+
```
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
version: 2
|
|
2
|
+
updates:
|
|
3
|
+
- package-ecosystem: 'pip'
|
|
4
|
+
directory: '/'
|
|
5
|
+
schedule:
|
|
6
|
+
interval: 'weekly'
|
|
7
|
+
commit-message:
|
|
8
|
+
prefix: 'fix'
|
|
9
|
+
include: 'scope'
|
|
10
|
+
labels:
|
|
11
|
+
- 'dependencies'
|
|
12
|
+
open-pull-requests-limit: 10
|
|
13
|
+
|
|
14
|
+
groups:
|
|
15
|
+
minor-and-patch:
|
|
16
|
+
update-types:
|
|
17
|
+
- 'minor'
|
|
18
|
+
- 'patch'
|
|
19
|
+
|
|
20
|
+
ignore:
|
|
21
|
+
- dependency-name: '*'
|
|
22
|
+
update-types:
|
|
23
|
+
- 'version-update:semver-major'
|
|
24
|
+
|
|
25
|
+
- package-ecosystem: 'github-actions'
|
|
26
|
+
directory: '/'
|
|
27
|
+
schedule:
|
|
28
|
+
interval: 'weekly'
|
|
29
|
+
commit-message:
|
|
30
|
+
prefix: 'fix'
|
|
31
|
+
include: 'scope'
|
|
32
|
+
labels:
|
|
33
|
+
- 'dependencies'
|
|
34
|
+
open-pull-requests-limit: 10
|
|
35
|
+
|
|
36
|
+
groups:
|
|
37
|
+
actions-updates:
|
|
38
|
+
patterns:
|
|
39
|
+
- '*'
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
name: Deploy Documentation
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
|
|
7
|
+
# Allow one concurrent deployment
|
|
8
|
+
concurrency:
|
|
9
|
+
group: 'pages'
|
|
10
|
+
cancel-in-progress: true
|
|
11
|
+
|
|
12
|
+
permissions:
|
|
13
|
+
contents: read
|
|
14
|
+
pages: write
|
|
15
|
+
id-token: write
|
|
16
|
+
|
|
17
|
+
jobs:
|
|
18
|
+
# Build job
|
|
19
|
+
build:
|
|
20
|
+
runs-on: ubuntu-latest
|
|
21
|
+
steps:
|
|
22
|
+
- name: Checkout
|
|
23
|
+
uses: actions/checkout@v6
|
|
24
|
+
with:
|
|
25
|
+
fetch-depth: 0
|
|
26
|
+
|
|
27
|
+
- name: Setup Python
|
|
28
|
+
uses: actions/setup-python@v6
|
|
29
|
+
with:
|
|
30
|
+
python-version: '3.12'
|
|
31
|
+
|
|
32
|
+
- name: Install dependencies
|
|
33
|
+
run: |
|
|
34
|
+
pip install -e ".[dev]"
|
|
35
|
+
pip install pdoc
|
|
36
|
+
|
|
37
|
+
- name: Generate documentation
|
|
38
|
+
run: pdoc src/archunitpython/ -o docs/ --docformat google
|
|
39
|
+
|
|
40
|
+
- name: Setup Pages
|
|
41
|
+
uses: actions/configure-pages@v6
|
|
42
|
+
|
|
43
|
+
- name: Upload artifact
|
|
44
|
+
uses: actions/upload-pages-artifact@v4
|
|
45
|
+
with:
|
|
46
|
+
path: './docs'
|
|
47
|
+
|
|
48
|
+
# Deployment job - only runs on main branch pushes
|
|
49
|
+
deploy:
|
|
50
|
+
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
|
|
51
|
+
environment:
|
|
52
|
+
name: github-pages
|
|
53
|
+
url: ${{ steps.deployment.outputs.page_url }}
|
|
54
|
+
runs-on: ubuntu-latest
|
|
55
|
+
needs: build
|
|
56
|
+
steps:
|
|
57
|
+
- name: Deploy to GitHub Pages
|
|
58
|
+
id: deployment
|
|
59
|
+
uses: actions/deploy-pages@v5
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
name: Integrate
|
|
2
|
+
on:
|
|
3
|
+
- push
|
|
4
|
+
- pull_request
|
|
5
|
+
concurrency:
|
|
6
|
+
group: ${{ github.workflow }}-${{ github.ref }}
|
|
7
|
+
cancel-in-progress: true
|
|
8
|
+
jobs:
|
|
9
|
+
integrate:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
strategy:
|
|
12
|
+
matrix:
|
|
13
|
+
python-version: ["3.10", "3.11", "3.12", "3.13"]
|
|
14
|
+
steps:
|
|
15
|
+
- uses: actions/checkout@v6
|
|
16
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
17
|
+
uses: actions/setup-python@v6
|
|
18
|
+
with:
|
|
19
|
+
python-version: ${{ matrix.python-version }}
|
|
20
|
+
- name: Cache pip
|
|
21
|
+
uses: actions/cache@v5
|
|
22
|
+
with:
|
|
23
|
+
path: ~/.cache/pip
|
|
24
|
+
key: pip-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml') }}
|
|
25
|
+
restore-keys: |
|
|
26
|
+
pip-${{ runner.os }}-${{ matrix.python-version }}-
|
|
27
|
+
- name: Install dependencies
|
|
28
|
+
run: pip install -e ".[dev]"
|
|
29
|
+
- name: Lint
|
|
30
|
+
run: ruff check src/
|
|
31
|
+
- name: Type check
|
|
32
|
+
run: mypy src/archunitpython/ --ignore-missing-imports
|
|
33
|
+
- name: Test
|
|
34
|
+
run: pytest --tb=short -q
|
|
35
|
+
|
|
36
|
+
publish:
|
|
37
|
+
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
|
|
38
|
+
needs: integrate
|
|
39
|
+
runs-on: ubuntu-latest
|
|
40
|
+
permissions:
|
|
41
|
+
contents: write
|
|
42
|
+
issues: write
|
|
43
|
+
pull-requests: write
|
|
44
|
+
id-token: write
|
|
45
|
+
steps:
|
|
46
|
+
- uses: actions/checkout@v6
|
|
47
|
+
with:
|
|
48
|
+
fetch-depth: 0
|
|
49
|
+
token: ${{ secrets.GITHUB_TOKEN }}
|
|
50
|
+
- name: Setup Node.js
|
|
51
|
+
uses: actions/setup-node@v6
|
|
52
|
+
with:
|
|
53
|
+
node-version: 22
|
|
54
|
+
- name: Set up Python
|
|
55
|
+
uses: actions/setup-python@v6
|
|
56
|
+
with:
|
|
57
|
+
python-version: "3.12"
|
|
58
|
+
- name: Install semantic-release plugins
|
|
59
|
+
run: npm install -g semantic-release @semantic-release/changelog @semantic-release/git @semantic-release/exec @semantic-release/github
|
|
60
|
+
- name: Semantic Release
|
|
61
|
+
id: release
|
|
62
|
+
run: npx semantic-release
|
|
63
|
+
env:
|
|
64
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
65
|
+
# After semantic-release: re-read the (potentially bumped) pyproject.toml,
|
|
66
|
+
# build, and publish to PyPI
|
|
67
|
+
- name: Pull latest (version-bumped) commit
|
|
68
|
+
run: git pull --ff-only origin main || true
|
|
69
|
+
- name: Install build tools
|
|
70
|
+
run: pip install build twine
|
|
71
|
+
- name: Build package
|
|
72
|
+
run: python -m build
|
|
73
|
+
- name: Publish to PyPI
|
|
74
|
+
env:
|
|
75
|
+
TWINE_USERNAME: __token__
|
|
76
|
+
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
|
|
77
|
+
run: twine upload dist/* --skip-existing
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
name: Close inactive issues
|
|
2
|
+
on:
|
|
3
|
+
workflow_dispatch:
|
|
4
|
+
schedule:
|
|
5
|
+
- cron: "0 0 * * *"
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
close-issues:
|
|
9
|
+
runs-on: ubuntu-latest
|
|
10
|
+
permissions:
|
|
11
|
+
issues: write
|
|
12
|
+
pull-requests: write
|
|
13
|
+
steps:
|
|
14
|
+
- uses: actions/stale@v10
|
|
15
|
+
with:
|
|
16
|
+
days-before-issue-stale: 365
|
|
17
|
+
days-before-issue-close: 365
|
|
18
|
+
stale-issue-label: "stale"
|
|
19
|
+
stale-issue-message: "This issue is stale because it has been open for 365 days with no activity."
|
|
20
|
+
close-issue-message: "This issue was closed because it has been inactive for 365 days since being marked as stale."
|
|
21
|
+
days-before-pr-stale: -1
|
|
22
|
+
days-before-pr-close: -1
|
|
23
|
+
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
__pycache__/
|
|
2
|
+
*.py[cod]
|
|
3
|
+
*$py.class
|
|
4
|
+
*.so
|
|
5
|
+
dist/
|
|
6
|
+
build/
|
|
7
|
+
*.egg-info/
|
|
8
|
+
*.egg
|
|
9
|
+
.eggs/
|
|
10
|
+
.mypy_cache/
|
|
11
|
+
.pytest_cache/
|
|
12
|
+
.ruff_cache/
|
|
13
|
+
.coverage
|
|
14
|
+
htmlcov/
|
|
15
|
+
*.log
|
|
16
|
+
.env
|
|
17
|
+
.venv/
|
|
18
|
+
venv/
|
|
19
|
+
ENV/
|
|
20
|
+
.idea/
|
|
21
|
+
.vscode/
|
|
22
|
+
*.swp
|
|
23
|
+
*.swo
|
|
24
|
+
*~
|
|
25
|
+
logs/
|
|
26
|
+
test-output/
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"branches": ["main"],
|
|
3
|
+
"plugins": [
|
|
4
|
+
"@semantic-release/commit-analyzer",
|
|
5
|
+
"@semantic-release/release-notes-generator",
|
|
6
|
+
[
|
|
7
|
+
"@semantic-release/changelog",
|
|
8
|
+
{
|
|
9
|
+
"changelogFile": "CHANGELOG.md"
|
|
10
|
+
}
|
|
11
|
+
],
|
|
12
|
+
[
|
|
13
|
+
"@semantic-release/exec",
|
|
14
|
+
{
|
|
15
|
+
"prepareCmd": "python -c \"import re, pathlib; p=pathlib.Path('pyproject.toml'); p.write_text(re.sub(r'version = \\\"[^\\\"]+\\\"', f'version = \\\"${nextRelease.version}\\\"', p.read_text()))\""
|
|
16
|
+
}
|
|
17
|
+
],
|
|
18
|
+
[
|
|
19
|
+
"@semantic-release/git",
|
|
20
|
+
{
|
|
21
|
+
"assets": ["pyproject.toml", "CHANGELOG.md"],
|
|
22
|
+
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
|
|
23
|
+
}
|
|
24
|
+
],
|
|
25
|
+
"@semantic-release/github"
|
|
26
|
+
]
|
|
27
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# 1.0.0 (2026-04-02)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
* feat!: rename package from archunitpy to archunitpython ([95c0b3a](https://github.com/LukasNiessen/ArchUnitPython/commit/95c0b3a0047534302f04e42c0bfca3389c9926bf))
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
### Bug Fixes
|
|
8
|
+
|
|
9
|
+
* **deps:** bump the actions-updates group with 7 updates ([54521e4](https://github.com/LukasNiessen/ArchUnitPython/commit/54521e492256dcd1f612f119ae03ec87a08dd0c1))
|
|
10
|
+
* lint issues ([d69666b](https://github.com/LukasNiessen/ArchUnitPython/commit/d69666b9cb179225d5520f696035e5ca28f2b7ff))
|
|
11
|
+
* pypi packaging config ([5bc8b8e](https://github.com/LukasNiessen/ArchUnitPython/commit/5bc8b8eec35b5dcdd8cb391216181963970e4e6e))
|
|
12
|
+
* README ([9d41438](https://github.com/LukasNiessen/ArchUnitPython/commit/9d414386245de7288ff441618f0dd56215d032ca))
|
|
13
|
+
* resolve all ruff lint errors ([3a349f9](https://github.com/LukasNiessen/ArchUnitPython/commit/3a349f95c686df2bfb0582bcafeeef5e109ba626))
|
|
14
|
+
* update README ([e3e8949](https://github.com/LukasNiessen/ArchUnitPython/commit/e3e89493bcdd3458221666cb5f7ee46dc7996a8c))
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### BREAKING CHANGES
|
|
18
|
+
|
|
19
|
+
* Package import changed from `import archunitpy` to
|
|
20
|
+
`import archunitpython`.
|
|
21
|
+
|
|
22
|
+
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
|
23
|
+
|
|
24
|
+
# Changelog
|
|
25
|
+
|
|
26
|
+
All notable changes to ArchUnitPython will be documented in this file.
|
|
27
|
+
|
|
28
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
29
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
30
|
+
|
|
31
|
+
<!-- This file is automatically updated by python-semantic-release. -->
|
|
32
|
+
|
|
33
|
+
## [0.1.0] (2026-04-01)
|
|
34
|
+
|
|
35
|
+
### Features
|
|
36
|
+
|
|
37
|
+
* Initial release of ArchUnitPython
|
|
38
|
+
* File-level architecture rules: circular dependencies, layer dependencies, naming conventions, custom rules
|
|
39
|
+
* Slice-level architecture rules: PlantUML diagram validation, forbidden dependency checks
|
|
40
|
+
* Code metrics: 8 count metrics, 8 LCOM cohesion variants, distance metrics (abstractness, instability, zones)
|
|
41
|
+
* Custom metrics with arbitrary calculation and assertion logic
|
|
42
|
+
* HTML report export (experimental)
|
|
43
|
+
* Pattern matching with glob and regex support
|
|
44
|
+
* Testing integration: `assert_passes()` for pytest, `check()` for any framework
|
|
45
|
+
* Debug logging with file output
|
|
46
|
+
* Empty test protection
|
|
47
|
+
* Zero runtime dependencies
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
Thanks for contributing!
|
|
4
|
+
|
|
5
|
+
## Setup
|
|
6
|
+
|
|
7
|
+
- Fork & clone: `git clone https://github.com/LukasNiessen/ArchUnitPython.git`
|
|
8
|
+
- Install: `pip install -e ".[dev]"`
|
|
9
|
+
- Test: `pytest`
|
|
10
|
+
- Lint: `ruff check src/`
|
|
11
|
+
- Type check: `mypy src/archunitpython/`
|
|
12
|
+
|
|
13
|
+
## Guidelines
|
|
14
|
+
|
|
15
|
+
- Code Style: Run `ruff check` and `ruff format` before committing
|
|
16
|
+
- Commits: Use [Conventional Commits](https://www.conventionalcommits.org/) (see below)
|
|
17
|
+
- PRs: Use feature branches, clear descriptions, ensure CI passes
|
|
18
|
+
- Tests: Maintain high coverage
|
|
19
|
+
|
|
20
|
+
## Commit Convention
|
|
21
|
+
|
|
22
|
+
We use [Conventional Commits](https://www.conventionalcommits.org/) to automate versioning and changelog generation via [semantic-release](https://github.com/semantic-release/semantic-release). Your commit messages determine the next version number:
|
|
23
|
+
|
|
24
|
+
| Commit prefix | Version bump | Example |
|
|
25
|
+
|---|---|---|
|
|
26
|
+
| `fix:` | Patch (0.1.0 -> 0.1.1) | `fix: handle empty project in graph extraction` |
|
|
27
|
+
| `feat:` | Minor (0.1.0 -> 0.2.0) | `feat: add support for namespace packages` |
|
|
28
|
+
| `feat!:` or `BREAKING CHANGE:` in footer | Major (0.1.0 -> 1.0.0) | `feat!: remove deprecated API` |
|
|
29
|
+
|
|
30
|
+
Other prefixes like `chore:`, `docs:`, `refactor:`, `test:`, `ci:` do **not** trigger a release.
|
|
31
|
+
|
|
32
|
+
## Releases
|
|
33
|
+
|
|
34
|
+
Releases are fully automated. When a PR is merged to `main`:
|
|
35
|
+
|
|
36
|
+
1. CI runs lint + type checking + tests (across Python 3.10-3.13)
|
|
37
|
+
2. If CI passes, [semantic-release](https://github.com/semantic-release/semantic-release) analyzes commit messages since the last release
|
|
38
|
+
3. If there are `fix:` or `feat:` commits, it automatically:
|
|
39
|
+
- Bumps the version in `pyproject.toml`
|
|
40
|
+
- Updates `CHANGELOG.md`
|
|
41
|
+
- Publishes to PyPI
|
|
42
|
+
- Creates a GitHub release with release notes
|
|
43
|
+
|
|
44
|
+
No manual version bumping or publishing is needed.
|
|
45
|
+
|
|
46
|
+
## Documentation
|
|
47
|
+
|
|
48
|
+
Documentation is automatically generated from Python docstrings using [pdoc](https://pdoc.dev/) and deployed to GitHub Pages.
|
|
49
|
+
|
|
50
|
+
### Local Development
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
# Install pdoc
|
|
54
|
+
pip install pdoc
|
|
55
|
+
|
|
56
|
+
# Generate docs
|
|
57
|
+
pdoc src/archunitpython/ -o docs/
|
|
58
|
+
|
|
59
|
+
# Serve locally with live reload
|
|
60
|
+
pdoc src/archunitpython/
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### Writing Good Documentation
|
|
64
|
+
|
|
65
|
+
- Add docstrings to all public APIs
|
|
66
|
+
- Use Google-style docstring format
|
|
67
|
+
- Include code examples in docstrings where helpful
|
|
68
|
+
- Keep docstrings concise but informative
|
|
69
|
+
|
|
70
|
+
### Documentation Deployment
|
|
71
|
+
|
|
72
|
+
- Documentation is automatically deployed to [GitHub Pages](https://lukasniessen.github.io/ArchUnitPython/) on push to `main`
|
|
73
|
+
- Configuration is in `.github/workflows/docs.yaml`
|
|
74
|
+
|
|
75
|
+
## Issues
|
|
76
|
+
|
|
77
|
+
Bugs: Include environment, expected/actual behavior, steps, errors
|
|
78
|
+
Features: Check existing issues, provide use case
|
|
79
|
+
|
|
80
|
+
## Code of Conduct
|
|
81
|
+
|
|
82
|
+
Be respectful and inclusive.
|
|
83
|
+
Happy coding!
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
Copyright 2025 Lukas Niessen <lks.niessen@gmail.com> https://lukasniessen.com
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
4
|
+
|
|
5
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
6
|
+
|
|
7
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|