From c409caae792eb7024b212c52d63eda8b8f383be9 Mon Sep 17 00:00:00 2001
From: Stephen Finucane <stephenfin@redhat.com>
Date: Thu, 29 Jul 2021 10:14:48 +0100
Subject: [PATCH] Use tox 3.1.1 fixes

By 3.1.1, tox had fixed:

- [1] which mishandled the basepython directive.
- ignoring PYTHONDONTWRITEBYTECODE [2]

Require this version and remove the workarounds.

See ML thread [3] for some details

[1] https://github.com/tox-dev/tox/issues/477
[2] https://github.com/tox-dev/tox/commit/336f4f6bd8b53223f940fc5cfc43b1bbd78d4699
[3] http://lists.openstack.org/pipermail/openstack-dev/2018-July/thread.html#132075

Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Change-Id: Idcb204a0dcda92f2bd8cbae37d510d5993c739fe
---
 tox.ini | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/tox.ini b/tox.ini
index 4bb97f5f2e..1385f24c9d 100644
--- a/tox.ini
+++ b/tox.ini
@@ -2,18 +2,22 @@
 minversion = 3.18.0
 skipsdist = True
 envlist = py3,pep8
+# Automatic envs (pyXX) will only use the python version appropriate to that
+# env and ignore basepython inherited from [testenv] if we set
+# ignore_basepython_conflict.
+ignore_basepython_conflict = true
 
 [testenv]
 basepython = python3
-setenv = VIRTUAL_ENV={envdir}
-usedevelop = True
-allowlist_externals = find
+usedevelop = true
+setenv =
+  VIRTUAL_ENV={envdir}
+  PYTHONDONTWRITEBYTECODE=1
 deps =
   -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
   -r{toxinidir}/requirements.txt
   -r{toxinidir}/test-requirements.txt
 commands =
-  find . -type f -name "*.py[c|o]" -delete
   stestr run {posargs}
   stestr slowest