group-based-policy-automation/tox.ini

79 lines
2.3 KiB
INI

[tox]
envlist = py36,py37,pep8
minversion = 3.1.0
skipsdist = True
[testenv]
# Note the hash seed is set to 0 until heat can be tested with a
# random hash seed successfully.
basepython = python3
setenv = VIRTUAL_ENV={envdir}
PYTHONWARNINGS=default::DeprecationWarning
OS_TEST_PATH=gbpautomation/heat/tests
PYTHONHASHSEED=0
usedevelop = True
install_command = pip install {opts} {packages}
deps =
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/zed}
-r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
commands =
stestr run '^(?!functionaltests){posargs}'
stestr slowest
whitelist_externals =
bash
# to avoid deprecation warning due to 'find' in cover env.
find
[testenv:functional]
commands =
python -c "print('TODO: functional tests')"
[testenv:pep8]
commands =
flake8
# Check that .po and .pot files are valid:
# bash -c "find gbpautomation -type f -regex '.*\.pot?' -print0|xargs -0 -n 1 msgfmt --check-format -o /dev/null"
[testenv:venv]
commands = {posargs}
[testenv:cover]
setenv =
PYTHON=coverage run --source gbpautomation --parallel-mode
commands =
coverage erase
find {toxinidir} -not -path '{toxinidir}/.tox/*' -not -path '*/__pycache__/*' -name '*.py[c|o]' -delete
stestr run {posargs}
coverage combine
coverage html -d cover
coverage xml -o cover/coverage.xml
coverage report
[testenv:docs]
deps = -r{toxinidir}/doc/requirements.txt
commands =
rm -rf doc/build
sphinx-build -W -b html doc/source doc/build/html
[flake8]
# H302 import only modules.'bla..' does not import a module
# H404 multi line docstring should start with a summary
# H803 no full stop at the end of the commit message
ignore = H302,H404,H803,,W503,W504
show-source = true
builtins = _
exclude=.venv,.git,.tox,dist,*openstack/common*,*lib/python*,*egg,tools,build
[testenv:bindep]
# Do not install any requirements. We want this to be fast and work even if
# system dependencies are missing, since it's used to tell you what system
# dependencies are missing! This also means that bindep must be installed
# separately, outside of the requirements files, and develop mode disabled
# explicitly to avoid unnecessarily installing the checked-out repo too (this
# further relies on "tox.skipsdist = True" above).
deps = bindep
commands = bindep test
usedevelop = False