forked from wikimedia/pywikibot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tox.ini
228 lines (206 loc) · 6.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
[tox]
# minversion = 1.7.2 needed for skip_missing_interpreters
minversion = 1.7.2
skipsdist = True
skip_missing_interpreters = True
envlist = diff-checker,commit-message,flake8,pyflakes-{py27,py3,pypy},doctest-{py27,py34},py27,py34
[tox:jenkins]
# Override default for WM Jenkins
# Others are run in their own individual jobs on WM Jenkins
envlist = diff-checker,commit-message,flake8,pyflakes-{py3,pypy}
[params]
doctest_skip = --ignore-files=(gui\.py|botirc\.py|eventstreams\.py)
[testenv]
setenv =
VIRTUAL_ENV={envdir}
PYWIKIBOT2_NO_USER_CONFIG=2
usedevelop = True
commands = python setup.py test
[testenv:diff-checker]
deps = unidiff
commands = python pwb.py diff_checker
[testenv:commit-message]
deps = commit-message-validator
commands = commit-message-validator
[testenv:pyflakes-py27]
commands = findx . -name '*.py' -a '!' -path '*/.*' -a '!' -name 'user-config.py' : pyflakes
basepython = python2.7
deps =
pyflakes
findx >= 0.9.9
[testenv:pyflakes-py3]
commands = findx . -name '*.py' -a '!' -path '*/.*' -a '!' -name 'user-config.py' : pyflakes
basepython = python3
deps =
findx >= 0.9.9
pyflakes
[testenv:pyflakes-pypy]
commands = findx . -name '*.py' -a '!' -path '*/.*' -a '!' -name 'user-config.py' : pyflakes
basepython = pypy
deps =
findx >= 0.9.9
pyflakes
[testenv:flake8]
commands =
flake8 --version
flake8 --doctests {posargs}
basepython = python2.7
deps = flake8
pyflakes >= 1.1
pydocstyle
hacking
flake8-docstrings>=1.1.0
flake8-per-file-ignores
flake8-coding<1.3.0
flake8-comprehensions
flake8-future-import
flake8-string-format
flake8-import-order
flake8-tuple>=0.2.8
flake8-print>=2.0.1
flake8-mock>=0.3
pep8-naming
flake8-invalid-escape-sequences
# 4a226d07 is https://github.com/erikrose/blessings/pull/104
[testenv:flake8-diff]
commands =
flake8 --version
flake8-diff --flake8-options --ignore={[flake8]ignore} {posargs}
deps = flake8-diff
https://github.com/erikrose/blessings/archive/4a226d07.zip
flake8-docstrings<0.2.2
flake8-per-file-ignores
pep8-naming
flake8-quotes
flake8-blind-except
[testenv:nose]
commands =
python -W error::UserWarning -m generate_user_files -family:test -lang:test -v
nosetests --version
nosetests --with-detecthttp -v -a '!net' tests
deps =
nose
nose-detecthttp
unicodecsv
mock
vcrpy-unittest
[testenv:nose34]
basepython = python3
commands =
python -W error::UserWarning -m generate_user_files -family:test -lang:test -v
nosetests --version
nosetests --with-detecthttp -v -a '!net' tests
deps =
mwparserfromhell
beautifulsoup4
nose
nose-detecthttp>=0.1.3
six
mock
vcrpy-unittest
[testenv:doctest]
commands =
python -W error::UserWarning -m generate_user_files -family:test -lang:test -v
nosetests --version
nosetests --with-doctest pywikibot {[params]doctest_skip}
basepython =
py27: python2.7
py34: python3.4
deps =
nose
six
[testenv:venv]
commands = {posargs}
[testenv:doc]
commands =
make html -C ./docs
findx -type f -name '*.rst' -not -path './.tox/*' : rstcheck --report warning --ignore-directives automodule,autoclass,autofunction
basepython = python3.4
deps =
-rrequirements.txt
-rrequests-requirements.txt
-rdocs/requirements-py3.txt
findx >= 0.9.9
rstcheck
[flake8]
# The following are intentionally ignored, possibly pending consensus
# D105: Missing docstring in magic method
# D211: No blank lines allowed before class docstring
# FI10,FI12,FI13,FI15: __future__ import "division", "with_statement", "print_function" and "generator_stop" missing
# FI5: __future__ import "x" present
# H101: TODO format
# H236: Mandatory use of six for Python 2 & 3 metaclass support
# H404: docstring multiline start
# H405: docstring summary line
# H301,I100,I101,202: import order rules; Pywikibot uses rules H306 and I201
# W503: line break before binary operator; against current PEP 8 recommendation
# P101: format string does contain unindexed parameters
# The following are to be fixed
# D102: Missing docstring in public method
# D103: Missing docstring in public function
# E402: module level import not at top of file; see T87409
# N802, N803, N806 : naming convention
# P102,P103: string does contain unindexed parameters; see I36355923
# Errors occured after upgrade to pydocstyle 2.0.0 (T164142)
# D401: First line should be in imperative mood; try rephrasing
# D413: Missing blank line after last section
# D412: No blank lines allowed between a section header and its content
ignore = E402,D105,D211,FI10,FI12,FI13,FI15,FI16,FI17,FI5,H101,H236,H301,H404,H405,H903,I100,I101,I202,N802,N803,N806,D401,D413,D103,D412,P101,W503
exclude = .tox,.git,./*.egg,ez_setup.py,build,externals,user-config.py,./scripts/i18n/*,scripts/userscripts/*
min-version = 2.7
max_line_length = 100
accept-encodings = utf-8
require-code = true
per-file-ignores =
generate_family_file.py : T001
pwb.py : T001
setup.py : T001
pywikibot/comms/http.py : T001
pywikibot/date.py : E241
pywikibot/family.py : E241
pywikibot/fixes.py : E241
pywikibot/textlib.py : E241
pywikibot/userinterfaces/gui.py : N812
pywikibot/userinterfaces/terminal_interface_unix.py : E241
pywikibot/userinterfaces/terminal_interface_win32.py : E241
pywikibot/textlib.py : N801
pywikibot/userinterfaces/transliteration.py : N801
pywikibot/userinterfaces/win32_unicode.py : N801, N812, T001
tests/page_tests.py : E241
scripts/imagetransfer.py : E241
tests/ui_tests.py : D102, D103, N801
tests/* : N813
scripts/checkimages.py : N801
scripts/imagecopy.py : N801
scripts/imagecopy_self.py : N801
scripts/archive/featured.py : D102, D103
scripts/flickrripper.py : T001
scripts/harvest_template.py : T001
scripts/script_wui.py : D102
scripts/makecat.py : D103
scripts/maintenance/* : T001
scripts/interwiki.py : P102
pywikibot/__init__.py : P103
# pydocstyle cannot handle multiple __all__ variables
pywikibot/__init__.py : D999
# valid N805 naming convention exceptions
pywikibot/userinterfaces/terminal_interface.py : N814
tests/pwb/* : T001
# invalidly detected as {} format string:
tests/textlib_tests.py : P103
# __dict__ used in a discouraged manner
# regex matches the first physical line of logical line of the error
pywikibot/exceptions.py : H501
[pep8]
# see explanations above
ignore = E402
exclude = .tox,.git,./*.egg,ez_setup.py,build,externals,user-config.py,./scripts/i18n/*,scripts/userscripts/*
max_line_length = 100
[pep257]
# see explanations above
ignore = D105,D211
[pytest]
python_files=tests/*.py
# disable recursing into tests/pwb, as that prints the environment,
# exposing any secure variables in Travis.
norecursedirs=.git .svn .tox pwb