tripleo-common/tox.ini
Takashi Kajinami 93c2183382 Adapt to tox 4.x
skipdist=True does not work with latest tox 4.x.

Also, skip_install=True without any deps causes the following task
failure in CI, because the log directory is no longer created. This
change ensures we use the individual environment instead of using
a different environment.

TASK [tox : Install any sibling python packages]
...
ubuntu-jammy | FileNotFoundError: [Errno 2] No such file or directory:
'/home/zuul/src/opendev.org/openstack/tripleo-common/.tox/pep8/log/
pep8-siblings.txt'

Closes-Bug: #2000357
Co-Authored-By: Rabi Mishra <ramishra@redhat.com>
Change-Id: I638649e0722011ad39cc94f0cc0bfcf65cf1518b
2022-12-23 18:50:59 +09:00

102 lines
2.6 KiB
INI

[tox]
minversion = 3.18.0
envlist = linters,py
# Automatic envs will only use the python version appropriate to that
# env and ignore basepython inherited from [testenv] if we set
# ignore_basepython_conflict.
ignore_basepython_conflict = True
[testenv]
basepython = python3
usedevelop = True
setenv =
ANSIBLE_FORCE_COLOR=1
ANSIBLE_INVENTORY={toxinidir}/tests/hosts.ini
ANSIBLE_NOCOWS=1
ANSIBLE_RETRY_FILES_ENABLED=0
ANSIBLE_STDOUT_CALLBACK=debug
PY_COLORS=1
# pip: Avoid 2020-01-01 warnings: https://github.com/pypa/pip/issues/6207
PYTHONWARNINGS=ignore:DEPRECATION::pip._internal.cli.base_command,ignore::UserWarning
PIP_DISABLE_PIP_VERSION_CHECK=1
LC_ALL=en_US.UTF-8
passenv =
ANSIBLE_*
CURL_CA_BUNDLE
DOCKER_*
PYTEST*
REQUESTS_CA_BUNDLE
SSH_AUTH_SOCK
SSL_CERT_FILE
TERM
deps =
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
commands = stestr run {posargs}
allowlist_externals =
bash
tox
[testenv:bindep]
deps = bindep
commands = bash -c "{toxinidir}/scripts/bindep-install"
# deprecated: covered by linters
[testenv:pep8]
skip_install = true
deps = {[testenv:linters]deps}
commands =
python -m pre_commit run -a -- flake8
[testenv:venv]
commands = {posargs}
[testenv:cover]
setenv =
PYTHON=coverage run --source tripleo_common --parallel-mode
commands =
coverage erase
stestr run {posargs}
coverage combine
coverage html -d cover
coverage xml -o cover/coverage.xml
coverage report
[testenv:docs]
deps = -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/doc/requirements.txt
commands =
sphinx-build -W --keep-going -b html -d doc/build/doctrees doc/source doc/build/html
[testenv:debug]
commands = oslo_debug_helper {posargs}
# deprecated: covered by linters
[testenv:bashate]
skip_install = true
deps = {[testenv:linters]deps}
commands =
python -m pre_commit run -a -- bashate
[testenv:linters]
skip_install = true
deps =
virtualenv>=20.0.20
pre-commit>=2.4.0
commands =
python -m pre_commit run -a {posargs:}
bash -c tools/check_duplicate_jinja_blocks.sh
[testenv:releasenotes]
deps = {[testenv:docs]deps}
commands = bash -c tools/releasenotes_tox.sh
[testenv:requirements]
deps =
-egit+https://opendev.org/openstack/requirements#egg=openstack-requirements
allowlist_externals = sh
commands =
sh -c '{envdir}/src/openstack-requirements/playbooks/files/project-requirements-change.py --req {envdir}/src/openstack-requirements --local {toxinidir} master'