From 205ebe0f47e4f6ba493f106f9d82a67847c7e205 Mon Sep 17 00:00:00 2001 From: Akihiro Motoki Date: Wed, 2 Oct 2019 09:28:11 +0900 Subject: [PATCH] tox: Move doc8 to docs related envs Previously doc8 is run as part of pep8 tox env. This leads to some tricky 'deps' in pep8 which installs the docs dependencies. This can be fixed by moving doc8 to the docs related tox envs (docs and releasenotes). This also helps developers using devstack avoid hitting an error in "manage.py compilemessages" in stack.sh. The error is caused by sphinx installed under .tox directory (as compilemessages tries to compile all message catalogs even under dot directories like .tox). Developers sometimes change the horizon code under /opt/stack/horizon and it is not surprising to run "tox -e pep8". (I think it is more common compared to a chance to run "tox -e docs".) Thus I believe it is reasonable to move doc8 to the docs env. Change-Id: I6345ebbcd24afc358555e9be4b2ca700c4b33861 --- doc/requirements.txt | 1 + lower-constraints.txt | 1 - test-requirements.txt | 1 - tox.ini | 10 ++++------ 4 files changed, 5 insertions(+), 8 deletions(-) diff --git a/doc/requirements.txt b/doc/requirements.txt index 27ac1acd6b..91745ad945 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -9,6 +9,7 @@ openstackdocstheme>=1.20.0 # Apache-2.0 reno>=2.5.0 # Apache-2.0 sphinx!=1.6.6,!=1.6.7,>=1.6.2,<2.0.0;python_version=='2.7' # BSD sphinx!=1.6.6,!=1.6.7,!=2.1.0,>=1.6.2;python_version>='3.4' # BSD +doc8>=0.6.0 # Apache-2.0 # The below is rewquired to build testing module reference mock>=2.0.0 # BSD diff --git a/lower-constraints.txt b/lower-constraints.txt index 1cc785950a..72232a0295 100644 --- a/lower-constraints.txt +++ b/lower-constraints.txt @@ -22,7 +22,6 @@ django-babel==0.6.2 django-compressor==2.0 django-debreach==1.4.2 django-pyscss==2.0.2 -doc8==0.6.0 docutils==0.11 dogpile.cache==0.6.2 dulwich==0.15.0 diff --git a/test-requirements.txt b/test-requirements.txt index b0c9e44668..f0aef8be40 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -12,7 +12,6 @@ hacking>=1.1.0 # Apache-2.0 astroid==2.1.0;python_version>='3.0' # LGPLv2.1 bandit!=1.6.0,>=1.4.0 # Apache-2.0 coverage!=4.4,>=4.0 # Apache-2.0 -doc8>=0.6.0 # Apache-2.0 flake8-import-order==0.12 # LGPLv3 mock>=2.0.0 # BSD mox3>=0.20.0 # Apache-2.0 diff --git a/tox.ini b/tox.ini index 54a8452a55..d7d5ba5415 100644 --- a/tox.ini +++ b/tox.ini @@ -37,21 +37,17 @@ deps = -r{toxinidir}/requirements.txt [testenv:venv] +envdir = {toxworkdir}/venv commands = {posargs} [testenv:pep8] -# NOTE: Due to doc dependencies, we don't share envdir with "venv". -# sphinx (precisely Pygments) needs to be installed to make doc8 work properly -deps = - {[testenv]deps} - -r{toxinidir}/doc/requirements.txt +envdir = {toxworkdir}/venv setenv = DJANGO_SETTINGS_MODULE=openstack_dashboard.test.settings commands = flake8 {posargs} {envpython} {toxinidir}/manage.py extract_messages --verbosity 0 --check-only bash {toxinidir}/tools/find_executables.sh - doc8 doc/source releasenotes/source releasenotes/notes pylint -j 4 --verbose --rcfile=.pylintrc -f colorized openstack_dashboard openstack_auth horizon [testenv:cover] @@ -125,6 +121,7 @@ deps = -r{toxinidir}/doc/requirements.txt commands = sphinx-build -W -b html doc/source doc/build/html + doc8 doc/source [testenv:pdf-docs] basepython = python3 @@ -141,6 +138,7 @@ envdir = {toxworkdir}/docs deps = {[testenv:docs]deps} commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html + doc8 doc/source [testenv:manage] envdir = {toxworkdir}/venv