Fix docs building

In preparation for python 3 support switch to newer sphinx version.
This requires openstackdocstheme.

Remove install_command, this is the default.
Update hacking version to be compatible with python 3, fix warnings
from new pep8.

Change-Id: Iab69ec59eb111571f784242c5ea5756c2a63e424
This commit is contained in:
Andreas Jaeger 2020-02-03 21:15:28 +01:00
parent 9af6fc2692
commit 3d06be24dc
11 changed files with 39 additions and 27 deletions

1
.gitignore vendored
View File

@ -43,6 +43,7 @@ output/*/index.html
# Sphinx
doc/build
doc/source/reference/
# pbr generates these
AUTHORS

3
doc/requirements.txt Normal file
View File

@ -0,0 +1,3 @@
sphinx>=1.8.0,!=2.1.0 # BSD
openstackdocstheme>=1.30.0 # Apache-2.0
sphinxcontrib-apidoc>=0.2.0 # BSD

View File

@ -20,11 +20,26 @@ 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',
#'sphinx.ext.intersphinx',
'oslosphinx'
'openstackdocstheme',
'sphinxcontrib.apidoc',
]
# openstackdocstheme options
repository_name = 'openstack/os-performance-tools'
bug_project = 'os-performance-tools'
bug_tag = ''
html_theme = 'openstackdocs'
# sphinxcontrib.apidoc options
apidoc_module_dir = '../../os_performance_tools'
apidoc_output_dir = 'reference/api'
apidoc_excluded_paths = [
'tests/*',
'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
@ -49,6 +64,7 @@ add_module_names = True
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
# -- Options for HTML output --------------------------------------------------
# The theme to use for HTML and HTML Help pages. Major themes that come with

View File

@ -1,10 +1,6 @@
.. os-performance-tools documentation master file, created by
sphinx-quickstart on Tue Jul 9 22:26:36 2013.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
================================================
Welcome to os-performance-tools's documentation!
========================================================
================================================
Contents:
@ -15,6 +11,7 @@ Contents:
installation
usage
contributing
reference/api/modules
Indices and tables
==================

View File

@ -1,6 +1,8 @@
========
=====
Usage
========
=====
.. _counters:
os-collect-counters
-------------------

View File

@ -95,5 +95,6 @@ def main(argv=None, stdout=None):
output.write(content)
output.write(b"\n")
if __name__ == '__main__':
main()

View File

@ -41,7 +41,7 @@ OS_QA_RABBITMQ_API_USER = os.environ.get('OS_QA_RABBITMQ_USER',
'guest')
OS_QA_RABBITMQ_API_PASS = os.environ.get('OS_QA_RABBITMQ_PASS',
'guest')
FANOUT_RE = re.compile('([\-a-zA-Z0-9]+)_fanout_[a-f0-9]{32}')
FANOUT_RE = re.compile(r'([\-a-zA-Z0-9]+)_fanout_[a-f0-9]{32}')
def collect():

View File

@ -4,6 +4,6 @@
pbr>=1.6
PyMySQL>=0.6.2 # MIT License
statsd>=1.0.0,<3.0
statsd>=1.0.0
oslo.config>=1.4.0.0a3
testtools>=1.4.0

View File

@ -28,11 +28,3 @@ subunit2sql.target =
[files]
packages =
os_performance_tools
[build_sphinx]
source-dir = doc/source
build-dir = doc/build
all_files = 1
[upload_sphinx]
upload-dir = doc/build/html

View File

@ -2,13 +2,11 @@
# of appearance. Changing the order has an impact on the overall integration
# process, which may cause wedges in the gate later.
hacking<0.11,>=0.10.0
hacking<2.1,>=2.0
coverage>=3.6
discover
python-subunit>=0.0.18
sphinx!=1.2.0,!=1.3b1,<1.3,>=1.1.2
oslosphinx>=2.5.0 # Apache-2.0
oslotest>=1.10.0 # Apache-2.0
testrepository>=0.0.18
testscenarios>=0.4

View File

@ -5,7 +5,6 @@ skipsdist = True
[testenv]
usedevelop = True
install_command = pip install -U {opts} {packages}
setenv =
VIRTUAL_ENV={envdir}
deps = -r{toxinidir}/test-requirements.txt
@ -25,8 +24,11 @@ commands = python setup.py test --coverage --testr-args='{posargs}'
[testenv:docs]
basepython = python3
commands = sphinx-apidoc -o doc/source os_performance_tools
python setup.py build_sphinx
deps =
-r{toxinidir}/test-requirements.txt
-r{toxinidir}/doc/requirements.txt
commands =
sphinx-build -W -b html -d doc/build/doctrees doc/source doc/build/html
[testenv:debug]
basepython = python3