[tox] minversion = 2.0 envlist = py39,py38,pep8,pylint,docs skipsdist = True [testenv] basepython = python3 usedevelop = True deps = -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master} -r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY install_command = pip install {opts} {packages} setenv = VIRTUAL_ENV={envdir} OS_TEST_PATH = ./freezer_api/tests/unit PYTHON=coverage run --source freezer_api --parallel-mode commands = find . -type f -name "*.py[c|o]" -delete stestr run {posargs} coverage combine coverage html -d cover coverage xml -o cover/coverage.xml coverage report -m rm -f .coverage rm -rf .testrepository whitelist_externals = find coverage rm python_files = test_*.py norecursedirs = .tox .venv [testenv:py38] basepython = python3.8 [testenv:py39] basepython = python3.9 [testenv:venv] commands = {posargs} [testenv:pylint] commands = pylint --rcfile .pylintrc freezer_api [testenv:pep8] commands = flake8 freezer_api [flake8] # Ignored hackings: # H202 -> assertRaises(Exception, ...) too broad # H401 -> Docstrings should not start with a space # H404 -> Multi line docstrings should start without a leading new line. # H405 -> Multi line docstrings should start with a one line summary followed by an empty line. ignore = H202,H401,H404,H405 show-source = True exclude = .venv,.tox,dist,doc,*egg,specs,build,*/source/conf.py [testenv:docs] commands = rm -rf api-ref/build # sphinx-build -W --keep-going -b html api-ref/source api-ref/build/html sphinx-build -W --keep-going -b html doc/source doc/build/html [testenv:api-ref] whitelist_externals = rm commands = rm -rf api-ref/build sphinx-build -W -a -E --keep-going -b html -d api-ref/build/doctrees api-ref/source api-ref/build/html [testenv:releasenotes] commands = sphinx-build -W -a -E -d releasenotes/build/doctrees --keep-going -b html releasenotes/source releasenotes/build/html [testenv:genpolicy] commands = oslopolicy-sample-generator --config-file etc/freezer/freezer-policy-generator.conf