-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtox.ini
More file actions
91 lines (77 loc) · 2.3 KB
/
tox.ini
File metadata and controls
91 lines (77 loc) · 2.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
[tox]
isolated_build = True
envlist = py312, architecture, clean-code
skip_missing_interpreters = True
[testenv]
skip_install = True
allowlist_externals =
poetry
python
commands_pre =
poetry install --sync
passenv =
PYTHONPATH
PYTHON*
HOME
[testenv:py312]
description = Run unit ests and coverage analysis
commands =
pytest tests/unit \
--cov={env:PACKAGE_NAME:mapping_suite_sdk} \
--cov-report=term \
--cov-report=term-missing:skip-covered \
#xml report for sonarcloud
--cov-report=xml:coverage.xml \
-v \
{posargs}
[coverage:run]
branch = True
source = mapping_suite_sdk
[coverage:report]
precision = 2
show_missing = True
skip_empty = True
sort = Cover
exclude_lines =
pragma: no cover
def __repr__
if self\.debug
raise AssertionError
raise NotImplementedError
if __name__ == .__main__.:
# Fail if coverage is below 80%
fail_under = 80
[coverage:xml]
output = coverage.xml
[pytest]
testpaths = tests
python_files = test_*.py
python_functions = test_*
addopts = -v --strict-markers
markers =
slow: marks tests as slow (deselect with '-m "not slow"')
integration: marks tests as integration tests
[testenv:architecture]
description = Validate architectural boundaries (Cosmic Python)
commands =
lint-imports
[testenv:clean-code]
description = Check code complexity and maintainability (Clean Code practices)
commands =
# Cyclomatic Complexity (CC) - Show only complex (C+) functions to reduce noise
radon cc mapping_suite_sdk -a --total-average --show-complexity --min C
# Maintainability Index (MI) - Show only poor quality (D, F) modules to reduce noise
radon mi mapping_suite_sdk --show --sort --min D
# Fail if complexity exceeds thresholds
# A = 1-5 (simple), B = 6-10 (manageable), C = 11-20 (complex)
xenon mapping_suite_sdk \
--max-absolute C \
--max-modules C \
--max-average B \
--exclude "*test*,*__pycache__*"
[testenv:clean-code-report]
description = Generate detailed complexity report (no failures)
commands =
radon cc mapping_suite_sdk -a --total-average --show-complexity --json > reports/complexity.json
radon mi mapping_suite_sdk --show --json > reports/maintainability.json
radon hal mapping_suite_sdk # Halstead complexity metrics