From 84d59a198257ea6f3b839ca5d96cbaa74f2f3b76 Mon Sep 17 00:00:00 2001 From: Emma Foley Date: Thu, 5 Jan 2023 13:50:14 +0000 Subject: [PATCH] Make tox.ini tox 4.0 compatible * use min version 4.2.5, for fixes [1][2][3] * passenv fixed as space-separated list is not allowed anymore * doc target uses requirements.txt as well as docs/requirements.txt * skipsdist is not supported * Add usedevelop = False so that aodh-api gets installed Update setup.cfg: [files] -> [options] [1] https://github.com/tox-dev/tox/issues/2754 [2] https://github.com/tox-dev/tox/pull/2824 [3] https://github.com/tox-dev/tox/pull/2828 Change-Id: I2422dc17e6c73ef346de80e57cdf61ef5d271d69 --- setup.cfg | 2 +- tox.ini | 33 +++++++++++++++++++++++++-------- 2 files changed, 26 insertions(+), 9 deletions(-) diff --git a/setup.cfg b/setup.cfg index e6f159d0..927022ab 100644 --- a/setup.cfg +++ b/setup.cfg @@ -22,7 +22,7 @@ classifier = Programming Language :: Python :: 3.9 Topic :: System :: Monitoring -[files] +[options] packages = aodh diff --git a/tox.ini b/tox.ini index 82d4620f..0b248332 100644 --- a/tox.ini +++ b/tox.ini @@ -1,12 +1,11 @@ [tox] -minversion = 3.18.0 -skipsdist = True -envlist = py{3}{,-mysql,-postgresql},functional,pep8 +minversion = 4.2.5 +envlist = py3{,-mysql,-postgresql},functional,pep8 ignore_basepython_conflict = True [testenv] basepython = python3 -usedevelop = True +usedevelop = False setenv = OS_STDOUT_CAPTURE=1 OS_STDERR_CAPTURE=1 @@ -22,11 +21,19 @@ setenv = deps = -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master} .[test,{env:AODH_TEST_DEPS}] -passenv = OS_TEST_TIMEOUT OS_STDOUT_CAPTURE OS_STDERR_CAPTURE OS_LOG_CAPTURE AODH_TEST_DRIVERS + -r{toxinidir}/requirements.txt +passenv = + OS_TEST_TIMEOUT + OS_STDOUT_CAPTURE + OS_STDERR_CAPTURE + OS_LOG_CAPTURE + AODH_TEST_DRIVERS commands = {toxinidir}/run-tests.sh {posargs} aodh-config-generator -allowlist_externals = bash +allowlist_externals = + bash + {toxinidir}/run-tests.sh [testenv:cover] setenv = @@ -53,18 +60,28 @@ deps = {[testenv:docs]deps} commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html [testenv:docs] +usedevelop = True deps = -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master} + -r{toxinidir}/requirements.txt -r{toxinidir}/doc/requirements.txt -commands = sphinx-build -W -b html doc/source doc/build/html +allowlist_externals = + rm +commands = + rm -rf doc/build/html + sphinx-build -W --keep-going -b html doc/source doc/build/html setenv = PYTHONHASHSEED=0 [testenv:pdf-docs] +envdir = {toxworkdir}/docs +usedevelop = {[testenv:docs]usedevelop} deps = {[testenv:docs]deps} allowlist_externals = make + rm commands = - sphinx-build -W -b latex doc/source doc/build/pdf + rm -rf doc/build/pdf + sphinx-build -W --keep-going -b latex doc/source doc/build/pdf make -C doc/build/pdf [testenv:venv]