Skip to content

Commit

Permalink
Follow the new PTI for document build
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
nguyentrihai93 committed Apr 12, 2018
1 parent 314a29f commit a8003ec
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 33 deletions.
7 changes: 7 additions & 0 deletions doc/requirements.txt
Original file line number Diff line number Diff line change
@@ -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
10 changes: 9 additions & 1 deletion doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,18 @@
# 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'
Expand Down
2 changes: 1 addition & 1 deletion doc/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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`).

Expand Down
8 changes: 0 additions & 8 deletions doc/source/reference/api/index.rst

This file was deleted.

2 changes: 1 addition & 1 deletion doc/source/reference/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ done so, you can use the API like so::
.. toctree::
:maxdepth: 2

api/index
Python API Reference <api/modules>
apiv2
16 changes: 0 additions & 16 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 0 additions & 3 deletions test-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 6 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a8003ec

Please sign in to comment.