Add tox checkniceness,checksyntax for docs

* Add tox -e checkniceness and tox -e checksyntax to
make the docs almost perfect.
* Make tox -e docs task to call check* tasks as well
* Sanitize dependency install for separate tasks:
  - docs, do not install non related eggs from test-requirements
  - check*, install only required eggs as well
* Use whitelist_externals for the /bin/rm to remove warnings

Note, this change doesn't affect the time of py27/pep8 tasks
executuion!

Change-Id: I2d8ea9f8763fef06935c063f6564a9b239c31caf
Signed-off-by: Bogdan Dobrelya <bdobrelia@mirantis.com>
This commit is contained in:
Bogdan Dobrelya 2016-01-19 12:13:02 +01:00
parent aea48b733e
commit fb3cca010f
3 changed files with 38 additions and 5 deletions

3
.gitignore vendored
View File

@ -44,7 +44,8 @@ vagrant-settings.yaml
.cache .cache
.tox .tox
ChangeLog
AUTHORS
.coverage .coverage

2
doc-test.conf Normal file
View File

@ -0,0 +1,2 @@
[DEFAULT]
repo_name = solar

38
tox.ini
View File

@ -8,6 +8,8 @@ usedevelop = True
install_command = pip install -U {opts} {packages} install_command = pip install -U {opts} {packages}
setenv = VIRTUAL_ENV={envdir} setenv = VIRTUAL_ENV={envdir}
passenv = SOLAR_DB passenv = SOLAR_DB
[testenv:py27]
deps = -r{toxinidir}/test-requirements.txt deps = -r{toxinidir}/test-requirements.txt
commands = ostestr commands = ostestr
@ -17,12 +19,40 @@ usedevelop = False
commands = commands =
flake8 {posargs:solar} flake8 {posargs:solar}
[testenv:docs] [testenv:checkniceness]
deps = -r{toxinidir}/requirements.txt deps = openstack-doc-tools>=0.30
sphinx doc8
commands = commands =
rm -rf doc/build openstack-doc-test --check-niceness
doc8 doc
[testenv:checksyntax]
deps = openstack-doc-tools>=0.30
commands =
openstack-doc-test --check-syntax
[testenv:docs]
deps = sphinx
{[testenv:checkniceness]deps}
whitelist_externals = /bin/rm
commands =
/bin/rm -rf doc/build
python setup.py build_sphinx python setup.py build_sphinx
{[testenv:checkniceness]commands}
{[testenv:checksyntax]commands}
[doc8]
# Settings for doc8:
# Ignore target directories
ignore-path = doc/build*
# File extensions to use
extensions = .rst,.txt
# Maximal line length should be 79 but we have some overlong lines.
# Let's not get far more in.
max-line-length = 80
# Disable some doc8 checks:
# D000: Check RST validity (cannot handle lineos directive)
ignore = D000
[testenv:venv] [testenv:venv]
deps = -r{toxinidir}/requirements.txt deps = -r{toxinidir}/requirements.txt