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 2
/
tox.ini
143 lines (128 loc) · 4.16 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
# 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/resourcemodel
setup.py
[tox]
envdir = {toxworkdir}/{envname}
skipsdist = true
skip_install = true
usedevelop = true
###########################
# Default testenv
###########################
[testenv]
envlist = pytest,pylint,pep8,docs
basepython =
py34: python3.4
py35: python3.5
py36: python3.6
deps =
-r{toxinidir}/requirements.txt
pytest: -r{toxinidir}/test-requirements.txt
pylint: pylint
passenv =
# See https://github.com/codecov/example-python#testing-with-tox
codecov: CI TRAVIS TRAVIS_*
codecov: TOXENV
skipsdist = true
skip_install = true
usedevelop = false
changedir = {toxinidir}
commands =
pytest: {envpython} ./setup.py \
pytest: --verbose \
pytest: build \
pytest: --build-base {envtmpdir} \
pytest: egg_info \
pytest: --egg-base {envtmpdir} \
pytest: bdist_wheel \
pytest: --bdist-dir {envtmpdir}/build \
pytest: --dist-dir {distdir}
pytest: {envpython} -mpip install \
pytest: --verbose \
pytest: --no-index \
pytest: --no-cache-dir \
pytest: --find-links {distdir} \
pytest: Resource-Model
pytest: {envpython} -mpytest \
pytest: --cov \
pytest: {posargs}
pylint: {envpython} -mpylint \
pylint: --rcfile={toxinidir}/pylintrc \
pylint: -j {env:NCPU:4} \
pylint: {posargs:{[global]src}}
###########################
# Publish to Codecov
###########################
[testenv:codecov]
basepython = python3
skip_install = True
deps = codecov
commands =
coverage combine --append
codecov -e TOXENV --required
###########################
# Run PEP8
###########################
[testenv:pep8]
basepython = python3
deps = pycodestyle
skipsdist = true
skip_install = true
usedevelop = false
changedir = {toxinidir}
commands=
pycodestyle \
{posargs:{[global]src}}
###########################
# Run docs builder
###########################
[testenv:docs]
basepython = python3
deps =
{[testenv]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
# W504: Line break after binary operator
# E402: Import not at top of file
ignore = E402, W504
###############################################################################
[tool:pytest]
addopts = --verbose -ra --strict
norecursedirs = .* bin sbin tools
###############################################################################
[coverage:run]
source = resourcemodel
branch = True
concurrency =
thread
multiprocessing