-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtox.ini
212 lines (191 loc) · 4.95 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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
[tox]
envlist = clean,py38,coverage,check
minversion = 3.3.0
isolated_build = true
[testenv]
description = Run tests with coverage in {envname}
deps = -r requirements-dev.txt
setenv =
# Use a unique data file to enable parallel runs
# Also supports combining in [testenv:coverage]
COVERAGE_FILE = .coverage.{envname}
commands =
coverage run -m pytest {posargs:tests}
[testenv:coverage]
# See related config and explanation in [coverage:*]
description = Combine coverage data and generate reports
basepython = python3.8
skip_install = true
depends = py38
deps =
coverage
setenv =
COVERAGE_FILE = .coverage
commands =
# Assuming failure means we've already combined .coverage.*
-coverage combine
coverage report
coverage html
[testenv:release]
description =
Upload distribution to TestPyPI after building and checking.
For PyPI, run `tox -e release pypi`.
basepython = python3.8
skip_install = true
deps =
wheel
twine
keyring
commands =
python scripts/clean_release.py
python setup.py sdist bdist_wheel
twine check dist/*
twine upload --repository {posargs:testpypi} dist/*
[testenv:check]
description = Run pre-commit checks on all files
basepython = python3.8
skip_install = true
deps =
pre-commit
commands =
python setup.py check --strict --metadata
pre-commit run --all-files # --show-diff-on-failure
[testenv:clean]
commands = coverage erase
skip_install = true
deps = coverage
[coverage:run]
branch = True
source =
ap_games
tests
omit =
*/setup.py
*/**/__init__.py
[coverage:paths]
# Enable `coverage combine` to convert long `.tox/**/site-packages` paths to
# short `src/` paths. The former is a side-effect of running tests using the
# installed package. See https://hynek.me/articles/testing-packaging/#cc.
source =
src/
*/site-packages/
[coverage:report]
# fail_under = 60
exclude_lines =
# a more strict default pragma
\# pragma: no cover\b
# repl
def __repr__
# allow defensive code
^\s*raise AssertionError\b
^\s*raise NotImplementedError\b
^\s*return NotImplemented\b
^\s*raise$
# typing-related code
if TYPE_CHECKING:
: \.\.\.$
^ +\.\.\.$
-> NoReturn:
# non-runnable code
if __name__ == ['"]__main__['"]:$
[check-manifest]
ignore =
tox.ini
tests/**
[darglint]
docstring_style=sphinx
strictness=full
ignore_regex=^__(.*)
ignore = DAR201
[flake8]
# Base flake8 configuration:
# https://flake8.pycqa.org/en/latest/user/configuration.html
show-source = True
statistics = False
doctests = True
# Plugins:
max-complexity = 6
max-line-length = 79
# Plugin: application-import-names
import-order-style = google
application-import-names = ap_games,tests
# Plugin: flake8-docstrings
docstring-convention = pep257
# Plugin: flake8-rst-docstrings
rst-roles =
attr,
class,
func,
meth,
mod,
rst-directives =
note,
warning,
versionadded,
versionchanged,
seealso,
# Plugin: flake8-mypy
mypy_config = setup.cfg
# Disable some pydocstyle checks:
# Exclude some pydoctest checks globally:
ignore =
D100, # Missing docstring in public module
D104, # Missing docstring in public package
D106, # Missing docstring in public nested class
D105, # Missing docstring in magic method
D107, # Missing docstring in __init__
C812, # flake8-commas: missing trailing comma
C816, # missing trailing comma in Python 3.6+
T499, # internal mypy traceback, stderr output or an unmatched line
W503, # Line break occurred before a binary operator
WPS305, # Found `f` string
WPS433, # Found nested import
WPS306, # Found class without a base class
WPS326, # Found implicit string concatenation
# Excluding some directories:
exclude =
.git,
__pycache__,
.tox,
.venv,
doc,
.eggs,
*.egg,
build,
dist,
# Ignoring some errors in some files:
per-file-ignores =
# Enable `assert` keyword and magic numbers for tests:
tests/**/*.py: D100, D101, D102, D103, S101, WPS226, WPS309, WPS432
[isort]
src_paths = src,scripts,tests
known_first_party = ap_games
order_by_type = False
# google profile
# https://timothycrosley.github.io/isort/docs/configuration/profiles/
force_single_line = True
force_sort_within_sections = True
lexicographical = True
# https://simpleisbetterthancomplex.com/packages/2016/10/08/isort.html
## change it for the name of your project
sections = FUTURE,STDLIB,THIRDPARTY,FIRSTPARTY,LOCALFOLDER
[pydocstyle]
convention = pep257
match_dir = (scripts|src|tests)
add_ignore =
D100, # Missing docstring in public module
D104, # Missing docstring in public package
D105, # Missing docstring in magic method
D107, # Missing docstring in __init__
[tool:pytest]
minversion = 6.0
python_functions = test_*
swapdiff = 1
# Directories that are not visited by pytest collector:
norecursedirs = .* build dist *.egg src docs __pycache__
# Extra options:
addopts =
-p no:logging
--strict
--tb=short
--doctest-modules