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

Change-Id: I078e2ed32da04303203d6c2a3e498f82b9a15939
This commit is contained in:
Nguyen Hai 2018-03-19 21:09:12 +09:00
parent 8a1a017ea6
commit 3c70f8f69e
7 changed files with 36 additions and 25 deletions

8
doc/requirements.txt Normal file
View File

@ -0,0 +1,8 @@
# 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
sphinxcontrib-apidoc>=0.2.0 # BSD
reno>=2.5.0 # Apache-2.0
openstackdocstheme>=1.18.1 # Apache-2.0
httplib2>=0.9.1 # MIT

View File

@ -28,12 +28,22 @@ sys.path.insert(0, ROOT)
sys.path.insert(0, BASE_DIR) sys.path.insert(0, BASE_DIR)
extensions = [ extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.doctest', 'sphinx.ext.doctest',
'sphinx.ext.coverage', 'sphinx.ext.coverage',
'openstackdocstheme', 'openstackdocstheme',
'sphinxcontrib.apidoc',
] ]
# sphinxcontrib.apidoc options
apidoc_module_dir = '../../troveclient'
apidoc_output_dir = 'reference/api'
apidoc_excluded_paths = [
'compat/tests/*',
'compat/tests',
'tests/*',
'tests']
apidoc_separate_modules = True
# openstackdocstheme options # openstackdocstheme options
repository_name = 'openstack/python-troveclient' repository_name = 'openstack/python-troveclient'
bug_project = 'python-troveclient' bug_project = 'python-troveclient'

View File

@ -11,14 +11,17 @@
License for the specific language governing permissions and limitations License for the specific language governing permissions and limitations
under the License. under the License.
============================================ ===========================================
Python bindings to the OpenStack Trove API Python bindings to the OpenStack Trove API
============================================ ===========================================
This is a client for the OpenStack Trove API. There's a Python API (the This is a client for the OpenStack Trove API. There's a Python API (the
``troveclient`` module), and a command-line script (``trove``). Each ``troveclient`` module), and a command-line script (``trove``). Each
implements 100% of the OpenStack Trove API. implements 100% of the OpenStack Trove API.
Contents
--------
.. toctree:: .. toctree::
:maxdepth: 2 :maxdepth: 2
@ -27,7 +30,7 @@ implements 100% of the OpenStack Trove API.
reference/index reference/index
Indices and tables Indices and tables
================== ------------------
* :ref:`genindex` * :ref:`genindex`
* :ref:`search` * :ref:`search`

View File

@ -5,4 +5,4 @@
.. toctree:: .. toctree::
:maxdepth: 2 :maxdepth: 2
api/autoindex api/modules

View File

@ -90,20 +90,5 @@ openstack.database.v1 =
datastore_version_show = troveclient.osc.v1.datastores:ShowDatastoreVersion datastore_version_show = troveclient.osc.v1.datastores:ShowDatastoreVersion
[build_sphinx]
all_files = 1
source-dir = doc/source
build-dir = doc/build
warning-is-error = 1
[upload_sphinx]
upload-dir = doc/build/html
[wheel] [wheel]
universal = 1 universal = 1
[pbr]
autodoc_index_modules = True
api_doc_dir = reference/api
autodoc_exclude_modules =
troveclient.tests.*

View File

@ -7,11 +7,8 @@ fixtures>=3.0.0 # Apache-2.0/BSD
oslotest>=3.2.0 # Apache-2.0 oslotest>=3.2.0 # Apache-2.0
python-openstackclient>=3.12.0 # Apache-2.0 python-openstackclient>=3.12.0 # Apache-2.0
requests-mock>=1.2.0 # Apache-2.0 requests-mock>=1.2.0 # Apache-2.0
sphinx!=1.6.6,!=1.6.7,>=1.6.2 # BSD
testrepository>=0.0.18 # Apache-2.0/BSD testrepository>=0.0.18 # Apache-2.0/BSD
testscenarios>=0.4 # Apache-2.0/BSD testscenarios>=0.4 # Apache-2.0/BSD
testtools>=2.2.0 # MIT testtools>=2.2.0 # MIT
mock>=2.0.0 # BSD mock>=2.0.0 # BSD
httplib2>=0.9.1 # MIT httplib2>=0.9.1 # MIT
reno>=2.5.0 # Apache-2.0
openstackdocstheme>=1.18.1 # Apache-2.0

12
tox.ini
View File

@ -49,11 +49,19 @@ commands =
coverage report coverage report
[testenv:docs] [testenv:docs]
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 = commands =
rm -rf doc/html doc/build rm -rf doc/html doc/build
python setup.py build_sphinx sphinx-build -W -b html doc/source doc/build/html
[testenv:releasenotes] [testenv:releasenotes]
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 commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
[flake8] [flake8]