-
Notifications
You must be signed in to change notification settings - Fork 15
/
tox.ini
70 lines (64 loc) · 1.59 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
# SPDX-License-Identifier: MIT
[tox]
envlist =
black, flake8, pylint, pytest
shellcheck
skipsdist = true
[testenv]
passenv = *
basepython = python3
setenv =
PYTHONPATH={toxinidir}
allowlist_externals =
bash
find
shellcheck
deps =
black: black
flake8: flake8
pylint: colorama
pylint: pylint>=1.8.4
pylint: pyyaml
pylint: ruamel.yaml
pylint: ansible
commands_pre =
shellcheck: bash -c 'type -p shellcheck || \{ echo ERROR: shellcheck not found - try dnf -y install ShellCheck; exit 1; \}'
commands =
black: black --check --diff {posargs} .
flake8: flake8 {posargs} .
pylint: bash -c 'find \( -name .tox -prune \) -o \( -name .venv -prune \) -o -name \*.py -exec pylint --errors-only {posargs} \{\} \;'
shellcheck: bash -c 'shellcheck -e SC1090 *.sh'
[testenv:pytest]
deps =
pytest
pyyaml
ruamel.yaml
ansible
six
commands =
bash -c '\
set -euxo pipefail ;\
rc=0 ;\
if find tests/unit -name \*.py | grep -q . ; then \
mkdir -p /var/tmp/src/systemrole ;\
mkdir -p /var/tmp/collections ;\
COLLECTION_SRC_PATH=/var/tmp/src COLLECTION_DEST_PATH=/var/tmp/collections \
COLLECTION_ROLE=systemrole pytest {posargs} tests/unit || rc=$? ;\
rm -rf /var/tmp/src /var/tmp/collections ;\
else \
echo no python files - skipping ;\
fi ;\
exit $rc'
[pytest]
addopts = -rxs -v
[flake8]
show_source = true
max-line-length = 120
ignore = W503
exclude = .venv,.tox
statistics = true
#verbose = 3
[pylint]
max-line-length = 120
[pycodestyle]
max-line-length = 120