From 02176deb25b3a8f1bc02eb3d70f0a50ce22f02f7 Mon Sep 17 00:00:00 2001 From: Emma Foley Date: Thu, 5 Jan 2023 16:02:51 +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 * dock target uses requirements from requirements.txt as well as doc/requirements.txt * skipsdist is not supported * whitelist_externals has been removed in favour of allowlist_externals * reno was added to doc/requirements.txt to fix the releasenotes target * update setup.cfg to install aodh from tarball in the requirements The tarball wasn't being installed when specified in tox.ini, and the [extras] section in setup.cfg needed updating to support installing from a URL [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: I4122d0d05f297f864318e80392e6c77fb2e9fdcf --- doc/requirements.txt | 1 + setup.cfg | 3 ++- tox.ini | 23 +++++++++++++++++------ 3 files changed, 20 insertions(+), 7 deletions(-) diff --git a/doc/requirements.txt b/doc/requirements.txt index 6383eda..bb94d5c 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -4,3 +4,4 @@ sphinx>=2.0.0,!=2.1.0 # BSD openstackdocstheme>=2.2.1 # Apache-2.0 +reno>=3.1.0 # Apache-2.0 diff --git a/setup.cfg b/setup.cfg index 812c919..027face 100644 --- a/setup.cfg +++ b/setup.cfg @@ -23,7 +23,7 @@ classifier = packages = aodhclient -[extras] +[options.extras_require] test = coverage>=3.6 oslotest>=1.10.0 # Apache-2.0 @@ -33,6 +33,7 @@ test = testtools>=1.4.0 pifpaf[gnocchi]>=0.23 gnocchi[postgresql,file] + aodh @ https://tarballs.openstack.org/aodh/aodh-master.tar.gz#egg=aodh[mysql] [entry_points] console_scripts = diff --git a/tox.ini b/tox.ini index 51d2051..966daa7 100644 --- a/tox.ini +++ b/tox.ini @@ -1,7 +1,6 @@ [tox] -minversion = 3.1.1 +minversion = 4.2.5 envlist = py38,py39,pep8 -skipsdist = True ignore_basepython_conflict = True [testenv] @@ -12,12 +11,17 @@ setenv = AODH_CLIENT_EXEC_DIR={envdir}/bin AODH_ENDPOINT=http://localhost:8042 GNOCCHI_ENDPOINT=http://localhost:8041 -passenv = GNOCCHI_* AODH_* OS_TEST_TIMEOUT OS_STDOUT_CAPTURE OS_STDERR_CAPTURE OS_LOG_CAPTURE +passenv = + GNOCCHI_* + AODH_* + OS_TEST_TIMEOUT + OS_STDOUT_CAPTURE + OS_STDERR_CAPTURE + OS_LOG_CAPTURE # NOTE(tonyb): This project has chosen to *NOT* consume upper-constraints.txt # NOTE(jd): the -e is on its own line so it is passed a separate argument to pip deps = .[test] - http://tarballs.openstack.org/aodh/aodh-master.tar.gz#egg=aodh[mysql] commands = pifpaf run aodh -- stestr run --slowest {posargs} [testenv:pep8] @@ -41,14 +45,21 @@ commands = coverage report [testenv:releasenotes] +deps = + -r{toxinidir}/doc/requirements.txt + -r{toxinidir}/requirements.txt +allowlist_externals = + sphinx-build commands = sphinx-build -a -E -W -d releasenotes/build/doctrees --keep-going -b html releasenotes/source releasenotes/build/html [testenv:docs] -deps = -r{toxinidir}/doc/requirements.txt +deps = + -r{toxinidir}/doc/requirements.txt + -r{toxinidir}/requirements.txt commands = rm -rf doc/build sphinx-build -W --keep-going -b html doc/source doc/build/html -whitelist_externals = rm +allowlist_externals = rm [testenv:debug] commands = pifpaf --debug run aodh -- oslo_debug_helper {posargs}