From b92073453c3235f4f12a9e17eea3eb66cd670684 Mon Sep 17 00:00:00 2001 From: Andreas Jaeger Date: Mon, 27 May 2019 16:51:33 +0200 Subject: [PATCH] Fix docs building With Sphinx 2.0.1 working only with python3, update the configuration: * Use openstackdocstheme (oslosphinx does not work with python3) * Update requirements * Update tox.ini to use normal lines for doc building Also, fix URL for repo after OpenDev rename. Fix flake8 tests, don't test openstack-ansible-tests files. Change-Id: I464d04738aab137ea8e938614b804e1ac50f6741 --- doc/source/conf.py | 24 +++++++----------------- releasenotes/source/conf.py | 7 +------ test-requirements.txt | 4 ++-- tox.ini | 11 ++++++----- 4 files changed, 16 insertions(+), 30 deletions(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index 1cfac34..318cb35 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -45,11 +45,15 @@ import pbr.version # ones. extensions = [ 'sphinx.ext.autodoc', - 'oslosphinx', + 'openstackdocstheme', # Disabled, does not build # 'sphinxmark' ] +repository_name = 'x/monitorstack' +bug_project = 'monitorstack' +bug_tag = '' + # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] @@ -67,10 +71,6 @@ project = u'monitorstack' copyright = u'2017, OpenStack-Ansible Contributors' author = u'OpenStack-Ansible Contributors' -# The link to the browsable source code (for the left hand menu) -oslosphinx_cgit_link = ('http://git.openstack.org/cgit/openstack' - '/{0}'.format(project)) - # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. @@ -82,17 +82,6 @@ release = version_info.version_string_with_vcs() # The short X.Y version. version = version_info.canonical_version_string() -# A few variables have to be set for the log-a-bug feature. -# gitsha: The SHA checksum of the bug description. -# Automatically extracted from git log. -# bug_tag: Tag for categorizing the bug. Must be set manually. -# These variables are passed to the logabug code via html_context. -git_cmd = "/usr/bin/git log | head -n1 | cut -f2 -d' '" -gitsha = os.popen(git_cmd).read().strip('\n') -bug_project = project.lower() -bug_title = "Documentation bug" -html_context = {"gitsha": gitsha, "bug_tag": "docs", - "bug_title": bug_title, "bug_project": bug_project} # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. @@ -118,7 +107,8 @@ todo_include_todos = False # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. # -html_theme = 'default' +html_theme = 'openstackdocs' + # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the diff --git a/releasenotes/source/conf.py b/releasenotes/source/conf.py index 52f8659..2eaafee 100644 --- a/releasenotes/source/conf.py +++ b/releasenotes/source/conf.py @@ -63,10 +63,6 @@ project = u'monitorstack' copyright = u'2017, OpenStack-Ansible Contributors' author = u'OpenStack-Ansible Contributors' -# The link to the browsable source code (for the left hand menu) -oslosphinx_cgit_link = ('http://git.openstack.org/cgit/openstack' - '/{0}'.format(project)) - # Release notes do not need a version number in the title, they # cover multiple releases. # The full version, including alpha/beta/rc tags. @@ -74,11 +70,10 @@ release = '' # The short X.Y version. version = '' -repository_name = 'openstack/monitorstack' +repository_name = 'x/monitorstack' bug_project = 'monitorstack' bug_tag = '' -html_last_updated_fmt = '%Y-%m-%d %H:%M' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/test-requirements.txt b/test-requirements.txt index 8f7cf37..f00d0e8 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -8,9 +8,9 @@ flake8-import-order==0.11 # LGPLv3 mock>=2.0 # BSD # this is required for the docs build jobs -sphinx>=1.6.2 # BSD +sphinx!=1.6.6,!=1.6.7,>=1.6.2,<2.0.0;python_version=='2.7' # BSD +sphinx!=1.6.6,!=1.6.7,>=1.6.2;python_version>='3.4' # BSD openstackdocstheme>=1.17.0 # Apache-2.0 -oslosphinx>=4.7.0 # Apache-2.0 doc8 # Apache-2.0 reno>=1.8.0 # Apache-2.0 sphinxmark>=0.1.14 # Apache-2.0 diff --git a/tox.ini b/tox.ini index a606964..6373cdf 100644 --- a/tox.ini +++ b/tox.ini @@ -25,7 +25,6 @@ commands = coverage run -m pytest --capture=no --strict {posargs} coverage report -m --omit="*/test*" --fail-under=90 -# environment used by the -infra templated docs job [testenv:venv] commands = {posargs} @@ -34,7 +33,7 @@ commands = commands= bash -c "rm -rf doc/build" doc8 doc - python setup.py build_sphinx + sphinx-build -a -E -W -d doc/build/doctrees -b html doc/source doc/build/html [doc8] # Settings for doc8: @@ -64,7 +63,7 @@ deps = flake8-import-order pep8-naming commands = - flake8 . + flake8 [testenv:py3pep8] basepython = python3 @@ -73,7 +72,9 @@ deps = flake8-import-order pep8-naming commands = - flake8 . + flake8 [flake8] -exclude = .tox,*.egg,.git,_build,docs-rst +# tests/common/ansible-lint/test comes from openstack-ansible-tests, +# blacklist it +exclude = .tox,*.egg,.git,_build,docs-rst,tests/common/ansible-lint/test