forked from linux-system-roles/storage
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tox.ini
216 lines (190 loc) · 5.31 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
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
# SPDX-License-Identifier: MIT
[tox]
envlist =
black, pylint, flake8, yamllint
py{26,27,36,37,38}, shellcheck
collection, custom
skipsdist = true
skip_missing_interpreters = true
[testenv]
passenv = *
basepython = python3
changedir = {toxinidir}/tests
# List common dependencies for Python interpreters here:
setenv =
PYTHONPATH = {toxinidir}/library:{toxinidir}/module_utils
LC_ALL = C.UTF-8
SRC_MODULE_UTILS_DIR = {envsitepackagesdir}/ansible/module_utils
DEST_MODULE_UTILS_DIR = {toxinidir}/module_utils
deps =
py{26,27,36,37,38}: pytest-cov
py{27,36,37,38}: pytest>=3.5.1
py26: pytest
py{26,27,36,37,38}: -rpytest_extra_requirements.txt
whitelist_externals =
bash
commands =
bash {toxinidir}/.travis/runpytest.sh \
--durations=5 \
--cov={toxinidir}/library --cov={toxinidir}/module_utils \
--cov-report=html:htmlcov-{envname} \
--cov-report=term \
{posargs} \
unit
[base]
[testenv:py26]
envdir = {toxworkdir}/env-{env:TRAVIS_PYTHON_VERSION:2.6}
install_command =
pip install {opts} {packages}
list_dependencies_command =
pip freeze
basepython = python2.6
[testenv:py27]
envdir = {toxworkdir}/env-{env:TRAVIS_PYTHON_VERSION:2.7}
basepython = python2.7
[testenv:py36]
envdir = {toxworkdir}/env-{env:TRAVIS_PYTHON_VERSION:3.6}
basepython = python3.6
[testenv:py37]
envdir = {toxworkdir}/env-{env:TRAVIS_PYTHON_VERSION:3.7}
basepython = python3.7
[testenv:py38]
envdir = {toxworkdir}/env-{env:TRAVIS_PYTHON_VERSION:3.8}
basepython = python3.8
[testenv:black]
envdir = {toxworkdir}/env-{env:TRAVIS_PYTHON_VERSION:3.6}
basepython = python3.6
passenv = RUN_BLACK_*
changedir = {toxinidir}
deps =
black
commands =
bash {toxinidir}/.travis/runblack.sh --check --diff .
[testenv:pylint]
envdir = {toxworkdir}/env-{env:TRAVIS_PYTHON_VERSION:2.7}
basepython = python2.7
passenv = RUN_PYLINT_*
changedir = {toxinidir}
deps =
ansible
colorama
pylint>=1.8.4
-rpylint_extra_requirements.txt
commands =
bash {toxinidir}/.travis/runpylint.sh --errors-only {posargs}
[testenv:flake8]
envdir = {toxworkdir}/env-{env:TRAVIS_PYTHON_VERSION:2.7}
basepython = python2.7
passenv = RUN_FLAKE8_*
changedir = {toxinidir}
deps =
flake8>=3.5
commands =
bash {toxinidir}/.travis/runflake8.sh {posargs} .
[testenv:yamllint]
changedir = {toxinidir}
deps = yamllint
commands = yamllint .
[testenv:coveralls]
envdir = {toxworkdir}/env-{env:TRAVIS_PYTHON_VERSION:coveralls}
passenv = TRAVIS TRAVIS_*
deps =
coveralls
commands =
bash {toxinidir}/.travis/runcoveralls.sh {posargs}
[molecule_common]
changedir = {toxinidir}
deps =
ansible-lint==4.3.5
{env:LSR_ANSIBLE_DEP:ansible}
docker{env:LSR_MOLECULE_DOCKER_VERSION:}
molecule<3
selinux
wcwidth==0.1.9;python_version=="3.6"
-rmolecule_extra_requirements.txt
runsyspycmd = {toxinidir}/.travis/runsyspycmd.sh
[testenv:molecule_version]
changedir = {[molecule_common]changedir}
envdir = {toxworkdir}/env-{env:TRAVIS_PYTHON_VERSION:molecule}
deps =
{[molecule_common]deps}
commands =
bash {[molecule_common]runsyspycmd} molecule --version
bash {[molecule_common]runsyspycmd} ansible --version
[testenv:molecule_lint]
changedir = {[molecule_common]changedir}
envdir = {toxworkdir}/env-{env:TRAVIS_PYTHON_VERSION:molecule}
deps =
{[molecule_common]deps}
commands =
bash {[molecule_common]runsyspycmd} \
molecule lint -s {env:LSR_MSCENARIO:default} {posargs}
[testenv:molecule_syntax]
changedir = {[molecule_common]changedir}
envdir = {toxworkdir}/env-{env:TRAVIS_PYTHON_VERSION:molecule}
deps =
{[molecule_common]deps}
commands =
bash {[molecule_common]runsyspycmd} \
molecule syntax -s {env:LSR_MSCENARIO:default} {posargs}
[testenv:molecule_test]
changedir = {[molecule_common]changedir}
envdir = {toxworkdir}/env-{env:TRAVIS_PYTHON_VERSION:molecule}
deps =
{[molecule_common]deps}
commands =
bash {[molecule_common]runsyspycmd} \
molecule test -s {env:LSR_MSCENARIO:default} {posargs}
[testenv:molecule]
changedir = {[molecule_common]changedir}
envdir = {toxworkdir}/env-{env:TRAVIS_PYTHON_VERSION:molecule}
deps =
{[molecule_common]deps}
commands =
{[testenv:molecule_version]commands}
{[testenv:molecule_lint]commands}
{[testenv:molecule_syntax]commands}
{[testenv:molecule_test]commands}
[testenv:collection]
changedir = {toxinidir}
ansible_python_interpreter = /usr/bin/python3
deps =
ruamel.yaml
ansible
jmespath
commands =
bash {toxinidir}/.travis/runcollection.sh {toxworkdir} master
[testenv:custom]
changedir = {toxinidir}
envdir = {toxworkdir}/env-{env:TRAVIS_PYTHON_VERSION:custom}
deps =
-rcustom_requirements.txt
commands =
bash {toxinidir}/.travis/custom.sh
[testenv:shellcheck]
changedir = {toxinidir}
envdir = {toxworkdir}/env-shellcheck
commands =
bash {toxinidir}/.travis/runshellcheck.sh
[pytest]
addopts = -rxs
[flake8]
show_source = true
max-line-length = 88
ignore = E402,W503
exclude = .venv,.tox
statistics = true
#verbose = 3
[pylint]
max-line-length = 88
disable = wrong-import-position
[pycodestyle]
max-line-length = 88
[travis]
python =
2.6: py26,coveralls,custom
2.7: py27,coveralls,flake8,pylint,custom
3.6: py36,coveralls,black,yamllint,shellcheck,custom,collection
3.7: py37,coveralls,custom
3.8: py38,coveralls,custom
3.8-dev: py38,coveralls,custom