forked from RoelAdriaans/yaplox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tox.ini
131 lines (115 loc) · 2.49 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
[tox]
skipsdist = True
envlist =
linters
py38
[pytest]
# Makes all warnings be fatal
filterwarnings = error
junit_family = xunit1
testpaths = tests
addopts = --cov --cov-report=term --cov-report=html --cov-report=xml
[flake8]
max-complexity = 10
filename=
./src/*.py,
./src/**/*.py,
./tests/*.py,
./tests/**/*.py
./tools/*.py,
./tools/**/*.py,
# Set to 88 for black
max-line-length = 88
statistics = True
exclude =
docs
build
env
.venv
venv
.tox
format = ${cyan}%(path)s${reset}:${yellow_bold}%(row)d${reset}:${green_bold}%(col)d${reset}: ${red_bold}%(code)s${reset} %(text)s
[coverage:run]
branch = True
omit =
*/__init__.py
*/__main__.py
source =
yaplox
tests
[coverage:report]
fail_under = 80
exclude_lines =
# Have to re-enable the standard pragma
pragma: no cover
# Don't complain if tests don't hit defensive assertion code:
raise NotImplementedError
# Exclude the lines with TYPE_CHECKING. These lines are added to prevent
# circular imports
if TYPE_CHECKING:
[testenv]
whitelist_externals =
poetry
; coverage
skip_install = true
deps =
coverage
pytest
pytest-cov
pytest-mock
pytest-xdist
commands =
# We have to install the package first
poetry install --no-interaction
pytest {posargs}
[isort]
multi_line_output = 3
include_trailing_comma = true
force_grid_wrap = 0
use_parentheses = True
line_length = 88
[testenv:flake8]
skip_install = true
deps =
flake8
pep8-naming
flake8-colors
commands =
flake8 \
# E203 is not PEP8 compliant https://github.com/ambv/black#slices
# W503 is not PEP8 compliant https://github.com/ambv/black#line-breaks--binary-operators
--ignore E203,W503 \
{posargs}
[testenv:black]
skip_install = true
deps =
black
commands =
black --check --diff src/ tests/ tools/
[testenv:mypy]
skip_install = true
description = type check ourselves
deps =
mypy
lxml
commands =
python -m mypy --config-file mypy.ini src/ tools/
[testenv:isort]
skip_install = true
description = Make sure our imports are nicely sorted
deps = isort
commands =
isort --check-only src/ tests/ tools/
# Combines all linters in one, fast, env
[testenv:linters]
skip_install = true
deps =
{[testenv:black]deps}
{[testenv:flake8]deps}
{[testenv:isort]deps}
{[testenv:mypy]deps}
commands =
{[testenv:black]commands}
{[testenv:flake8]commands}
{[testenv:isort]commands}
{[testenv:mypy]commands}