Skip to content

Commit

Permalink
Make tox.ini tox 4.0 compatible
Browse files Browse the repository at this point in the history
* 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] tox-dev/tox#2754
[2] tox-dev/tox#2824
[3] tox-dev/tox#2828

Change-Id: I4122d0d05f297f864318e80392e6c77fb2e9fdcf
  • Loading branch information
elfiesmelfie committed Jan 6, 2023
1 parent 3214e4f commit 02176de
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 7 deletions.
1 change: 1 addition & 0 deletions doc/requirements.txt
Expand Up @@ -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
3 changes: 2 additions & 1 deletion setup.cfg
Expand Up @@ -23,7 +23,7 @@ classifier =
packages =
aodhclient

[extras]
[options.extras_require]
test =
coverage>=3.6
oslotest>=1.10.0 # Apache-2.0
Expand All @@ -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 =
Expand Down
23 changes: 17 additions & 6 deletions 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]
Expand All @@ -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]
Expand All @@ -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}
Expand Down

0 comments on commit 02176de

Please sign in to comment.