murano/tox.ini
Andreas Jaeger d1dae85ac7 Update hacking for Python3
The repo is Python 3 now, so update hacking to version 3.0 which
supports Python 3.

Fix problems found.

Update local hacking checks for new flake8.

Change-Id: Ibe28b6b6bf3927e80816f0c5f1cb972fb6e2374b
2020-03-30 11:59:26 +02:00

128 lines
3.5 KiB
INI

[tox]
envlist = py36,py37,pep8
minversion = 2.0
skipsdist = True
[testenv]
basepython = python3
usedevelop = True
install_command = pip install -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master} {opts} {packages}
setenv =
VIRTUAL_ENV={envdir}
passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
commands = rm -f .testrepository/times.dbm
stestr run {posargs}
whitelist_externals = bash
find
rm
bandit
[testenv:murano-test-runner]
commands = murano-test-runner {posargs}
[testenv:pep8]
commands =
flake8 {posargs}
{[testenv:bandit]commands}
[testenv:bandit]
commands = bandit -c bandit.yaml -r murano -x tests -n 5 -ll
[testenv:venv]
commands = {posargs}
[testenv:cover]
setenv =
{[testenv]setenv}
PYTHON=coverage run --source murano --parallel-mode
commands =
stestr run {posargs}
coverage combine
coverage html -d cover
coverage xml -o cover/coverage.xml
[testenv:debug]
commands =
find . -type f -name "*.pyc" -delete
oslo_debug_helper {posargs}
[testenv:docs]
deps = -r{toxinidir}/doc/requirements.txt
commands = sphinx-build -a -E -W -d doc/build/doctrees -b html doc/source doc/build/html
[testenv:pdf-docs]
deps = {[testenv:docs]deps}
whitelist_externals =
make
commands =
sphinx-build -W -b latex doc/source doc/build/pdf
make -C doc/build/pdf
[testenv:pyflakes]
deps = flake8
commands = flake8
[testenv:pylint]
setenv = VIRTUAL_ENV={envdir}
commands = bash tools/lintstack.sh
[testenv:genconfig]
commands =
oslo-config-generator --config-file etc/oslo-config-generator/murano.conf
[testenv:gencfconfig]
commands =
oslo-config-generator --config-file etc/oslo-config-generator/murano-cfapi.conf
[testenv:genpolicy]
commands = oslopolicy-sample-generator --config-file etc/oslo-policy-generator/murano-policy-generator.conf
[testenv:releasenotes]
commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
[testenv:api-ref]
# This environment is called from CI scripts to test and publish
# the API Ref to docs.openstack.org.
deps = -r{toxinidir}/doc/requirements.txt
commands =
rm -rf api-ref/build
sphinx-build -W -b html -d api-ref/build/doctrees api-ref/source api-ref/build/html
whitelist_externals = rm
[flake8]
show-source = true
builtins = _
# W605 invalid escape sequence
ignore = W605,W504,W503,E123,H405
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build
[hacking]
import_exceptions = oslo.db.sqlalchemy.test_base,
murano.common.i18n
[flake8:local-plugins]
extension =
M318 = checks:assert_equal_none
M322 = checks:no_mutable_default_args
M326 = checks:check_no_basestring
paths = ./murano/hacking
[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
[testenv:lower-constraints]
deps =
-c{toxinidir}/lower-constraints.txt
-r{toxinidir}/test-requirements.txt
-r{toxinidir}/requirements.txt