tox: Minor tweaks

Set the 'PYTHONDONTWRITEBYTECODE' environment variable to avoid
generating '*.pyc' files, allowing us to remove explicit cleanup of
these from some tox environments.

Change-Id: I9b2cb923ec48f997a31d40325b6f0b2c025f8ee9
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
This commit is contained in:
Stephen Finucane 2022-05-23 10:36:10 +01:00 committed by Douglas Mendizábal
parent 33d42acb04
commit 1f28cb1e89
1 changed files with 22 additions and 19 deletions

41
tox.ini
View File

@ -7,24 +7,21 @@ ignore_basepython_conflict = True
[testenv]
basepython = python3
setenv =
PYTHON=coverage run --source barbican --parallel-mode
PYTHON=coverage run --source barbican --parallel-mode
PYTHONDONTWRITEBYTECODE=1
usedevelop = True
deps =
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
commands =
oslo-config-generator --config-file etc/oslo-config-generator/barbican.conf --output-file etc/barbican/barbican.conf
/usr/bin/find . -type f -name "*.py[c|o]" -delete
rm -f .testrepository/times.dbm
coverage erase
stestr run {posargs}
coverage combine
coverage html -d cover
coverage xml -o cover/coverage.xml
coverage report -m
allowlist_externals = rm
oslo-config-generator --config-file etc/oslo-config-generator/barbican.conf --output-file etc/barbican/barbican.conf
coverage erase
stestr run {posargs}
coverage combine
coverage html -d cover
coverage xml -o cover/coverage.xml
coverage report -m
[testenv:cover]
deps =
@ -40,6 +37,8 @@ commands =
[testenv:releasenotes]
deps = {[testenv:docs]deps}
allowlist_externals =
rm
commands =
rm -rf releasenotes/build
sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
@ -80,9 +79,10 @@ deps =
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/doc/requirements.txt
commands=
rm -rf doc/build doc/build/doctrees
sphinx-build -W -b html doc/source doc/build/html
allowlist_externals = rm
rm -rf doc/build doc/build/doctrees
sphinx-build -W -b html doc/source doc/build/html
allowlist_externals =
rm
[testenv:pdf-docs]
deps = {[testenv:docs]deps}
@ -99,15 +99,18 @@ deps = {[testenv:docs]deps}
commands =
rm -rf api-guide/build
sphinx-build -W -b html -d api-guide/build/doctrees api-guide/source api-guide/build/html
allowlist_externals =
rm
[testenv:all-docs]
description = Build all documentation
deps = {[testenv:docs]deps}
commands=
{[testenv:docs]commands}
{[testenv:api-guide]commands}
{[testenv:releasenotes]commands}
allowlist_externals = rm
{[testenv:docs]commands}
{[testenv:api-guide]commands}
{[testenv:releasenotes]commands}
allowlist_externals =
rm
[testenv:functional]
# This tox env is purely to make local test development easier