#######################################################################################
[tox]
-envlist = flake8, cover, pylint, safety, yamllint
-skipsdist = True
+envlist = black, cover, flake8, pylint, yamllint, safety
+skipsdist = true
+
+[tox:jenkins]
+toxworkdir = /tmp/.tox
[testenv]
basepython = python3.8
-setenv =
- VIRTUAL_ENV={envdir}
- PYTHONHASHSEED=0
- PYTHONPATH = {toxinidir}/src
+setenv = VIRTUAL_ENV={envdir}
+ PYTHONDONTWRITEBYTECODE = 1
deps = -r{toxinidir}/requirements.txt
+
+#######################################################################################
+[testenv:black]
+deps = black
+commands =
+ black --check --diff src/ tests/
+
+
#######################################################################################
[testenv:cover]
deps = {[testenv]deps}
-r{toxinidir}/requirements-test.txt
+ coverage
+ nose2
commands =
sh -c 'rm -f nosetests.xml'
coverage erase
coverage xml -o coverage.xml --omit=*tests*
whitelist_externals = sh
-#######################################################################################
-[testenv:safety]
-setenv =
- LC_ALL=C.UTF-8
- LANG=C.UTF-8
-deps = {[testenv]deps}
- -r{toxinidir}/requirements-test.txt
-commands =
- - safety check --full-report
#######################################################################################
[testenv:flake8]
-deps = flake8
+deps = flake8
+ flake8-import-order
commands =
flake8 src/ tests/
+
#######################################################################################
[testenv:pylint]
deps = {[testenv]deps}
-r{toxinidir}/requirements-test.txt
pylint
commands =
- pylint -E src
+ pylint -E src/ tests/
+
#######################################################################################
-[testenv:black]
+[testenv:safety]
+setenv =
+ LC_ALL=C.UTF-8
+ LANG=C.UTF-8
deps = {[testenv]deps}
- -r{toxinidir}/requirements-test.txt
- black
-commands = black --check --diff . --exclude "build/|.tox/|mod/|lib/"
+ safety
+commands =
+ - safety check --full-report
+
#######################################################################################
[testenv:yamllint]
#######################################################################################
[testenv:build]
passenv=HTTP_PROXY HTTPS_PROXY NO_PROXY
-deps = {[testenv]deps}
- -r{toxinidir}/requirements-test.txt
- charmcraft
+deps = charmcraft
whitelist_externals =
charmcraft
cp
max-line-length = 120
show-source = True
builtins = _
-
+max-complexity = 10
+import-order-style = google