forked from wikimedia/pywikibot
-
Notifications
You must be signed in to change notification settings - Fork 3
/
tox.ini
263 lines (235 loc) · 7.88 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
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
[tox]
# minversion = 1.7.2 needed for skip_missing_interpreters
minversion = 1.7.2
skipsdist = True
skip_missing_interpreters = True
envlist =
commit-message
flake8-py3{7,8,9}
hacking-py3{7,8,9}
[params]
# Note: tox 4 does not support multiple lines when doing parameters
# substitution.
generate_user_files = -W error::UserWarning -m pwb generate_user_files -family:wikipedia -lang:test -v
[testenv]
basepython =
py37: python3.7
py38: python3.8
py39: python3.9
py310: python3.10
py311: python3.11
py312: python3.12
setenv =
VIRTUAL_ENV={envdir}
PYWIKIBOT_NO_USER_CONFIG=2
PYWIKIBOT_TEST_RUNNING=1
usedevelop = True
commands =
python --version
flake8: flake8 --version
flake8: flake8 --color always --doctests {posargs}
hacking: flake8 --version
hacking-py37: flake8 --format=default {posargs}
hacking-py38: flake8 --color always {posargs}
hacking-py39: flake8 --color always {posargs}
deeptest: python {[params]generate_user_files}
deeptest-py37: python -m unittest discover -vv -p "*_tests.py"
deeptest-py39: pytest
fasttest: python {[params]generate_user_files}
fasttest: pytest --version
fasttest: pytest -a 'not net'
deps =
flake8: .[flake8]
hacking: .[hacking]
fasttest: pytest >= 7.0.1
fasttest: pytest-attrib>=0.1.3
fasttest: pytest-subtests >= 0.3.2
fasttest: mock
fasttest: .[scripts]
fasttest-py37: .[html]
fasttest-py38: .[wikitextparser]
deeptest: .[html]
deeptest: .[scripts]
deeptest-py312: .[wikitextparser]
deeptest-py312: pytest >= 7.0.1
deeptest-py312: pytest-subtests >= 0.3.2
[testenv:typing]
basepython = python3.7
deps = pytest-mypy
commands =
mypy --version
pytest --mypy -m mypy pywikibot
[testenv:commit-message]
basepython = python3
deps = commit-message-validator
commands = commit-message-validator
[testenv:doctest]
basepython = python3.7
commands =
python {[params]generate_user_files}
pytest --version
# gui.py needs tkinter
# memento.py has too many timeout
pytest pywikibot --doctest-modules --ignore-glob="*gui.py" --ignore-glob="*memento.py"
deps =
pytest >= 7.0.1
wikitextparser
.[eventstreams]
.[mysql]
[testenv:venv]
commands = {posargs}
[testenv:doc]
basepython = python3.9
commands =
sphinx-build -M html ./docs ./docs/_build -j auto
deps =
-rrequirements.txt
-rdocs/requirements.txt
[testenv:rstcheck]
basepython = python3.9
commands =
rstcheck --version
rstcheck -r --report-level WARNING --ignore-roles api,phab,source .
deps =
-rrequirements.txt
-rdocs/requirements.txt
[testenv:sphinx]
basepython = python3.9
commands =
sphinx-build -M html ./docs ./docs/_build -j auto -D html_theme=nature
deps =
-rrequirements.txt
-rdocs/requirements.txt
[flake8]
# The following are intentionally ignored, possibly pending consensus
# D105: Missing docstring in magic method
# D211: No blank lines allowed before class docstring
# E704: multiple statements on one line (def)
# FI1: __future__ import "x" missing
# H101: TODO format
# H23: Python 3 compatibility tests
# H301: Do not import more than one module per line
# H306: Alphabetically order your imports by the full module path
# H404: docstring multiline start
# H405: docstring summary line
# H903: Use only UNIX style newlines, not Windows style
# R100: raise in except handler without from
# W503: line break before binary operator; against current PEP 8 recommendation
# Errors occurred after upgrade to pydocstyle 2.0.0 (T164142)
# D401: First line should be in imperative mood; try rephrasing
# D412: No blank lines allowed between a section header and its content
# D413: Missing blank line after last section
# DARXXX: Darglint docstring issues to be solved
# DAR000: T368849
ignore = B007,D105,D211,D401,D413,D412,DAR000,DAR003,DAR101,DAR102,DAR201,DAR202,DAR301,DAR401,DAR402,DAR501,E704,H101,H231,H232,H233,H234,H235,H236,H237,H238,H301,H306,H404,H405,H903,R100,W503
enable-extensions = H203,H204,H205,N818
count = True
exclude = .tox,.git,./*.egg,build,./scripts/i18n/*
format = %(blue)s%(path)s%(reset)s: %(bold)sline %(row)d:%(reset)s%(col)d: %(bold)s%(red)s%(code)s%(reset)s %(text)s
max-complexity = 49
max-doc-length = 79
# The following are to be fixed
# N802: function name should be lowercase
# N803: argument name should be lowercase
# N806: variable in function should be lowercase
# N815: mixedCase variable in class scope
# N816: mixedCase variable in global scope
per-file-ignores =
pywikibot/_wbtypes.py: N802
pywikibot/backports.py: F401
pywikibot/bot.py: N802, N816
pywikibot/config.py: N816
pywikibot/cosmetic_changes.py: N802, N803, N806, N816
pywikibot/date.py: N802, N803, N806, N816
pywikibot/editor.py: N803, N806
pywikibot/exceptions.py: H501
pywikibot/families/*: D102
pywikibot/family.py: N802, N803, N806, N815
pywikibot/fixes.py: E241
pywikibot/interwiki_graph.py: N802, N803, N806
pywikibot/login.py: N802, N816
pywikibot/page/_basepage.py: N802
pywikibot/page/_collections.py: N802
pywikibot/page/_wikibase.py: N802
pywikibot/pagegenerators/__init__.py: N802
pywikibot/pagegenerators/_filters.py: N802
pywikibot/pagegenerators/_generators.py: N802
pywikibot/scripts/generate_family_file.py: T201
pywikibot/scripts/wrapper.py: FI53, T201
pywikibot/site/_datasite.py: N802
pywikibot/textlib.py: N801, N802, N803, N806
pywikibot/throttle.py: N802
pywikibot/tools/_logging.py: N802
pywikibot/userinterfaces/terminal_interface.py: N814
pywikibot/userinterfaces/terminal_interface_base.py: N802, N803, N806, N816
pywikibot/userinterfaces/terminal_interface_unix.py: E241, N816
pywikibot/userinterfaces/terminal_interface_win32.py: E241, N816
pywikibot/xmlreader.py: N802, N803, N806
scripts/clean_sandbox.py: N816
scripts/commonscat.py: N802, N806, N816
scripts/cosmetic_changes.py: N816
scripts/dataextend.py: C901, D101, D102, E501
scripts/harvest_template.py: N802, N816
scripts/interwiki.py: N802, N803, N806, N816
scripts/imagetransfer.py: N803, N806, N816
scripts/maintenance/make_i18n_dict.py: T201
scripts/misspelling.py: N802
scripts/noreferences.py: N802, N803, N806, N816
scripts/redirect.py: N803, N806
scripts/reflinks.py: N802, N816
scripts/replace.py: N802, N803, N806, N816
scripts/solve_disambiguation.py: N802, N806
setup.py: T201
tests/api_tests.py: N802
tests/archivebot_tests.py: N802
tests/aspects.py: N802
tests/bot_tests.py: N802
tests/collections_tests.py: N802
tests/cosmetic_changes_tests.py: N802
tests/date_tests.py: N802
tests/edit_failure_tests.py: N802
tests/family_tests.py: N802
tests/i18n_tests.py: N802
tests/interwiki_link_tests.py: N802
tests/link_tests.py: N802
tests/login_tests.py: N802
tests/namespace_tests.py: N802
tests/page_tests.py: E241, N802
tests/pagegenerators_tests.py: N802
tests/pwb/*: T201
tests/site_detect_tests.py: N802
tests/sparql_tests.py: N802
tests/textlib_tests.py: N802
tests/thread_tests.py: N802
tests/tools_formatter_tests.py: N802
tests/tools_tests.py: N802
tests/ui_options_tests.py: N802
tests/ui_tests.py: D102, D103, N802
tests/wikibase_edit_tests.py: N802
tests/wikibase_tests.py: N802
tests/xmlreader_tests.py: N802
# darglint
strictness=short
docstring_style=sphinx
ignore_regex=:keyword
# pep8-naming
classmethod-decorators = classmethod,classproperty
[isort]
py_version = 37
add_imports = from __future__ import annotations
atomic = true
ensure_newline_before_comments = true
force_grid_wrap = 0
include_trailing_comma = true
lines_after_imports = 2
multi_line_output = 3
use_parentheses = true
[pycodestyle]
exclude = .tox,.git,./*.egg,build,./scripts/i18n/*
# see explanations above
ignore = D105,D211
[pytest]
minversion = 7.0.1
testpaths = tests
python_files = *_tests.py
addopts = --ignore=tests/l10n_tests.py