-
Notifications
You must be signed in to change notification settings - Fork 14
/
tox.ini
129 lines (115 loc) · 2.96 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
# Tox (http://tox.testrun.org/) is a tool for running tests
# in multiple virtualenvs. This configuration file will run the
# test suite on all supported python versions. To use it, "pip install tox"
# and then run "tox" from this directory.
#
# To run tests locally with multiple python versions using tox, install the
# different python versions through pyenv. Then specify the python versions
# installed with pyenv in the shell before running the tests, e.g. like this:
# $ pyenv local 2.6.7 2.7.5 3.3 3.4.1
# $ tox
#
[flake8]
max-line-length = 100
exclude = .tox,dist,build
ignore = E133
builtins = basestring
# Settings for py.test and tox
[tox]
envlist = py26, py27, py33, py34, pep8, flake8, docs, testcoverage
[testenv]
commands = {envpython} setup.py test
basepython=python
norecursedirs=.tox .git dist
deps =
pytest
whitelist_externals=
py.test
[pytest]
python_functions=test_
norecursedirs=.tox .git dist build *egg
pep8maxlinelength = 100
pep8ignore =
docs/source/conf.py ALL
[testenv:testcoverage]
deps =
{[testenv]deps}
coverage<=3.7.1
commands=
coverage run --branch -m pytest tests
coverage report --include="pydblite*,tests*"
coverage html -d docs/build/htmlcoverage
[testenv:pydef]
commands=
py.test
[testenv:py26]
basepython=python2.6
commands=
{[testenv:pydef]commands}
[testenv:py27]
basepython=python2.7
commands=
{[testenv:pydef]commands}
[testenv:py33]
basepython=python
commands=
{[testenv:pydef]commands}
[testenv:py34]
basepython=python3.4
commands=
{[testenv:pydef]commands}
[testenv:pep8]
deps =
{[testenv]deps}
pytest-pep8
commands=
py.test --pep8
[testenv:flake8]
basepython=python3.4
whitelist_externals=
{[testenv]whitelist_externals}
flake8
deps =
{[testenv]deps}
flake8
pep8-naming
commands=
flake8 pydblite
[testenv:flake8-complexity]
whitelist_externals=
{[testenv:flake8]whitelist_externals}
sh
deps =
{[testenv:flake8]deps}
mccabe
commands=
sh -c "flake8 --max-complexity=10 pydblite || true"
[testenv:isort]
deps =
isort
whitelist_externals =
isort
commands = python -c "import subprocess, sys; output = subprocess.check_output('isort -q --stdout --diff --recursive pydblite tests *.py', shell=True); print output; sys.exit(len(output) != 0)"
[testenv:docs]
# sphinxcontrib/restbuilder does not support python 3, so force python 2.7
basepython=python2.7
# touch and mkdir is not installed in virtualenv, so ask it to ignore that.
whitelist_externals=
touch
mkdir
changedir=docs
install_command=pip install {opts} {packages}
deps =
pytest
sphinx
sphinxcontrib-inlinesyntaxhighlight
sphinxcontrib-fulltoc
sphinxcontrib-restbuilder
sphinxcontrib-issuetracker
cloud_sptheme
commands=
mkdir -p build/doccoverage
touch build/doccoverage/python.txt
sphinx-build -b coverage -d build/doctrees source build/doccoverage
py.test --doctest-glob='*.rst'
sphinx-build -b html -d build/doctrees source build/html