forked from wikimedia/pywikibot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtox.ini
248 lines (223 loc) · 7.81 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
[tox]
# minversion = 1.7.2 needed for skip_missing_interpreters
minversion = 1.7.2
skipsdist = True
skip_missing_interpreters = True
envlist =
commit-message
flake8-{py38,py35}
hacking-py37
[params]
doctest_skip = --ignore-files=(eventstreams|gui|mysql)\.py
generate_user_files = -W error::UserWarning -m pwb generate_user_files -family:wikipedia -lang:test -v
[testenv]
basepython =
py35: python3.5
py36: python3.6
py37: python3.7
py38: python3.8
setenv =
VIRTUAL_ENV={envdir}
PYWIKIBOT_NO_USER_CONFIG=2
deeptest: PYWIKIBOT_TEST_AUTORUN=1
usedevelop = True
commands =
flake8: flake8 --version
flake8: flake8 --doctests {posargs}
hacking: flake8 --version
hacking: flake8 --format=default {posargs}
deeptest: python {[params]generate_user_files}
deeptest: python -m unittest discover -vv -p "*_tests.py"
fasttest: python {[params]generate_user_files}
fasttest: pytest --version
fasttest: pytest -a 'not net'
deps =
flake8: .[flake8]
hacking: .[hacking]
fasttest: pytest >= 5.3
fasttest: pytest-attrib>=0.1.3
fasttest: pytest-subtests >= 0.3.2
fasttest: mock
fasttest: .[mwparserfromhell]
fasttest: .[scripts]
fasttest-py35: .[html]
fasttest-py37: .[wikitextparser]
deeptest: .[html]
deeptest: .[mwparserfromhell]
deeptest: .[scripts]
deeptest: .[wikitextparser]
[testenv:commit-message]
basepython = python3
deps = commit-message-validator
commands = commit-message-validator
[testenv:doctest]
basepython = python3
commands =
python {[params]generate_user_files}
nosetests --version
nosetests --with-doctest pywikibot {[params]doctest_skip}
deps =
nose
.[mwparserfromhell]
[testenv:venv]
commands = {posargs}
[testenv:doc]
commands =
sphinx-build -M html ./docs ./docs/_build
rstcheck --recursive --report warning .
basepython = python3
deps =
-rrequirements.txt
-rdocs/requirements-py3.txt
rstcheck >= 3.3.1
[flake8]
# The following are intentionally ignored, possibly pending consensus
# D105: Missing docstring in magic method
# D211: No blank lines allowed before class docstring
# FI1: __future__ import "x" missing
# H101: TODO format
# H238: Old style class
# 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
# P101: format string does contain unindexed parameters
# P102: docstring does contain unindexed parameters
# P103: other string does contain unindexed parameters
# 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
ignore = B007,C103,D105,D211,D401,D413,D412,DAR003,DAR101,DAR102,DAR201,DAR202,DAR301,DAR401,DAR402,DAR501,FI1,H101,H238,H301,H306,H404,H405,H903,P101,P102,P103,P205,W503
enable-extensions = H203,H204,H205
exclude = .tox,.git,./*.egg,build,./scripts/i18n/*
classmethod-decorators = classmethod,classproperty
# darglint
strictness=short
docstring_style=sphinx
ignore_regex=:keyword
# flake8-coding
# note: C103 can be removed from ignore if scripts are cleaned from coding part
no-accept-encodings = true
# flake8-color
color = always
format = ${blue}%(path)s${reset}: ${bold}line %(row)d:${reset}%(col)d: ${red_bold}%(code)s${reset} %(text)s
# flake8-future-import
min-version = 3.5
require-code = true
# 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 =
pwb.py: FI53, T001
pywikibot/__init__.py: N802, N806, N815
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/__init__.py: N802
pywikibot/page/_collections.py: N802
pywikibot/pagegenerators.py: N802, N803, N806, N816
pywikibot/scripts/generate_family_file.py: T001
pywikibot/site/_datasite.py: N802
pywikibot/textlib.py: N801, N802, N803, N806
pywikibot/throttle.py: N802
pywikibot/tools/_logging.py: N802
pywikibot/userinterfaces/gui.py: N802, N803, N806, N812
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/userinterfaces/win32_unicode.py: N801, N803, N806, N812, T001
pywikibot/xmlreader.py: N802, N803, N806
scripts/archive/*: N802, N803, N806, N815, N816
scripts/add_text.py: N803, N806
scripts/blockpageschecker.py : N806, N816
scripts/category.py: N802, N803, N806
scripts/category_redirect.py: N802, N803, N806
scripts/checkimages.py: N801, N802, N803, N806, N816
scripts/clean_sandbox.py: N816
scripts/commonscat.py: N802, N806, N816
scripts/cosmetic_changes.py: N816
scripts/fixing_redirects.py: N803, N806
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: T001
scripts/misspelling.py: N802
scripts/movepages.py: N802, N803, N806
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
scripts/templatecount.py: N802
scripts/weblinkchecker.py: N802, N803, N806
scripts/welcome.py: N802, N815
setup.py: T001
tests/archive/*: N802
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/file_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/*: T001
tests/site_detect_tests.py: N802
tests/site_tests.py: N802
tests/sparql_tests.py: N802
tests/textlib_tests.py: N802
tests/thread_tests.py: N802
tests/tk_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
[isort]
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/archive/*,./scripts/i18n/*
# see explanations above
ignore = D105,D211
[pytest]
minversion = 5.3
testpaths = tests
python_files = *_tests.py
addopts = --ignore=tests/l10n_tests.py
norecursedirs = archive
filterwarnings = ignore::pytest.PytestDeprecationWarning