[tox] # minversion = 1.7.2 needed for skip_missing_interpreters minversion = 1.7.2 skipsdist = True skip_missing_interpreters = True envlist = commit-message flake8-{py36,py39} hacking-{py36,py39} [params] # gui needs tkinter doctest_skip = --ignore-glob="*gui.py" --ignore-glob="*memento.py" exclude = --exclude make_dist.py,.tox,.git,./*.egg,build,./scripts/i18n/* generate_user_files = -W error::UserWarning -m pwb generate_user_files -family:wikipedia -lang:test -v [testenv] basepython = py36: python3.6 py37: python3.7 py38: python3.8 py39: python3.9 setenv = VIRTUAL_ENV={envdir} PYWIKIBOT_NO_USER_CONFIG=2 PYWIKIBOT_TEST_RUNNING=1 usedevelop = True commands = python --version flake8: flake8 --version flake8-py36: flake8 --doctests {posargs} {[params]exclude} flake8-py38: flake8 --doctests {posargs} flake8-py39: flake8 --doctests {posargs} hacking: flake8 --version hacking: flake8 --format=default {posargs} deeptest: python {[params]generate_user_files} deeptest-py36: python -m unittest discover -vv -p "*_tests.py" deeptest-py39: pytest fasttest: python {[params]generate_user_files} fasttest: pytest --version fasttest: pytest -a 'not net' deps = flake8: .[flake8] hacking: .[hacking] fasttest: pytest >= 7.0.1 fasttest: pytest-attrib>=0.1.3 fasttest: pytest-subtests >= 0.3.2 fasttest: mock fasttest: .[mwparserfromhell] fasttest: .[scripts] fasttest-py36: .[html] fasttest-py37: .[wikitextparser] deeptest: .[html] deeptest: .[mwparserfromhell] deeptest: .[scripts] deeptest-py39: .[wikitextparser] deeptest-py39: pytest >= 7.0.1 deeptest-py39: pytest-subtests >= 0.3.2 [testenv:commit-message] basepython = python3 deps = commit-message-validator commands = commit-message-validator [testenv:doctest] basepython = python3 commands = python {[params]generate_user_files} pytest --version pytest pywikibot --doctest-modules {[params]doctest_skip} deps = pytest >= 7.0.1 .[eventstreams] .[mwparserfromhell] .[mysql] [testenv:venv] commands = {posargs} [testenv:doc] basepython = python3.7 commands = sphinx-build -M html ./docs ./docs/_build -j auto deps = -rrequirements.txt -rdocs/requirements.txt [testenv:rstcheck] basepython = python3.7 commands = rstcheck --version rstcheck -r --report-level WARNING --ignore-roles api,phab . deps = -rrequirements.txt -rdocs/requirements.txt [testenv:sphinx] basepython = python3.7 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 # 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,H101,H238,H301,H306,H404,H405,H903,P101,P102,P103,P205,W503 enable-extensions = H203,H204,H205,N818 color = always count = True exclude = .tox,.git,./*.egg,build,./scripts/i18n/* # 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 = 50 # 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/__init__.py: N802, N806 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/_collections.py: N802 pywikibot/page/_page.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: T001, T201 pywikibot/scripts/wrapper.py: FI53, T001, 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, D101, D102, E126, E131, 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: T001, 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: T001, 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/*: T001, 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: D102, D103, 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 # flake8-coding # note: C103 can be removed from ignore if scripts are cleaned from coding part no-accept-encodings = true # pep8-naming classmethod-decorators = classmethod,classproperty # required with pep8-naming < 0.13 ignore-names = setUp,tearDown,setUpClass,tearDownClass,setUpModule,tearDownModule,asyncSetUp,asyncTearDown,setUpTestData,failureException,longMessage,maxDiff [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/i18n/* # see explanations above ignore = D105,D211 [pytest] minversion = 7.0.1 testpaths = tests python_files = *_tests.py addopts = --ignore=tests/l10n_tests.py