From fb3cca010fa6f7583c2f629787053e0685f7ee4f Mon Sep 17 00:00:00 2001 From: Bogdan Dobrelya Date: Tue, 19 Jan 2016 12:13:02 +0100 Subject: [PATCH] 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 --- .gitignore | 3 ++- doc-test.conf | 2 ++ tox.ini | 38 ++++++++++++++++++++++++++++++++++---- 3 files changed, 38 insertions(+), 5 deletions(-) create mode 100644 doc-test.conf diff --git a/.gitignore b/.gitignore index 0eda1d05..5912f289 100644 --- a/.gitignore +++ b/.gitignore @@ -44,7 +44,8 @@ vagrant-settings.yaml .cache .tox - +ChangeLog +AUTHORS .coverage diff --git a/doc-test.conf b/doc-test.conf new file mode 100644 index 00000000..f86cc542 --- /dev/null +++ b/doc-test.conf @@ -0,0 +1,2 @@ +[DEFAULT] +repo_name = solar diff --git a/tox.ini b/tox.ini index cca52db8..4bc92ce6 100644 --- a/tox.ini +++ b/tox.ini @@ -8,6 +8,8 @@ usedevelop = True install_command = pip install -U {opts} {packages} setenv = VIRTUAL_ENV={envdir} passenv = SOLAR_DB + +[testenv:py27] deps = -r{toxinidir}/test-requirements.txt commands = ostestr @@ -17,12 +19,40 @@ usedevelop = False commands = flake8 {posargs:solar} -[testenv:docs] -deps = -r{toxinidir}/requirements.txt - sphinx +[testenv:checkniceness] +deps = openstack-doc-tools>=0.30 + doc8 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 + {[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] deps = -r{toxinidir}/requirements.txt