From 530ba016ad66cdd1822f28280a8b922c39e39941 Mon Sep 17 00:00:00 2001 From: Akihiro Motoki Date: Sun, 22 Apr 2018 10:50:30 +0900 Subject: [PATCH] Follow the new PTI for document build Comment 7887b3f41adab0644dc9a32ac91196179208c78f invented a wrong way which violates the recent PTI. This commit clean them up and follow the new PTL for documentation build. The detail is described in the following links: https://governance.openstack.org/tc/reference/project-testing-interface.html http://lists.openstack.org/pipermail/openstack-dev/2017-December/125710.html pbr autodoc is now converted into sphinxcontrib-autodoc. http://lists.openstack.org/pipermail/openstack-dev/2018-April/129147.html Change-Id: I158440ef40426593981774307af982028573042b --- doc/requirements.txt | 17 +++++++++++++++++ doc/source/conf.py | 10 ++++++++-- lower-constraints.txt | 1 + setup.cfg | 11 ----------- test-requirements.txt | 3 --- tox.ini | 19 +++++++------------ 6 files changed, 33 insertions(+), 28 deletions(-) create mode 100644 doc/requirements.txt diff --git a/doc/requirements.txt b/doc/requirements.txt new file mode 100644 index 00000000..ec1df52e --- /dev/null +++ b/doc/requirements.txt @@ -0,0 +1,17 @@ +# The order of packages is significant, because pip processes them in the order +# of appearance. Changing the order has an impact on the overall integration +# process, which may cause wedges in the gate later. +# Order matters to the pip dependency resolver, so sorting this file +# changes how packages are installed. New dependencies should be +# added in alphabetical order, however, some dependencies may need to +# be installed in a specific order. +# +openstackdocstheme>=1.18.1 # Apache-2.0 +reno>=2.5.0 # Apache-2.0 +sphinx!=1.6.6,!=1.6.7,>=1.6.2 # BSD +sphinxcontrib-apidoc>=0.2.0 # BSD + +# NOTE: The following are required as horizon.test.settings loads it. +django-nose>=1.4.4 # BSD +mock>=2.0.0 # BSD +mox3>=0.20.0 # Apache-2.0 diff --git a/doc/source/conf.py b/doc/source/conf.py index 29de0453..7084b352 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -58,11 +58,11 @@ from magnum_ui import version as magnumui_ver # Add any Sphinx extension module names here, as strings. # They can be extensions coming with Sphinx (named 'sphinx.ext.*') # or your custom ones. -extensions = ['sphinx.ext.autodoc', - 'sphinx.ext.todo', +extensions = ['sphinx.ext.todo', 'sphinx.ext.coverage', 'sphinx.ext.viewcode', 'openstackdocstheme', + 'sphinxcontrib.apidoc', ] # Add any paths that contain templates here, relative to this directory. @@ -128,6 +128,12 @@ pygments_style = 'sphinx' primary_domain = 'py' nitpicky = False +# sphinxcontrib-apidoc +apidoc_module_dir = '../../magnum_ui' +apidoc_output_dir = 'contributor/api' +apidoc_excluded_paths = [ + 'test', +] # -- Options for HTML output -------------------------------------------------- diff --git a/lower-constraints.txt b/lower-constraints.txt index e34e41fd..1525b071 100644 --- a/lower-constraints.txt +++ b/lower-constraints.txt @@ -106,6 +106,7 @@ simplejson==3.13.2 six==1.11.0 snowballstemmer==1.2.1 Sphinx==1.6.2 +sphinxcontrib-apidoc===0.2.0 sphinxcontrib-websupport==1.0.1 stevedore==1.28.0 termcolor==1.1.0 diff --git a/setup.cfg b/setup.cfg index 3042ce7b..7ba3e8f0 100644 --- a/setup.cfg +++ b/setup.cfg @@ -21,14 +21,3 @@ classifier = [files] packages = magnum_ui - -[build_sphinx] -all_files = 1 -build-dir = doc/build -source-dir = doc/source -warning-is-error = 1 - -[pbr] -autodoc_index_modules = True -api_doc_dir = contributor/api - diff --git a/test-requirements.txt b/test-requirements.txt index 5f567223..f5e937e3 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -18,9 +18,6 @@ nose-exclude>=0.3.0 # LGPL nosehtmloutput>=0.0.3 # Apache-2.0 nosexcover>=1.0.10 # BSD openstack.nose-plugin>=0.7 # Apache-2.0 -openstackdocstheme>=1.18.1 # Apache-2.0 -reno>=2.5.0 # Apache-2.0 selenium>=2.50.1 # Apache-2.0 -sphinx!=1.6.6,!=1.6.7,>=1.6.2 # BSD # This also needs xvfb library installed on your OS xvfbwrapper>=0.1.3 #license: MIT diff --git a/tox.ini b/tox.ini index e34fe36d..9a8ae06b 100644 --- a/tox.ini +++ b/tox.ini @@ -89,22 +89,17 @@ commands = {toxinidir}/tools/tox_helper.sh {envname} {basepython} post [testenv:docs] -commands = - # Clean-up env and install horizon from git - {toxinidir}/tools/tox_helper.sh {envname} {basepython} pre - # Run test - python setup.py build_sphinx - # Clean-up env except log - {toxinidir}/tools/tox_helper.sh {envname} {basepython} post +deps = + -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} + -r{toxinidir}/doc/requirements.txt +commands= + sphinx-build -W -b html doc/source doc/build/html [testenv:releasenotes] +deps = + {[testenv:docs]deps} commands = - # Clean-up env and install horizon from git - {toxinidir}/tools/tox_helper.sh {envname} {basepython} pre - # Run test sphinx-build -a -E -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html - # Clean-up env except log - {toxinidir}/tools/tox_helper.sh {envname} {basepython} post [testenv:lower-constraints] basepython = python3