-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtox.ini
More file actions
171 lines (156 loc) · 3.51 KB
/
tox.ini
File metadata and controls
171 lines (156 loc) · 3.51 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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
[tox]
envlist =
py39,
py310,
py311,
py312,
lint,
type,
format,
security,
coverage,
docs,
test-docs,
pep8,
pylint,
performance,
quality,
pre-commit
isolated_build = True
skip_missing_interpreters = True
[testenv]
deps =
pytest>=7.0.0
pytest-mock>=3.10.0
-r{toxinidir}/requirements.txt
-r{toxinidir}/requirements-test.txt
commands =
pytest {posargs:tests/unit -v}
[testenv:lint]
description = Run linters (flake8, black, isort)
deps =
-r{toxinidir}/requirements-test.txt
commands =
flake8 maas_cpu_analyzer/ tests/ --config=.flake8
black --check --diff maas_cpu_analyzer/ tests/
isort --check-only --diff maas_cpu_analyzer/ tests/
[testenv:type]
description = Run type checker (mypy)
deps =
-r{toxinidir}/requirements.txt
-r{toxinidir}/requirements-test.txt
commands =
mypy maas_cpu_analyzer/ --ignore-missing-imports
[testenv:format]
description = Check code formatting
deps =
-r{toxinidir}/requirements-test.txt
commands =
black --check --diff maas_cpu_analyzer/ tests/
isort --check-only --diff maas_cpu_analyzer/ tests/
[testenv:security]
description = Run security checks
deps =
-r{toxinidir}/requirements-test.txt
commands =
bandit -r maas_cpu_analyzer/ -ll
pip-audit -r requirements.txt -r requirements-test.txt
[testenv:coverage]
description = Run tests with coverage
deps =
-r{toxinidir}/requirements.txt
-r{toxinidir}/requirements-test.txt
commands =
pytest --cov=maas_cpu_analyzer --cov-report=html --cov-report=term-missing --cov-report=xml
[testenv:docs]
description = Build documentation
deps =
-r{toxinidir}/requirements-test.txt
commands =
sphinx-build -W -b html docs/ docs/_build/html
[testenv:test-docs]
description = Test documentation build and content
deps =
-r{toxinidir}/requirements.txt
-r{toxinidir}/requirements-test.txt
commands =
pytest tests/documentation/ -v
[testenv:pep8]
description = Run PEP 8 style checks
deps =
-r{toxinidir}/requirements-test.txt
commands =
flake8 maas_cpu_analyzer/ tests/ --config=.flake8
[testenv:pylint]
description = Run pylint static analysis
deps =
-r{toxinidir}/requirements-test.txt
commands =
pylint maas_cpu_analyzer/
[testenv:performance]
description = Run performance and profiling tests
deps =
-r{toxinidir}/requirements.txt
-r{toxinidir}/requirements-test.txt
commands =
pytest tests/performance/ --benchmark-only --benchmark-skip
pytest tests/ --timeout=30
[testenv:quality]
description = Run code quality checks
deps =
-r{toxinidir}/requirements-test.txt
commands =
radon cc maas_cpu_analyzer/ --min A
radon mi maas_cpu_analyzer/ --min A
xenon maas_cpu_analyzer/ --max-absolute A --max-modules A --max-average A
vulture maas_cpu_analyzer/ --min-confidence 60
dead maas_cpu_analyzer/
[testenv:pre-commit]
description = Run pre-commit hooks
deps =
-r{toxinidir}/requirements-test.txt
commands =
pre-commit run --all-files
[flake8]
max-line-length = 88
extend-ignore =
E203,
W503,
E501,
D100,
D101,
D102,
D103,
D104,
D105,
D107,
D400,
D401,
I100,
I201
exclude =
.git,
__pycache__,
.tox,
.eggs,
*.egg,
build,
dist,
.venv,
venv,
.pytest_cache,
.coverage,
htmlcov
[mypy]
python_version = 3.9
warn_return_any = True
warn_unused_configs = True
disallow_untyped_defs = False
ignore_missing_imports = True
exclude =
tests/
build/
dist/
.tox/
.venv/
venv/