From 491ce1ab095b122b442de1ce662ebc2e29d27de3 Mon Sep 17 00:00:00 2001 From: Stephen Finucane Date: Tue, 3 Jan 2023 18:42:44 +0000 Subject: Update tox.ini to work with tox 4 Resolve the following warnings: tox.tox_env.errors.Fail: pass_env values cannot contain whitespace, use comma to have multiple values in a single line, invalid values found 'PBR_INTEGRATION PIPFLAGS PIPVERSION PBRVERSION REPODIR WHEELHOUSE PROJECTS' Also, reduce down the envlist as tox 4 when run in OpenStack CI is also attempting to validate interpreters utilizing the --skip-missing-interpreters=false setting [1]. Finally, fix up the integration job so that it passes on Ubuntu 22.04. This necessitates removing any Python 2-based dependencies used in the these jobs (since these are no longer available on Ubuntu 22.04) and removing tests for pip versions that are not compatible with Python 3.10 (the Python version found on Ubuntu 22.04). [1] https://github.com/tox-dev/tox/issues/2811 Change-Id: Ib4dbe4e09e269219c08a87f6fb64ad9628b5864a Signed-off-by: Stephen Finucane --- pbr/tests/test_integration.py | 33 ++++++++++++++++++--------------- tools/integration.sh | 4 ++-- tox.ini | 21 ++++++++++++++------- 3 files changed, 34 insertions(+), 24 deletions(-) diff --git a/pbr/tests/test_integration.py b/pbr/tests/test_integration.py index 25473b0..8b5e76a 100644 --- a/pbr/tests/test_integration.py +++ b/pbr/tests/test_integration.py @@ -210,20 +210,24 @@ class TestMarkersPip(base.BaseTestCase): scenarios = [ ('pip-latest', {'modules': ['pip']}), - ('setuptools-Bionic', { - 'modules': ['pip==9.0.1', 'setuptools==39.0.1']}), - ('setuptools-Stretch', { - 'modules': ['pip==9.0.1', 'setuptools==33.1.1']}), - ('setuptools-EL8', {'modules': ['pip==9.0.3', 'setuptools==39.2.0']}), - ('setuptools-Buster', { - 'modules': ['pip==18.1', 'setuptools==40.8.0']}), - ('setuptools-Focal', { - 'modules': ['pip==20.0.2', 'setuptools==45.2.0']}), + ( + 'setuptools-Bullseye', + {'modules': ['pip==20.3.4', 'setuptools==52.0.0']}, + ), + ( + 'setuptools-Focal', + {'modules': ['pip==20.0.2', 'setuptools==45.2.0']}, + ), + ( + 'setuptools-Jammy', + {'modules': ['pip==22.0.2', 'setuptools==59.6.0']}, + ), ] @testtools.skipUnless( os.environ.get('PBR_INTEGRATION', None) == '1', - 'integration tests not enabled') + 'integration tests not enabled', + ) def test_pip_versions(self): pkgs = { 'test_markers': @@ -265,16 +269,15 @@ class TestLTSSupport(base.BaseTestCase): # These versions come from the versions installed from the 'virtualenv' # command from the 'python-virtualenv' package. scenarios = [ - ('Bionic', {'modules': ['pip==9.0.1', 'setuptools==39.0.1']}), - ('Stretch', {'modules': ['pip==9.0.1', 'setuptools==33.1.1']}), - ('EL8', {'modules': ['pip==9.0.3', 'setuptools==39.2.0']}), - ('Buster', {'modules': ['pip==18.1', 'setuptools==40.8.0']}), + ('Bullseye', {'modules': ['pip==20.3.4', 'setuptools==52.0.0']}), ('Focal', {'modules': ['pip==20.0.2', 'setuptools==45.2.0']}), + ('Jammy', {'modules': ['pip==22.0.2', 'setuptools==59.6.0']}), ] @testtools.skipUnless( os.environ.get('PBR_INTEGRATION', None) == '1', - 'integration tests not enabled') + 'integration tests not enabled', + ) def test_lts_venv_default_versions(self): venv = self.useFixture( test_packaging.Venv('setuptools', modules=self.modules)) diff --git a/tools/integration.sh b/tools/integration.sh index 13480f9..0e99b43 100644 --- a/tools/integration.sh +++ b/tools/integration.sh @@ -38,9 +38,9 @@ sudo apt-get install -y --force-yes libvirt-dev libxml2-dev libxslt-dev libmysql # by apt-cache showsrc # Numpy -sudo apt-get install -y --force-yes cython debhelper gfortran libblas-dev liblapack-dev python-all-dbg python-all-dev python-nose python-tz python3-all-dbg python3-all-dev python3-nose python3-tz +sudo apt-get install -y --force-yes cython3 debhelper gfortran libblas-dev liblapack-dev python3-all-dbg python3-all-dev python3-nose python3-tz #pyyaml -sudo apt-get install -y --force-yes debhelper python-all-dev python-all-dbg python3-all-dev python3-all-dbg libyaml-dev cython cython-dbg quilt +sudo apt-get install -y --force-yes debhelper python3-all-dev python3-all-dbg libyaml-dev cython3 cython3-dbg quilt # And use ccache explitly export PATH=/usr/lib/ccache:$PATH diff --git a/tox.ini b/tox.ini index b3173d6..7330024 100644 --- a/tox.ini +++ b/tox.ini @@ -1,12 +1,17 @@ [tox] minversion = 3.18.0 -envlist = pep8,py27,py37,docs -ignore_basepython_conflict = True +envlist = pep8,py3,docs [testenv] -usedevelop = True -basepython = python3 -passenv = PBR_INTEGRATION PIPFLAGS PIPVERSION PBRVERSION REPODIR WHEELHOUSE PROJECTS +usedevelop = true +passenv = + PBR_INTEGRATION + PIPFLAGS + PIPVERSION + PBRVERSION + REPODIR + WHEELHOUSE + PROJECTS # TODO(fungi): drop distutils override once logging improves in Setuptools # https://github.com/pypa/setuptools/issues/3038 setenv = @@ -24,7 +29,8 @@ commands = stestr run --suppress-attachments {posargs} commands = pre-commit run -a [testenv:docs] -allowlist_externals = rm +allowlist_externals = + rm deps = -r{toxinidir}/doc/requirements.txt commands = @@ -33,7 +39,8 @@ commands = sphinx-build -W -b html doc/source doc/build/html {posargs} [testenv:releasenotes] -allowlist_externals = rm +allowlist_externals = + rm deps = {[testenv:docs]deps} commands = rm -rf releasenotes/build -- cgit v1.2.1