From ce29fcfb4cc76d890856d96def2e888ffee26fc2 Mon Sep 17 00:00:00 2001 From: Stephen Finucane Date: Tue, 27 Jun 2023 17:16:47 +0100 Subject: [PATCH] Make tox.ini tox 4.0.0 compatible/fix gate * Removed skipsdist=True to make sure placement available in the virtual env. Without this, our entrypoints are not available. * Removed basepython = python3 as we assume all developer switched to python3 in their env already * Removed ignore_basepython_conflict = True as without the basepython definition generative targets now work without conflict See [1] for a similar change made to placement. It is also necessary to fix issues with the gate. For reasons that I have yet to grok, a mock of 'requests.request' used in some test is no longer functioning as expected. My guess is that something is now importing requests before us and interfering with the mock but never mind - we can easily bypass the issue by mocking 'requests.post' instead. Changes: keystonemiddleware/tests/unit/test_ec2_token_middleware.py test-requirements.txt NOTE(stephenfin): It is necessary to revert the test changes since they don't apply to this branch. It is also necessary to cap bandit since we can't fix the timeout errors it is warning about without a feature backport. [1] https://review.opendev.org/c/openstack/placement/+/868418/ Change-Id: I3b8263afbf0ccee88ceaac2040d5ad274f22d74a Signed-off-by: Stephen Finucane (cherry picked from commit 626df3a5e9e9d4fbea2649a9cfa0048083bdb88b) --- test-requirements.txt | 2 +- tox.ini | 10 ++++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/test-requirements.txt b/test-requirements.txt index b539b017..db816555 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -21,4 +21,4 @@ WebTest>=2.0.27 # MIT oslo.messaging>=5.29.0 # Apache-2.0 # Bandit security code scanner -bandit!=1.6.0,>=1.1.0 # Apache-2.0 +bandit!=1.6.0,>=1.1.0,<1.7.5 # Apache-2.0 diff --git a/tox.ini b/tox.ini index ab4bee0a..50a5477c 100644 --- a/tox.ini +++ b/tox.ini @@ -1,8 +1,6 @@ [tox] -minversion = 3.18.0 -skipsdist = True -envlist = py37,pep8,releasenotes -ignore_basepython_conflict = True +minversion = 4.2.0 +envlist = py3,pep8,releasenotes [testenv] usedevelop = True @@ -13,8 +11,8 @@ deps = -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master} -r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt -commands = stestr run {posargs} -basepython = python3 +commands = + stestr run {posargs} [testenv:pep8] commands =