-
Notifications
You must be signed in to change notification settings - Fork 194
/
tox.ini
243 lines (218 loc) · 7.08 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
[tox]
# minversion = 1.7.2 needed for skip_missing_interpreters
minversion = 1.7.2
skipsdist = True
skip_missing_interpreters = True
envlist =
commit-message
lint-py{39,312}
[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
pypy: pypy3
setenv =
VIRTUAL_ENV={envdir}
PRE_COMMIT_COLOR=always
PYWIKIBOT_NO_USER_CONFIG=2
PYWIKIBOT_TEST_RUNNING=1
passenv =
SSH_AUTH_SOCK
http_proxy
https_proxy
no_proxy
usedevelop = True
commands =
python --version
lint: pre-commit run --all-files --show-diff-on-failure
deeptest: python {[params]generate_user_files}
deeptest-py37: python -m unittest discover -vv -p "*_tests.py"
deeptest-py312: pytest
fasttest: python {[params]generate_user_files}
fasttest: pytest --version
fasttest: pytest -a 'not net'
deps =
lint: pre-commit >= 2.17.0
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.12
commands =
sphinx-build -M html ./docs ./docs/_build -j auto
deps =
-rrequirements.txt
-rdocs/requirements.txt
[testenv:rstcheck]
basepython = python3.12
commands =
rstcheck --version
rstcheck --report-level WARNING -r .
deps =
-rrequirements.txt
-rdocs/requirements.txt
[testenv:sphinx]
basepython = python3.12
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
# 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
# DARXXX: Darglint docstring issues to be solved
# DAR000: T368849
ignore = B007,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/*
color = always
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/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, 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: N802
tests/wbtypes_tests.py: 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
[pycodestyle]
exclude = .tox,.git,./*.egg,build,./scripts/i18n/*
[pytest]
minversion = 7.0.1
testpaths = tests
python_files = *_tests.py
addopts = --ignore=tests/l10n_tests.py