-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtox.ini
183 lines (164 loc) · 5.17 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
[tox]
# Django support for different python versions reference
# https://docs.djangoproject.com/en/dev/faq/install/#faq-python-version-support
envlist =
clean,
py27-django-{18,19,110,111},
py33-django-18,
py{34,35}-django-{18,19,110},
py{34,35,36,37}-django-{111,20},
py{35,36,37}-django-{21, 22},
py{36,37}-django-{30, master},
report,
check, docs, spell,
[travis]
python =
3.3: py33
3.4: py34
3.5: py35
3.6: py36
3.7: py37
3.7: py37
2.7: py27
[travis:env]
DJANGO =
1.8: django-18
1.9: django-19
1.10: django-110
1.11: django-111
2.0: django-20
2.1: django-21
2.2: django-22
3.0: django-master
master: django-master
[testenv]
depends =
# https://tox.readthedocs.io/en/latest/config.html#conf-depends
py: clean
report: py,
# http : //tox.readthedocs.io/en/latest/example/general.html?highlight=skipsdist#avoiding-expensive-sdist
skipsdist = True
# http://tox.readthedocs.io/en/latest/config.html#confval-usedevelop=BOOL
# Install the current package in development mode with “setup.py develop” instead of installing from the sdist package. (This uses pip’s -e option, so should be avoided if you’ve specified a custom install_command that does not support -e).
# usedevelop = True maybe necessary to make cov find the .coverage file
# see http://blog.ionelmc.ro/2014/05/25/python-packaging/
usedevelop = True
passenv =
DJANGO_SETTINGS_MODULE
DATABASE_URL
DATABASE_TEST_NAME
setenv =
PYTHONPATH = {toxinidir}
COVERAGE_FILE = .tmp/.coverage.{envname}
; DJANGO_SETTINGS_MODULE = website.settings.testing
; COV_CORE_SOURCE={toxinidir}/src
; COV_CORE_CONFIG={toxinidir}/.setup.cfg
; COV_CORE_DATAFILE={toxinidir}/.coverage.eager
whitelist_externals =
ls
xargs
which
printenv
commands =
# Debbuging info
which pip
pip freeze
printenv
# Pytest without coverage
# pytest --basetemp = {envtmpdir} tests
# Pytest with coverage
# coverage run --source src -m pytest --basetemp={envtmpdir}
# Pytest with pytest-cov
# pytest --cov=src --cov=tests --cov-append --basetemp={envtmpdir} tests src
# Run coverage on package setup test to reliably recreate env
# NOTE:
# setup.py test may change package versions to conform to other packages requirements
# it may also replace direct repository installs in favour of published packages
coverage run --source src --parallel-mode setup.py test
# coverage run --source src --parallel-mode -m pytest --basetemp={envtmpdir}
# Uncomment there to fail quicly or if coverage won't be combined
# coverage report
# coverage xml
install_command = pip install --find-links {toxinidir}/requirements/local --find-links {toxinidir}/ {opts} {packages}
deps =
; coverage
; pytest==3.1.3 ; python_version < '3.4'
; pytest ; python_version > '3.3'
; pytest-cov
; django-18: Django>=1.8,<1.9
; django-19: Django>=1.9,<1.10
; django-110: Django>=1.10,<1.11
; django-111: Django>=1.11,<1.12
; django-20: Django>=2.0,<2.1
; django-21: Django>=2.1,<2.2
; django-22: Django>=2.2,<2.3
; django-master: -egit+https://github.com/django/django.git#egg=django
-r{toxinidir}/requirements/testing.txt
-r{toxinidir}/requirements/base.txt
-e{toxinidir}/example_project
basepython =
py36-django-{111,20,21,master}: python3.6
py35-django-{18,19,110,111,20,21,master}: python3.5
py34-django-{18,19,110,111}: python3.4
py33-django-{18}: python3.3
py27-django-{18,19,110,111}: python2.7
# https://blog.ionelmc.ro/2014/05/25/python-packaging/#ci-templates-tox-ini
# https://hynek.me/articles/testing-packaging/
{docs,spell}: python3.6
{bootstrap,clean,check,report,extension-coveralls,coveralls,codecov}: python3.6
[testenv:spell]
setenv =
SPELLCHECK = 1
commands =
sphinx-build -b spelling docs dist/docs
extras = factories
skip_install = true
usedevelop = false
install_command = pip install --find-links {toxinidir}/requirements/local {opts} {packages}
deps =
-rrequirements/base.txt
-rrequirements/development.txt
[testenv:docs]
install_command = pip install --find-links {toxinidir}/requirements/local {opts} {packages}
extras = factories
deps =
-rrequirements/base.txt
-rrequirements/development.txt
commands =
sphinx-build {posargs: -E} -b html docs dist/docs
sphinx-build -b linkcheck docs dist/docs
[testenv:check]
deps =
docutils
check-manifest
flake8
readme-renderer
pygments
isort
skip_install = true
usedevelop = false
commands =
python setup.py check --strict --metadata --restructuredtext
check-manifest --ignore .idea,.idea/* {toxinidir}
flake8 src tests example_project setup.py
isort --check-only --diff --recursive src tests example_project setup.py
[testenv:report]
setenv =
COVERAGE_FILE = .tmp/.coverage
deps =
coverage
pytest
pytest-cov
skip_install = true
usedevelop = false
commands =
# TODO: pytest coverage combine needs workaround file naming
# py.test --cov-report html
coverage combine --append
coverage report
coverage html
[testenv:clean]
commands = coverage erase
skip_install = true
usedevelop = false
deps = coverage