From a32ccce6de8f076a9484f68d7fbe1b3d5edf1c77 Mon Sep 17 00:00:00 2001 From: Sean Mooney Date: Wed, 6 Feb 2019 16:22:12 +0000 Subject: [PATCH] cleanup *.pyc files in docs tox envs .pyc files are ignored by nova's .gitignore, as a result if you change branches after the .pyc files are generated for example from stable/ocata to master it does not remove the .pyc files. This can lead to the _validate_bytecode_header function that is invoked as part of sphinx-build to fail as the .pyc files no longer match the contents of the checked out files. This change adds {[testenv]commands} to the docs envs to clean up stale .pyc files before running sphinx-build Change-Id: I536a260da639d32afbc998be220305f9489db375 --- tox.ini | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tox.ini b/tox.ini index f718bd976fb5..0aabcda397bf 100644 --- a/tox.ini +++ b/tox.ini @@ -195,6 +195,7 @@ description = Build main documentation. deps = -r{toxinidir}/doc/requirements.txt commands = + {[testenv]commands} rm -rf doc/build # Check that all JSON files don't have \r\n in line. bash -c "! find doc/ -type f -name *.json | xargs grep -U -n $'\r'" @@ -210,6 +211,7 @@ description = envdir = {toxworkdir}/docs deps = {[testenv:docs]deps} commands = + {[testenv]commands} rm -rf api-guide/build sphinx-build -W -b html -d api-guide/build/doctrees api-guide/source api-guide/build/html @@ -219,6 +221,7 @@ description = envdir = {toxworkdir}/docs deps = {[testenv:docs]deps} commands = + {[testenv]commands} rm -rf api-ref/build sphinx-build -W -b html -d api-ref/build/doctrees api-ref/source api-ref/build/html @@ -228,6 +231,7 @@ description = envdir = {toxworkdir}/docs deps = {[testenv:docs]deps} commands = + {[testenv]commands} rm -rf releasenotes/build sphinx-build -W -b html -d releasenotes/build/doctrees releasenotes/source releasenotes/build/html