Follow the new PTI for document build

- Follow new PTI for docs build
- Add sphinxcontrib.apidoc to replace pbr autodoc

REF:
https://governance.openstack.org/tc/reference/project-testing-interface.html
http://lists.openstack.org/pipermail/openstack-dev/2017-December/125710.html
http://lists.openstack.org/pipermail/openstack-dev/2018-March/128594.html

Co-Authored-By: Nguyen Hai <nguyentrihai93@gmail.com>
Change-Id: Id16a5eaa57bc0d96332849abfb62898e6766ef86
This commit is contained in:
Nguyen Hai 2017-12-29 13:53:24 +08:00
parent 314a29f6a6
commit a8003eced7
8 changed files with 24 additions and 33 deletions

7
doc/requirements.txt Normal file
View File

@ -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.
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

View File

@ -26,10 +26,18 @@ sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__),
# 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',
'sphinxcontrib.apidoc',
]
# sphinxcontrib.apidoc options
apidoc_module_dir = '../../glanceclient'
apidoc_output_dir = 'reference/api'
apidoc_excluded_paths = [
'tests/*',
'tests']
apidoc_separate_modules = True
# openstackdocstheme options
repository_name = 'openstack/python-glanceclient'
bug_project = 'python-glanceclient'

View File

@ -3,7 +3,7 @@
==============================================
This is a client for the OpenStack Images API. There's :doc:`a Python
API <reference/api/index>` (the :mod:`glanceclient` module) and a
API <reference/api/modules>` (the :mod:`glanceclient` module) and a
:doc:`command-line script <cli/glance>` (installed as
:program:`glance`).

View File

@ -1,8 +0,0 @@
======================
Python API Reference
======================
.. toctree::
:maxdepth: 2
autoindex

View File

@ -23,5 +23,5 @@ done so, you can use the API like so::
.. toctree::
:maxdepth: 2
api/index
Python API Reference <api/modules>
apiv2

View File

@ -33,21 +33,5 @@ setup-hooks =
console_scripts =
glance = glanceclient.shell:main
[build_sphinx]
builders = html,man
all-files = 1
warning-is-error = 1
source-dir = doc/source
build-dir = doc/build
[upload_sphinx]
upload-dir = doc/build/html
[wheel]
universal = 1
[pbr]
autodoc_index_modules = True
autodoc_exclude_modules =
glanceclient.tests.*
api_doc_dir = reference/api

View File

@ -6,9 +6,6 @@ hacking!=0.13.0,<0.14,>=0.12.0 # Apache-2.0
coverage!=4.4,>=4.0 # Apache-2.0
mock>=2.0.0 # BSD
os-client-config>=1.28.0 # Apache-2.0
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
testrepository>=0.0.18 # Apache-2.0/BSD
testtools>=2.2.0 # MIT
testscenarios>=0.4 # Apache-2.0/BSD

View File

@ -42,11 +42,14 @@ commands = python setup.py testr --coverage --testr-args='{posargs}'
coverage report
[testenv:docs]
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]
commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
deps = -r{toxinidir}/doc/requirements.txt
commands =
sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
[flake8]
ignore = F403,F812,F821