From df24e3b9c8b93ae49f3d639f18d0494f2445041c Mon Sep 17 00:00:00 2001 From: Eric Fried Date: Tue, 12 Feb 2019 10:24:50 -0600 Subject: [PATCH] tox: Don't write byte code (maybe) In tox versions after 3.0.0rc1 [1], setting the environment variable PYTHONDONTWRITEBYTECODE will cause tox not to write .pyc files, which means you don't have to delete them, which makes things faster. In older tox versions, the env var is ignored. If we bump the minimum tox version to something later than 3.0.0rc1, we can remove the commands that find and remove .pyc files. Conflicts: tox.ini NOTE(stephenfin): Conflict is due to a number of unrelated changes made during Rocky, such as Idda28f153d5054efc885ef2bde0989841df29cd3. [1] https://github.com/tox-dev/tox/commit/336f4f6bd8b53223f940fc5cfc43b1bbd78d4699 Change-Id: I779a17afade78997ab084909a9e6a46b0f91f055 (cherry picked from commit 590a2b6bbf71294d187d7082cc302069797db029) (cherry picked from commit 99f0c4c0144a551f0fa7f3a8847327660e5ccb89) --- tox.ini | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tox.ini b/tox.ini index 800557efb6ed..140f4ce4f94e 100644 --- a/tox.ini +++ b/tox.ini @@ -17,6 +17,9 @@ setenv = VIRTUAL_ENV={envdir} OS_STDOUT_CAPTURE=1 OS_STDERR_CAPTURE=1 OS_TEST_TIMEOUT=160 + # NOTE(efried): This is only effective in tox versions after 3.0.0rc1 + # https://github.com/tox-dev/tox/commit/336f4f6bd8b53223f940fc5cfc43b1bbd78d4699 + PYTHONDONTWRITEBYTECODE=1 deps = -r{toxinidir}/test-requirements.txt commands = find . -type f -name "*.pyc" -delete