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
* 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] tox-dev/tox#2754
[2] tox-dev/tox#2824
[3] tox-dev/tox#2828

Change-Id: I2422dc17e6c73ef346de80e57cdf61ef5d271d69
  • Loading branch information
elfiesmelfie committed Jan 17, 2023
1 parent 3a64804 commit 84d59a1
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 9 deletions.
2 changes: 1 addition & 1 deletion setup.cfg
Expand Up @@ -22,7 +22,7 @@ classifier =
Programming Language :: Python :: 3.9
Topic :: System :: Monitoring

[files]
[options]
packages =
aodh

Expand Down
33 changes: 25 additions & 8 deletions 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
Expand All @@ -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 =
Expand All @@ -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]
Expand Down

0 comments on commit 84d59a1

Please sign in to comment.