forked from brunns/mbtest
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtox.ini
161 lines (144 loc) · 3.47 KB
/
tox.ini
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
[tox]
envlist = py36,py37,py38,py39,py310,pypy3.6
[testenv]
whitelist_externals =
find
sed
bash
extras =
test
commands =
{posargs:py.test} tests/unit/ tests/integration/
{[cleanup]commands}
passenv = *
usedevelop=True
[testenv:coverage]
envlist = py39
extras =
test
coverage
commands =
pytest --cov {envsitepackagesdir}/mbtest --durations=10 --cov-report term-missing --cov-fail-under 100 --basetemp={envtmpdir} {posargs}
{[cleanup]commands}
usedevelop=False
[testenv:publish-coverage]
envlist = py39
passenv = TRAVIS TRAVIS_* CODACY_*
extras =
test
coverage
commands =
pytest --cov {envsitepackagesdir}/mbtest --cov-report xml --cov-fail-under 100 --basetemp={envtmpdir} {posargs}
sed -i 's/\/home\/travis\/build\/brunns\/mbtest\/.tox\/publish-coverage\/lib\/python3..\/site-packages/src/g' coverage.xml
bash -c "python-codacy-coverage -r coverage.xml || true"
usedevelop=False
[coverage:run]
branch = True
omit = */matcher.py
[testenv:flake8]
basepython = python3
skip_install = true
deps =
flake8~=3.0
flake8-bugbear~=18.0
flake8-comprehensions~=1.0
flake8-mutable~=1.0
mccabe~=0.6
flake8-blind-except~=0.1
flake8-builtins~=1.0
flake8-pep3101~=1.0
flake8-print~=3.0
flake8-string-format~=0.2
flake8-logging-format~=0.5
flake8-colors~=0.1
flake8-comprehensions~=1.0
commands =
flake8 src/ tests/
[flake8]
max-complexity = 6
max-line-length = 120
show-source = True
enable-extensions = M,B,C
ignore = C812,W503,P103,E1,E2,E3,E5,E731
statistics = True
[testenv:bandit]
basepython = python3
skip_install = true
deps =
bandit~=1.5
commands =
bandit -r src/
[testenv:pylint]
basepython = python3
extras =
test
install
deps =
pylint~=2.2
commands =
pylint --disable=C src/
[testenv:mypy]
basepython = python3
skip_install = false
extras =
test
install
deps =
mypy~=0.76
commands =
mypy src/ {posargs}
[testenv:safety]
basepython = python3
deps =
safety~=1.8
commands =
safety check
[testenv:piprot]
basepython = python3
skip_install = true
deps =
piprot~=0.9
commands =
pip freeze | piprot
[testenv:format]
basepython = python3
skip_install = true
deps =
black==20.8b1
isort~=5.0
commands =
isort {toxinidir}/setup.py
isort {toxinidir}/src/
isort {toxinidir}/tests/
black -l100 -tpy36 src/ tests/ setup.py
[testenv:check-format]
basepython = python3
skip_install = true
deps = {[testenv:format]deps}
commands =
isort --check-only {toxinidir}/setup.py
isort --check-only {toxinidir}/src/
isort --check-only {toxinidir}/tests/
black --check -l100 -tpy36 src/ tests/ setup.py
[tool:isort]
multi_line_output=3
include_trailing_comma=True
force_grid_wrap=0
use_parentheses=True
line_length=100
[testenv:docs]
description = Invoke sphinx-build to build the HTML docs
basepython = python3
extras =
install
docs
commands = sphinx-build docs "{toxinidir}/build_docs" --color -W -bhtml {posargs}
python -c 'import pathlib; print("documentation available under file://\{0\}".format(pathlib.Path(r"{toxinidir}") / "build_docs" / "index.html"))'
[cleanup]
commands =
find {toxinidir}/tests -type f -name "*.pyc" -delete
find {toxinidir}/tests -type d -name "__pycache__" -delete
find {toxinidir}/src -type f -name "*.pyc" -delete
find {toxinidir}/src -type d -name "__pycache__" -delete
find {toxinidir}/src -type f -path "*.egg-info*" -delete
find {toxinidir}/src -type d -path "*.egg-info" -delete