From b65459e69defe5fb6b0388df0a74a90249ca053e Mon Sep 17 00:00:00 2001 From: Nguyen Hai Date: Sat, 7 Jul 2018 11:07:38 +0900 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: I06d510a44b9e8c0024f5e41f10f4446e18bf86cc --- doc/requirements.txt | 7 +++++++ doc/source/conf.py | 11 ++++++++++- doc/source/reference/index.rst | 2 +- setup.cfg | 15 --------------- test-requirements.txt | 5 ----- tox.ini | 4 +++- 6 files changed, 21 insertions(+), 23 deletions(-) create mode 100644 doc/requirements.txt diff --git a/doc/requirements.txt b/doc/requirements.txt new file mode 100644 index 00000000..67530ffd --- /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 +openstackdocstheme>=1.18.1 # Apache-2.0 +reno>=2.5.0 # Apache-2.0 +sphinxcontrib-apidoc>=0.2.0 # BSD diff --git a/doc/source/conf.py b/doc/source/conf.py index 64ff8e62..3ff6345d 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -23,7 +23,8 @@ 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', 'openstackdocstheme'] +extensions = ['openstackdocstheme', + 'sphinxcontrib.apidoc'] # openstackdocstheme options repository_name = 'openstack/glance_store' @@ -31,6 +32,14 @@ bug_project = 'glance-store' bug_tag = '' html_last_updated_fmt = '%Y-%m-%d %H:%M' +# sphinxcontrib.apidoc options +apidoc_module_dir = '../../glance_store' +apidoc_output_dir = 'reference/api' +apidoc_excluded_paths = [ + 'test', + 'tests/*'] +apidoc_separate_modules = True + # autodoc generation is a bit aggressive and a nuisance when doing heavy # text edit cycles. # execute "export SPHINX_DEBUG=1" in your terminal to disable diff --git a/doc/source/reference/index.rst b/doc/source/reference/index.rst index c654ff73..ca24b39e 100644 --- a/doc/source/reference/index.rst +++ b/doc/source/reference/index.rst @@ -5,4 +5,4 @@ .. toctree:: :maxdepth: 1 - api/autoindex + api/modules diff --git a/setup.cfg b/setup.cfg index bc800dc7..226d5e7c 100644 --- a/setup.cfg +++ b/setup.cfg @@ -64,21 +64,6 @@ cinder = oslo.rootwrap>=5.8.0 # Apache-2.0 oslo.privsep>=1.23.0 # Apache-2.0 -[build_sphinx] -source-dir = doc/source -build-dir = doc/build -all_files = 1 -warning-is-error = 1 - -[pbr] -autodoc_index_modules = True -api_doc_dir = reference/api -autodoc_exclude_modules = - glance_store.tests.* - -[upload_sphinx] -upload-dir = doc/build/html - [compile_catalog] directory = glance_store/locale domain = glance_store diff --git a/test-requirements.txt b/test-requirements.txt index f91942ef..0b0d6f82 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -19,11 +19,6 @@ oslotest>=3.2.0 # Apache-2.0 os-testr>=1.0.0 # Apache-2.0 bandit>=1.1.0 # Apache-2.0 -# this is required for the docs build jobs -sphinx!=1.6.6,!=1.6.7,>=1.6.2 # BSD -openstackdocstheme>=1.18.1 # Apache-2.0 -reno>=2.5.0 # Apache-2.0 - # Dependencies for each of the optional stores oslo.vmware>=2.17.0 # Apache-2.0 httplib2>=0.9.1 # MIT diff --git a/tox.ini b/tox.ini index 733351c7..e146b6e8 100644 --- a/tox.ini +++ b/tox.ini @@ -15,10 +15,12 @@ commands = ostestr --slowest {posargs} [testenv:docs] basepython = python3 -commands = python setup.py build_sphinx +deps = -r{toxinidir}/doc/requirements.txt +commands = sphinx-build -W -b html doc/source doc/build/html [testenv:releasenotes] basepython = python3 +deps = -r{toxinidir}/doc/requirements.txt commands = sphinx-build -a -E -W -d releasenotes/build/.doctrees -b html releasenotes/source releasenotes/build/html [testenv:pep8]