This repository has been archived by the owner on Sep 26, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 59
/
tox.ini
179 lines (160 loc) · 4.71 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
# 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.
[global]
src =
lib/python/treadmill
setup.py
deps =
-c{toxinidir}/constraints.txt
-r{toxinidir}/requirements.txt
[tox]
envlist = py34,py35,py36,py37,pylint,pep8,docs
envdir = {toxworkdir}/{envname}
skipsdist = true
skip_install = true
usedevelop = true
###########################
# Default testenv
###########################
[testenv]
basepython =
py34: python3.4
py35: python3.5
py36: python3.6
py37: python3.7
deps =
{[global]deps}
-r{toxinidir}/test-requirements.txt
pytest
pytest-cov
install_command =
pip install \
-U \
--disable-pip-version-check \
--only-binary pandas,numpy \
{opts} {packages}
passenv =
# See https://github.com/codecov/example-python#testing-with-tox
codecov: CI TRAVIS TRAVIS_*
codecov: CODECOV_*
codecov: TOXENV
skipsdist = true
skip_install = true
usedevelop = false
changedir = {toxinidir}
commands =
{envpython} ./setup.py \
--verbose \
build \
--build-base {envtmpdir} \
egg_info \
--egg-base {envtmpdir} \
bdist_wheel \
--bdist-dir {envtmpdir}/build \
--dist-dir {distdir}
{envpython} -mpip install \
--verbose \
--no-index \
--no-cache-dir \
--find-links {distdir} \
--disable-pip-version-check \
Treadmill
{envpython} -mpytest \
-vvv \
--cov \
--no-cov-on-fail \
{posargs}
###########################
# Run pytest
###########################
[testenv:py34]
[testenv:py35]
[testenv:py36]
[testenv:py37]
###########################
# Publish to Codecov
###########################
[testenv:codecov]
basepython = python3
deps = codecov
commands =
- coverage combine --append
codecov -e TOXENV --required
###########################
# Run PEP8
###########################
[testenv:pep8]
basepython = python3
deps = pycodestyle
changedir = {toxinidir}
commands=
{envpython} -mpycodestyle \
{posargs:{[global]src}}
###########################
# Run PyLint
###########################
[testenv:pylint]
basepython = python3
deps =
{[global]deps}
-r{toxinidir}/test-requirements.txt
pylint
skipsdist = true
skip_install = true
usedevelop = false
changedir = {toxinidir}
commands=
{envpython} -mpylint \
--rcfile={toxinidir}/pylintrc \
-j {env:NCPU:4} \
{posargs:{[global]src}}
###########################
# Run docs builder
###########################
[testenv:docs]
basepython = python3
deps =
{[global]deps}
-r{toxinidir}/rtd-requirements.txt
skipsdist = true
skip_install = false
usedevelop = true
changedir = {toxinidir}
commands =
{envpython} -msphinx.apidoc \
--output-dir docs/source/api \
--force \
lib/python
{envpython} -msphinx \
-b html \
-d {envtmpdir}/doctrees \
docs/source \
docs/_build/html/
{envpython} -msphinx \
-b doctest \
-d {envtmpdir}/doctrees \
docs/source \
docs/_build/doctest/
###############################################################################
###############################################################################
###############################################################################
[pycodestyle]
show_source = False
show_pep8 = False
count = True
# E402: Import not at top of file
# W504: Line break after binary operator
ignore = E402, W504
###############################################################################
[tool:pytest]
addopts = --verbose -ra --strict
norecursedirs = .* docs bin sbin tools
###############################################################################
[coverage:run]
source = treadmill
branch = True
concurrency =
thread
multiprocessing