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
This commit is contained in:
Akihiro Motoki 2019-10-02 09:28:11 +09:00
parent cf904d1194
commit 205ebe0f47
4 changed files with 5 additions and 8 deletions

View File

@ -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

View File

@ -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

View File

@ -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

10
tox.ini
View File

@ -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