-
Notifications
You must be signed in to change notification settings - Fork 3
/
tox.ini
209 lines (188 loc) · 6.49 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
[tox]
# minversion = 1.7.2 needed for skip_missing_interpreters
minversion = 1.7.2
skipsdist = True
skip_missing_interpreters = True
envlist = flake8,pyflakes-{py26,py3,pypy},doctest-{py27,py34},py26,py27,py34
[tox:jenkins]
# Override default for WM Jenkins
# Others are run in their own individual jobs on WM Jenkins
# Wikimedia Jenkins does not have Python 2.6
envlist = flake8,pyflakes-{py3,pypy}
[params]
doctest_skip = --ignore-files=(gui\.py|botirc\.py|rcstream\.py)
[testenv]
setenv =
VIRTUAL_ENV={envdir}
PYWIKIBOT2_NO_USER_CONFIG=2
usedevelop = True
commands = python setup.py test
[testenv:py26]
deps = unittest2
[testenv:pyflakes-py26]
commands = findx . -name '*.py' -a '!' -path '*/.*' -a '!' -name 'user-config.py' : pyflakes
basepython = python2.6
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<3
pyflakes >= 1.1
pydocstyle >= 2.0.0
hacking
flake8-docstrings>=1.1.0
flake8-putty>=0.3.2
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
# 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-putty
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
[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
[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 -name "*.rst" -x -path ./docs : rstcheck --report severe
basepython = python3.4
deps =
-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: import order rules; Pywikibot uses rules H306 and I201
# The following are to be fixed
# C401, C402, C405: does not work with py 2.6
# D102: Missing docstring in public method
# D103: Missing docstring in public function
# E402: module level import not at top of file; see T87409
# H201: Except: format
# 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 = C401,C402,C405,E402,D105,D211,FI10,FI12,FI13,FI15,FI16,FI17,FI5,H101,H201,H236,H301,H404,H405,I100,I101,N802,N803,N806,D401,D413,D103,D412
exclude = .tox,.git,./*.egg,ez_setup.py,build,externals,user-config.py,./scripts/i18n/*
min-version = 2.6
max_line_length = 100
accept-encodings = utf-8
require-code = true
putty-auto-ignore = true
putty-ignore =
generate_family_file.py : +T001, T003
pwb.py : +T001, T003
setup.py : +T003
pywikibot/date.py,pywikibot/family.py,pywikibot/fixes.py,pywikibot/textlib.py,pywikibot/userinterfaces/terminal_interface_unix.py,pywikibot/userinterfaces/terminal_interface_win32.py,pywikibot/families/wikipedia_family.py : +E241
pywikibot/textlib.py : +N801
pywikibot/userinterfaces/transliteration.py : +N801
pywikibot/userinterfaces/win32_unicode.py : +N801, N812
tests/page_tests.py : +E241
scripts/,/pagegenerators.parameterHelp/ : +E241
scripts/imagetransfer.py,scripts/maintenance/wikimedia_sites.py : +E241
tests/ui_tests.py : +D102, D103, N801
tests/__init__.py,tests/aspects.py,tests/script_tests.py,tests/pwb/ : +T001, T003
tests/,/from pywikibot.tools import/ : +N813
scripts/checkimages.py,scripts/imagecopy.py,scripts/imagecopy_self.py : +N801
scripts/maintenance/make_i18n_dict.py : +T001, T003
scripts/archive/featured.py : +D102, D103
scripts/script_wui.py : +D102
scripts/makecat.py : +D103
scripts/interwiki.py,/""/ : +P102
pywikibot/__init__.py,/link_regex/ : +P103
# valid N805 naming convention exceptions
pywikibot/userinterfaces/terminal_interface.py,/from pywikibot.userinterfaces.terminal_interface_.* import .* as UI/ : +N814
# invalidly detected as {} format string:
tests/textlib_tests.py,/self.assert.*{{/ : +P103
# __dict__ used in a discouraged manner
# regex matches the first physical line of logical line of the error
pywikibot/exceptions.py , /PageRelatedError.*__init__/ : +H501
[pep8]
# see explanations above
ignore = E402
exclude = .tox,.git,./*.egg,ez_setup.py,build,externals,user-config.py,./scripts/i18n/*
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