-
Notifications
You must be signed in to change notification settings - Fork 0
/
tox.ini
134 lines (119 loc) · 2.9 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]
minversion = 3.18
envlist = codestyle,docstyle,errors,types,test,coverage
isolated_build = True
[testenv]
extras = test
commands =
test-py3{5,6,7,8}: pytest {posargs:tests}
[testenv:format]
description = Autoformat code.
skip_install = true
envdir = {toxworkdir}/lint
deps =
black
isort >= 5.0
commands =
isort .
black src/ tests/
[testenv:lint]
description = Check code for stylistic and logical errors.
envdir = {toxworkdir}/lint
deps =
{[testenv:codestyle]deps}
{[testenv:docstyle]deps}
{[testenv:types]deps}
{[testenv:errors]deps}
commands =
{[testenv:codestyle]commands}
{[testenv:docstyle]commands}
{[testenv:types]commands}
{[testenv:errors]commands}
[testenv:codestyle]
description = Check code and tests for PEP 8 compliance and code complexity.
skip_install = true
envdir = {toxworkdir}/lint
deps =
flake8
isort >= 5.0
commands =
flake8 --select E,W,C --show-source src/ tests/
isort --check --diff .
[testenv:docstyle]
description = Check docstrings for PEP 257 compliance (Google style).
skip_install = true
envdir = {toxworkdir}/lint
deps =
pydocstyle
commands = pydocstyle src/
[testenv:errors]
description = Find errors with static code analysis.
envdir = {toxworkdir}/lint
deps =
flake8
flake8-gl-codeclimate
pylint
pylint-gitlab
commands =
flake8 --exit-zero --format gl-codeclimate --output-file flake.json --select F src/wea tests/
pylint --exit-zero --load-plugins=pylint_gitlab --output-format=gitlab-codeclimate:pylint.json,colorized --errors-only src/wea
[testenv:types]
description = Run static type checker.
skip_install = true
envdir = {toxworkdir}/lint
deps =
mypy
commands =
mypy --check-untyped-defs --no-implicit-optional src/
[testenv:test]
description = Run tests with pytest.
passenv = CI
extras = test
commands =
pytest --cov --cov-report= {posargs:tests}
[testenv:coverage]
description = Measure and report coverage.
deps =
coverage[toml]
commands =
coverage html
coverage xml
coverage report --fail-under 50
[testenv:clean]
description = Remove all generated and temporary files.
skip_install = true
allowlist_externals =
git
deps =
coverage[toml]
commands =
coverage erase
git clean -xfd
[testenv:docs]
description = Generate API documentation.
changedir = docs
extras = docs
commands =
sphinx-build -W -d {envtmpdir}/doctrees . {envtmpdir}/html
[testenv:build]
description = Build package.
allowlist_externals =
git
deps =
build[virtualenv]
commands =
git clean -xfd dist/
python -m build
[testenv:upload]
description = Upload package.
passenv =
TWINE_USERNAME
TWINE_PASSWORD
REPOSITORY_URL
commands =
twine upload dist/*
[flake8]
ignore = W503,E203
max-line-length = 88
[pydocstyle]
convention = google