From b0cbf66d492c48181bc6bb0b8a18f1b32bbb6935 Mon Sep 17 00:00:00 2001 From: Nguyen Hai Date: Mon, 20 Aug 2018 11:24:58 +0100 Subject: [PATCH] Follow the new PTI for document build For compliance with the Project Testing Interface as described in: [1] https://governance.openstack.org/tc/reference/project-testing-interface.html [2] http://lists.openstack.org/pipermail/openstack-dev/2017-December/125710.html [3] http://lists.openstack.org/pipermail/openstack-dev/2018-March/128594.html Change-Id: Iebd3fe6731b2e9a6fe4d4cc4d2c4d07d648549cb --- doc/requirements.txt | 7 +++++++ doc/source/class_reference.rst | 2 +- doc/source/conf.py | 10 +++++++++- setup.cfg | 14 -------------- test-requirements.txt | 4 +--- tox.ini | 10 +++++++++- 6 files changed, 27 insertions(+), 20 deletions(-) create mode 100644 doc/requirements.txt diff --git a/doc/requirements.txt b/doc/requirements.txt new file mode 100644 index 00000000..22aab3bc --- /dev/null +++ b/doc/requirements.txt @@ -0,0 +1,7 @@ +# 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. +sphinx!=1.6.6,!=1.6.7,>=1.6.2 # BSD +reno>=2.5.0 # Apache-2.0 +openstackdocstheme>=1.18.1 # Apache-2.0 +sphinxcontrib-apidoc>=0.2.0 # BSD diff --git a/doc/source/class_reference.rst b/doc/source/class_reference.rst index 9a681c20..406258f5 100644 --- a/doc/source/class_reference.rst +++ b/doc/source/class_reference.rst @@ -4,4 +4,4 @@ Python Mistral bindings class refrence .. toctree:: :maxdepth: 1 - api/autoindex + api/modules diff --git a/doc/source/conf.py b/doc/source/conf.py index 59f8378a..5748a248 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -18,13 +18,21 @@ sys.path.insert(0, os.path.abspath('./')) # 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', + 'sphinxcontrib.apidoc', 'openstackdocstheme', ] # Add any paths that contain templates here, relative to this directory. # templates_path = ['_templates'] +# sphinxcontrib.apidoc options +apidoc_module_dir = '../../mistralclient' +apidoc_output_dir = 'api' +apidoc_excluded_paths = [ + 'test', + 'tests/*'] +apidoc_separate_modules = True + # The suffix of source filenames. source_suffix = '.rst' diff --git a/setup.cfg b/setup.cfg index 06946c35..467d005a 100644 --- a/setup.cfg +++ b/setup.cfg @@ -22,16 +22,6 @@ home-page = https://docs.openstack.org/python-mistralclient/latest/ packages = mistralclient -[build_sphinx] -builders = html,man -source-dir = doc/source -build-dir = doc/build -all_files = 1 -warning-is-error = 1 - -[upload_sphinx] -upload-dir = doc/build/html - [entry_points] console_scripts = mistral = mistralclient.shell:main @@ -123,7 +113,3 @@ cover-package = mistralclient [extract_messages] keywords = _ gettext ngettext l_ lazy_gettext - -[pbr] -autodoc_index_modules = True -warnerrors = True diff --git a/test-requirements.txt b/test-requirements.txt index 2c1bc687..d5c69274 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -3,12 +3,10 @@ # process, which may cause wedges in the gate later. hacking!=0.13.0,<0.14,>=0.12.0 # Apache-2.0 python-openstackclient>=3.12.0 # Apache-2.0 -sphinx!=1.6.6,!=1.6.7,>=1.6.2 # BSD mock>=2.0.0 # BSD oslotest>=3.2.0 # Apache-2.0 requests-mock>=1.2.0 # Apache-2.0 tempest>=17.1.0 # Apache-2.0 osprofiler>=1.4.0 # Apache-2.0 -reno>=2.5.0 # Apache-2.0 stestr>=2.0.0 # Apache-2.0 -openstackdocstheme>=1.18.1 # Apache-2.0 +docutils>=0.11 # BSD diff --git a/tox.ini b/tox.ini index 444ae1ab..a0beb2b2 100644 --- a/tox.ini +++ b/tox.ini @@ -40,10 +40,14 @@ commands = {posargs} [testenv:docs] basepython = python3 +deps = + -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} + -r{toxinidir}/requirements.txt + -r{toxinidir}/doc/requirements.txt commands = rm -rf doc/html doc/build rm -rf doc/source/apidoc doc/source/api - python setup.py build_sphinx + sphinx-build -W -b html doc/source doc/build/html [flake8] # H106: Don’t put vim configuration in source files @@ -55,6 +59,10 @@ exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,tools [testenv:releasenotes] basepython = python3 +deps = + -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} + -r{toxinidir}/requirements.txt + -r{toxinidir}/doc/requirements.txt commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html [testenv:lower-constraints]