[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 = pip install -e .[flake8] flake8 --version flake8 --doctests {posargs} basepython = python2.7 # 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 = pip install -e .[security] 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 -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: Do not import more than one module per line; Pywikibot uses H306 (Alphabetically order your imports by the full module path) # 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 # N802: function name should be lowercase # N803: argument name should be lowercase # N806: variable in function should be lowercase # 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 = D105,D211,FI10,FI12,FI13,FI15,FI16,FI17,FI5,H101,H236,H301,H404,H405,H903,N802,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 # pydocstyle cannot handle multiple __all__ variables pywikibot/__init__.py : P103, D999, N806 pywikibot/bot.py : N806 pywikibot/comms/http.py : T001 pywikibot/compat/catlib.py : N803 pywikibot/config2.py : N806 pywikibot/cosmetic_changes.py : N803, N806 pywikibot/data/api.py : N803, N806 pywikibot/data/wikistats.py : N806 pywikibot/date.py : E241, N803, N806 pywikibot/diff.py : N806 pywikibot/editor.py : N803, N806 # __dict__ used in a discouraged manner # regex matches the first physical line of logical line of the error pywikibot/exceptions.py : H501 # classproperties; most docs should go to family.py pywikibot/families/* : N805, D102 pywikibot/family.py : E241, N803, N806, N805 pywikibot/fixes.py : E241 pywikibot/interwiki_graph.py : N803, N806 pywikibot/logging.py : N803 pywikibot/page.py : N803, N806 pywikibot/pagegenerators.py : N803, N806 pywikibot/site.py : N803, N806 pywikibot/specialbots.py : N803, N806 pywikibot/textlib.py : E241, N801, N803, N806 pywikibot/titletranslate.py : N806 pywikibot/tools/_logging.py : N806 pywikibot/tools/ip.py : N803 pywikibot/userinterfaces/cgi_interface.py : N803 pywikibot/userinterfaces/gui.py : N812, N803, N806 # valid N805 naming convention exceptions pywikibot/userinterfaces/terminal_interface.py : N814 pywikibot/userinterfaces/terminal_interface_base.py : N803, N806 pywikibot/userinterfaces/terminal_interface_unix.py : E241, N806 pywikibot/userinterfaces/terminal_interface_win32.py : E241 pywikibot/userinterfaces/transliteration.py : N801 pywikibot/userinterfaces/win32_unicode.py : N801, N812, T001, N803, N806 pywikibot/xmlreader.py : N803, N806 scripts/add_text.py : N803, N806 scripts/archive/featured.py : D102, D103 scripts/basic.py : N806 scripts/blockpageschecker.py : N803, N806 scripts/capitalize_redirects.py : N806 scripts/casechecker.py : N803, N806 scripts/category.py : N803, N806 scripts/category_redirect.py : N803, N806 scripts/cfd.py : N803, N806 scripts/checkimages.py : N801, N803, N806 scripts/clean_sandbox.py : N806 scripts/commons_link.py : N806 scripts/commonscat.py : N803, N806 scripts/cosmetic_changes.py : N806 scripts/create_categories.py : N806 scripts/data_ingestion.py : N803, N806 scripts/delete.py : N806 scripts/editarticle.py : N806 scripts/fixing_redirects.py : N803, N806 scripts/flickrripper.py : T001, N803, N806 scripts/followlive.py : N803 scripts/harvest_template.py : T001, N803 scripts/image.py : N806 scripts/imagecopy.py : N801, N803, N806 scripts/imagecopy_self.py : N801, N803, N806 scripts/imageharvest.py : N806 scripts/imagerecat.py : N803, N806 scripts/imagetransfer.py : E241, N803, N806 scripts/imageuncat.py : N806 scripts/interwiki.py : P102, N803, N806 scripts/interwikidata.py : N806 scripts/isbn.py : N803, N806 scripts/listpages.py : N806 scripts/lonelypages.py : N806 scripts/maintenance/* : T001 scripts/makecat.py : D103 scripts/match_images.py : N803, N806 scripts/misspelling.py : N803, N806 scripts/movepages.py : N803, N806 scripts/ndashredir.py : N806 scripts/noreferences.py : N803, N806 scripts/nowcommons.py : N803, N806 scripts/pagefromfile.py : N806 scripts/patrol.py : N806 scripts/piper.py : N806 scripts/protect.py : N806 scripts/redirect.py : N803, N806 scripts/reflinks.py : N806 scripts/replace.py : N803, N806 scripts/script_wui.py : D102, N806 scripts/selflink.py : N806 scripts/solve_disambiguation.py : N803, N806 scripts/spamremove.py : N806 scripts/states_redirect.py : N806 scripts/surnames_redirects.py : N806 scripts/table2wiki.py : N806 scripts/template.py : N806 scripts/templatecount.py : N806 scripts/touch.py : N806 scripts/transferbot.py : N806 scripts/unlink.py : N803 scripts/upload.py : N806 scripts/watchlist.py : N803 scripts/weblinkchecker.py : N803, N806 scripts/welcome.py : N806 setup.py : T001 tests/* : N813 tests/page_tests.py : E241 tests/pwb/* : T001 # invalidly detected as {} format string: tests/textlib_tests.py : P103 tests/ui_tests.py : D102, D103, N801 [pep8] 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