-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtox.ini
134 lines (118 loc) · 2.59 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
[tox]
envlist =
linters
py
[pytest]
# Makes all warnings be fatal
# Disabled due to tqdm incompatibility to python 3.12 :
# https://github.com/tqdm/tqdm/issues/1517
# filterwarnings = error
junit_family = xunit1
testpaths = tests
[flake8]
max-complexity = 16
filename=
./src/*.py,
./src/**/*.py,
./tests/*.py,
./tests/**/*.py
# Set to 88 for black
max-line-length = 88
statistics = True
exclude =
docs
build
env
.tox
[isort]
multi_line_output = 3
include_trailing_comma = true
force_grid_wrap = 0
use_parentheses = True
line_length = 88
[coverage:run]
branch = True
omit =
*/__init__.py
source =
adventofcode
adventofcode2016
adventofcode2018
adventofcode2019
adventofcode2020
adventofcode2021
adventofcode2022
adventofcode2023
adventofcode2024
tests
[coverage:report]
# We're not yet started so test coverage will be low. Increase as time goes on
fail_under = 10
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
[testenv]
deps =
pytest
pytest-cov
pytest-xdist
commands =
pytest {posargs} -n auto
[testenv:flake8]
skip_install = true
deps =
flake8
pep8-naming
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
# E701 Multiple statements on a line: https://github.com/psf/black/issues/4173
--ignore E203,W503,E701 \
{posargs}
[testenv:black]
skip_install = true
deps =
black
commands =
black --target-version py310 --check --diff src/ tests/
[testenv:mypy]
skip_install = true
description = type check ourselves
deps =
mypy
lxml
types-requests
attrs
numpy
commands =
python -m mypy --config-file mypy.ini src/
[testenv:isort]
skip_install = true
description = Make sure our imports are nicely sorted
deps = isort
commands =
isort --check-only src/ tests/
[testenv:bandit]
skip_install = true
description = Find common security issues in Python code
deps = bandit
commands =
bandit -c pyproject.toml -r src/ tests/
# Combines all linters in one, fast, env
[testenv:linters]
skip_install = true
deps =
{[testenv:black]deps}
{[testenv:flake8]deps}
{[testenv:isort]deps}
{[testenv:bandit]deps}
#{[testenv:mypy]deps}
commands =
{[testenv:black]commands}
{[testenv:flake8]commands}
{[testenv:isort]commands}
{[testenv:bandit]commands}
#{[testenv:mypy]commands}