summaryrefslogtreecommitdiff
path: root/tox.ini
blob: 140c19246dd162d4200f50ade3542868e90e5bad (plain)
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
[tox]
minversion = 2.0
envlist = pep8,docs,py27-django111,py{35,36,37,38}-django{111,20,21,22}
skipsdist = True

[testenv]
deps =
    -r{toxinidir}/requirements-test.txt
    django111: django>=1.11,<2.0
    django111: djangorestframework>=3.6,<3.11; python_version >= '3.5'
    django111: djangorestframework>=3.6,<3.10; python_version < '3.0'
    django111: django-filter>=1.0,<3.0; python_version >= '3.5'
    django111: django-filter>=1.0,<2.0; python_version < '3.0'
    django20: django>=2.0,<2.1
    django21: django>=2.1,<2.2
    django{20,21}: djangorestframework>=3.7,<3.11
    django{20,21}: django-filter>=2.0,<3.0
    django22: django>=2.2,<2.3
    django22: djangorestframework>=3.10,<3.11
    django22: django-filter>=2.1,<3.0
setenv =
    DJANGO_SETTINGS_MODULE = patchwork.settings.dev
    PYTHONDONTWRITEBYTECODE = 1
    DJANGO_LIVE_TEST_SERVER_ADDRESS = localhost:9000-9200
    py27: PYTHONWARNINGS = once
    py{34,36}:PYTHONWARNINGS = once,ignore::ImportWarning:backports
    py35:PYTHONWARNINGS = once,ignore::ResourceWarning:unittest.suite,ignore::ImportWarning:backports
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
commands =
    python {toxinidir}/manage.py test --noinput '{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]
basepython = python2.7
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
exclude = ./patchwork/migrations

[testenv:docs]
deps =
    -r{toxinidir}/docs/requirements.txt
commands =
    sphinx-build -E -W -b dirhtml -d docs/_build/doctrees docs docs/_build/html

[testenv:lint]
basepython = python2.7
deps =
    pylint
    -r{toxinidir}/requirements-prod.txt
commands = pylint patchwork --rcfile=pylint.rc

[testenv:venv]
commands = {posargs}

[testenv:coverage]
basepython = python2.7
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

[travis]
python =
    2.7: py27, pep8, coverage