spyglass/tox.ini
Ian H Pittwood 8cc2a62255 Use Pipfile.lock only in tox gates
Pipenv validates that the Pipfile.lock that it uses for installing
packages is not out of date before following through on execution. If it
is not, it will throw an error. This change adds an env that tells
Pipenv to ignore the Pipfile and only use Pipfile.lock so gates do not
fail due to out of date packages.

Change-Id: I2fa541b31e14561c7cefc330e7ef2cc0b0e4abc6
2019-08-14 19:14:51 +00:00

106 lines
2.3 KiB
INI

[tox]
envlist = py36, py37, pep8, safety, docs, cover
minversion = 2.3.1
skipsdist = True
[testenv]
usedevelop = True
setenv =
VIRTUAL_ENV={envdir}
LANGUAGE=en_US
LC_ALL=en_US.utf-8
PIPENV_VERBOSITY=-1
PIPENV_IGNORE_PIPFILE=1
deps =
pipenv
passenv = http_proxy https_proxy HTTP_PROXY HTTPS_PROXY no_proxy NO_PROXY PBR_VERSION
whitelist_externals =
find
commands =
pipenv install --dev
find . -type f -name "*.pyc" -delete
{toxinidir}/tools/gate/run-unit-tests.sh '{posargs}'
[testenv:fmt]
basepython = python3
deps =
pipenv
commands =
pipenv install --dev
yapf -ir {toxinidir}/spyglass {toxinidir}/tests
[testenv:pep8]
basepython = python3
deps =
pipenv
safety
commands =
pipenv install --dev
bash -c {toxinidir}/tools/gate/whitespace-linter.sh
yapf -dr {toxinidir}/spyglass {toxinidir}/tests
flake8 {toxinidir}/spyglass {toxinidir}/tests
bandit -r spyglass -n 5
whitelist_externals =
bash
[testenv:safety]
basepython = python3
deps =
pipenv
safety
commands =
pipenv check
safety check -r {toxinidir}/doc/requirements.txt --full-report
[testenv:bandit]
basepython = python3
deps =
pipenv
commands =
pipenv install --dev
bandit -r spyglass -n 5
[testenv:update-requirements]
deps =
pipenv
commands =
pipenv lock --clear
bash -c "pipenv lock -r > {toxinidir}/requirements.txt"
whitelist_externals =
bash
[testenv:docs]
basepython = python3
deps =
-r{toxinidir}/doc/requirements.txt
commands =
rm -rf doc/build
sphinx-build -b html doc/source doc/build/html -n -W -v
whitelist_externals = rm
[testenv:cover]
basepython = python3
deps =
pipenv
commands =
pipenv install --dev
bash -c 'PATH=$PATH:~/.local/bin; pytest --cov=spyglass \
--cov-report html:cover --cov-report xml:cover/coverage.xml \
--cov-report term --cov-fail-under 88 tests/'
whitelist_externals =
bash
[flake8]
filename = *.py
show-source = true
# [H106] Don't put vim configuration in source files.
# [H201] No 'except:' at least use 'except Exception:'
# [H904] Delay string interpolations at logging calls.
enable-extensions = H106,H201,H904
# [W503] line break before binary operator
ignore = W503
exclude=.venv,.git,.tox,build,dist,*lib/python*,*egg,tools,*.ini,*.po,*.pot
max-complexity = 24
application-import-names = spyglass
import-order-style = pep8