Ian H Pittwood 2b585d1e40 Move safety checks to new Zuul job
Moves the dependency vulnerability checks from pep8 tox check to a new
Zuul job. This allows setting the job to not be voting as the database
used for safety has been flaky recently.

Changes basepython to python3 for safety and bandit jobs.

Related change: https://review.opendev.org/#/c/671847

Change-Id: I3bbc15aec795ff901e442e17d2ab974fd5da90ef
2019-07-23 08:42:42 -05:00

80 lines
1.9 KiB
INI

[tox]
envlist = py36, py37, pep8, docs, cover
minversion = 2.3.1
skipsdist = True
[testenv]
usedevelop = True
setenv =
VIRTUAL_ENV={envdir}
LANGUAGE=en_US
LC_ALL=en_US.utf-8
deps =
-r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
passenv = http_proxy https_proxy HTTP_PROXY HTTPS_PROXY no_proxy NO_PROXY PBR_VERSION
whitelist_externals =
find
commands =
find . -type f -name "*.pyc" -delete
{toxinidir}/tools/gate/run-unit-tests.sh '{posargs}'
[testenv:fmt]
basepython = python3
deps =
-r{toxinidir}/test-requirements.txt
commands =
yapf -ir {toxinidir}/spyglass_plugin_xls {toxinidir}/setup.py {toxinidir}/tests
[testenv:pep8]
basepython = python3
deps =
-r{toxinidir}/test-requirements.txt
commands =
bash -c "{toxinidir}/tools/gate/whitespace-linter.sh"
yapf -dr {toxinidir}/spyglass_plugin_xls {toxinidir}/setup.py {toxinidir}/tests
flake8 {toxinidir}/spyglass_plugin_xls {toxinidir}/tests
bandit -r spyglass_plugin_xls -n 5
whitelist_externals =
bash
[testenv:safety]
basepython = python3
deps =
safety
commands =
safety check -r {toxinidir}/requirements.txt --full-report
safety check -r {toxinidir}/test-requirements.txt --full-report
safety check -r {toxinidir}/doc/requirements.txt --full-report
[testenv:bandit]
basepython = python3
deps =
bandit
commands = bandit -r spyglass_plugin_xls -n 5
[flake8]
ignore = W503
[testenv:docs]
basepython = python3
deps =
-r{toxinidir}/requirements.txt
-r{toxinidir}/doc/requirements.txt
commands =
rm -rf doc/build
sphinx-build -b html doc/source doc/build -n -W -v
whitelist_externals = rm
[testenv:cover]
basepython = python3
deps =
-r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
commands =
bash -c 'PATH=$PATH:~/.local/bin; pytest --cov=spyglass_plugin_xls \
--cov-report html:cover --cov-report xml:cover/coverage.xml \
--cov-report term --cov-fail-under 92 tests/'
whitelist_externals =
bash