| [tox] | |
| minversion = 3.2 | |
| envlist = pep8,docs,py{36,37,38,39}-django{22,30,31} | |
| skipsdist = true | |
| ignore_basepython_conflict = true | |
| [testenv] | |
| basepython = python3 | |
| deps = | |
| -r{toxinidir}/requirements-test.txt | |
| django22: django>=2.2,<2.3 | |
| django22: djangorestframework>=3.10,<3.13 | |
| django22: django-filter>=2.1,<3.0 | |
| django30: django>=3.0,<3.1 | |
| django30: djangorestframework>=3.10,<3.13 | |
| django30: django-filter>=2.2,<3.0 | |
| django31: django>=3.1,<3.2 | |
| django31: djangorestframework>=3.10,<3.13 | |
| django31: django-filter>=2.3,<3.0 | |
| setenv = | |
| DJANGO_SETTINGS_MODULE = patchwork.settings.dev | |
| PYTHONDONTWRITEBYTECODE = 1 | |
| PYTHONDEVMODE = 1 | |
| py36: PYTHONWARNINGS = once,ignore::ImportWarning:backports | |
| py{37,38,39}: PYTHONWARNINGS = once | |
| passenv = | |
| http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY | |
| PW_TEST_DB_TYPE PW_TEST_DB_USER PW_TEST_DB_PASS PW_TEST_DB_HOST | |
| PW_TEST_DB_PORT PW_TEST_DB_NAME DJANGO_TEST_PROCESSES | |
| commands = | |
| python {toxinidir}/manage.py test --noinput --parallel -- {posargs:patchwork} | |
| [testenv:bashate] | |
| deps = bashate | |
| whitelist_externals = bash | |
| commands = | |
| bash -c "find {toxinidir} \ | |
| -not \( -type d -name .?\* -prune \) \ | |
| -not \( -type d -name db -prune \) \ | |
| -name \*.sh -print | xargs bashate -i E006" | |
| [testenv:pep8] | |
| deps = flake8 | |
| commands = flake8 {posargs:patchwork manage.py} | |
| [flake8] | |
| # Some rules are ignored as their use makes the code more difficult to read: | |
| # | |
| # E129 visually indented line with same indent as next logical line | |
| # F405 'name' may be undefined, or defined from star imports: 'module' | |
| # W504 line break after binary operator | |
| ignore = E129, F405, W504 | |
| [testenv:docs] | |
| deps = | |
| -r{toxinidir}/docs/requirements.txt | |
| commands = | |
| sphinx-build -E -W -b dirhtml -d docs/_build/doctrees docs docs/_build/html {posargs} | |
| [testenv:lint] | |
| deps = | |
| pylint | |
| -r{toxinidir}/requirements-prod.txt | |
| commands = pylint patchwork --rcfile=pylint.rc | |
| [testenv:venv] | |
| commands = {posargs} | |
| [testenv:coverage] | |
| deps = | |
| coverage | |
| -r{toxinidir}/requirements-dev.txt | |
| setenv = | |
| DJANGO_SETTINGS_MODULE = patchwork.settings.dev | |
| commands = | |
| coverage erase | |
| coverage run --omit=*tox*,patchwork/tests/*.py,manage.py,patchwork/migrations/*.py \ | |
| --branch {toxinidir}/manage.py test --noinput patchwork | |
| coverage report -m | |
| [gh-actions] | |
| python = | |
| 3.6: py36 | |
| 3.7: py37 | |
| 3.8: py38 | |
| 3.9: py39 |