From 1ff940598f6a61452f867cd0c5ec4b92e50ccb9b Mon Sep 17 00:00:00 2001 From: Andreas Jaeger Date: Thu, 21 May 2020 10:37:37 +0200 Subject: [PATCH] Switch to newer openstackdocstheme and reno versions Switch to openstackdocstheme 2.2.1 and reno 3.1.0 versions. Using these versions will allow especially: * Linking from HTML to PDF document * Allow parallel building of documents * Fix some rendering problems Update Sphinx version as well. Set openstackdocs_pdf_link to link to PDF file. Note that the link to the published document only works on docs.openstack.org where the PDF file is placed in the top-level html directory. The site-preview places the PDF in a pdf directory. Set openstackdocs_auto_name to False to use 'project' variable as name. Change pygments_style to 'native' since old theme version always used 'native' and the theme now respects the setting and using 'sphinx' can lead to some strange rendering. Remove docs requirements from lower-constraints, they are not needed during install or test but only for docs building. openstackdocstheme renames some variables, so follow the renames before the next release removes them. A couple of variables are also not needed anymore, remove them. See also http://lists.openstack.org/pipermail/openstack-discuss/2020-May/014971.html Change-Id: Ia9a3fb804fb59bb70edc150a3eb20c07a279170b --- api-ref/source/conf.py | 25 +++++-------------------- doc/requirements.txt | 6 +++--- doc/source/conf.py | 24 +++++++----------------- lower-constraints.txt | 6 ------ releasenotes/source/conf.py | 7 +++++-- 5 files changed, 20 insertions(+), 48 deletions(-) diff --git a/api-ref/source/conf.py b/api-ref/source/conf.py index 0722c2787..8d45f2715 100644 --- a/api-ref/source/conf.py +++ b/api-ref/source/conf.py @@ -22,9 +22,6 @@ # All configuration values have a default; values that are commented out # serve to show the default. -from watcher import version as watcher_version - - extensions = [ 'openstackdocstheme', 'os_api_ref', @@ -46,21 +43,13 @@ project = u'Infrastructure Optimization API Reference' copyright = u'2010-present, OpenStack Foundation' # openstackdocstheme options -repository_name = 'openstack/watcher' -bug_project = 'watcher' -bug_tag = '' - -# 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. -# -# The full version, including alpha/beta/rc tags. -release = watcher_version.version_info.release_string() -# The short X.Y version. -version = watcher_version.version_string +openstackdocs_repo_name = 'openstack/watcher' +openstackdocs_auto_name = False +openstackdocs_bug_project = 'watcher' +openstackdocs_bug_tag = '' # The name of the Pygments (syntax highlighting) style to use. -pygments_style = 'sphinx' +pygments_style = 'native' # -- Options for HTML output -------------------------------------------------- @@ -75,10 +64,6 @@ html_theme_options = { "sidebar_mode": "toc", } -# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, -# using the given strftime format. -html_last_updated_fmt = '%Y-%m-%d %H:%M' - # -- Options for LaTeX output ------------------------------------------------- # Grouping the document tree into LaTeX files. List of tuples diff --git a/doc/requirements.txt b/doc/requirements.txt index 390866099..9fdc9fb72 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -1,10 +1,10 @@ # 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.20.0 # Apache-2.0 -sphinx>=1.8.0,!=2.1.0,!=3.0.0 # BSD +openstackdocstheme>=2.2.1 # Apache-2.0 +sphinx>=2.0.0,!=2.1.0 # BSD sphinxcontrib-pecanwsme>=0.8.0 # Apache-2.0 sphinxcontrib-svg2pdfconverter>=0.1.0 # BSD -reno>=2.7.0 # Apache-2.0 +reno>=3.1.0 # Apache-2.0 sphinxcontrib-apidoc>=0.2.0 # BSD os-api-ref>=1.4.0 # Apache-2.0 diff --git a/doc/source/conf.py b/doc/source/conf.py index 0c4aa2f60..260925e4b 100755 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -14,7 +14,6 @@ import os import sys -from watcher import version as watcher_version from watcher import objects objects.register_all() @@ -60,16 +59,6 @@ master_doc = 'index' project = u'Watcher' copyright = u'OpenStack Foundation' -# 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. -# -# The short X.Y version. -# The full version, including alpha/beta/rc tags. -release = watcher_version.version_info.release_string() -# The short X.Y version. -version = watcher_version.version_string - # A list of ignored prefixes for module index sorting. modindex_common_prefix = ['watcher.'] @@ -94,7 +83,7 @@ add_module_names = True suppress_warnings = ['app.add_directive'] # The name of the Pygments (syntax highlighting) style to use. -pygments_style = 'sphinx' +pygments_style = 'native' # -- Options for man page output -------------------------------------------- @@ -125,12 +114,13 @@ html_theme = 'openstackdocs' # Output file base name for HTML help builder. htmlhelp_basename = '%sdoc' % project -html_last_updated_fmt = '%Y-%m-%d %H:%M' #openstackdocstheme options -repository_name = 'openstack/watcher' -bug_project = 'watcher' -bug_tag = '' +openstackdocs_repo_name = 'openstack/watcher' +openstackdocs_pdf_link = True +openstackdocs_auto_name = False +openstackdocs_bug_project = 'watcher' +openstackdocs_bug_tag = '' # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, author, documentclass @@ -138,7 +128,7 @@ bug_tag = '' latex_documents = [ ('index', 'doc-watcher.tex', - u'%s Documentation' % project, + u'Watcher Documentation', u'OpenStack Foundation', 'manual'), ] diff --git a/lower-constraints.txt b/lower-constraints.txt index 526f6df4d..19e422872 100644 --- a/lower-constraints.txt +++ b/lower-constraints.txt @@ -61,7 +61,6 @@ munch==2.2.0 netaddr==0.7.19 netifaces==0.10.6 networkx==2.2 -openstackdocstheme==1.20.0 openstacksdk==0.12.0 os-api-ref===1.4.0 os-client-config==1.29.0 @@ -117,7 +116,6 @@ python-openstackclient==3.14.0 python-subunit==1.2.0 pytz==2018.3 PyYAML==3.12 -reno==2.7.0 repoze.lru==0.7 requests==2.18.4 requestsexceptions==1.4.0 @@ -128,10 +126,6 @@ simplegeneric==0.8.1 simplejson==3.13.2 smmap2==2.0.3 snowballstemmer==1.2.1 -Sphinx==1.6.5 -sphinxcontrib-httpdomain==1.6.1 -sphinxcontrib-pecanwsme==0.8.0 -sphinxcontrib-websupport==1.0.1 SQLAlchemy==1.2.5 sqlalchemy-migrate==0.11.0 sqlparse==0.2.4 diff --git a/releasenotes/source/conf.py b/releasenotes/source/conf.py index 67c9b941a..105b15d47 100644 --- a/releasenotes/source/conf.py +++ b/releasenotes/source/conf.py @@ -53,7 +53,6 @@ source_suffix = '.rst' master_doc = 'index' # General information about the project. -project = u'watcher' copyright = u'2016, Watcher developers' # Release notes are version independent @@ -91,11 +90,15 @@ exclude_patterns = ['_build'] #show_authors = False # The name of the Pygments (syntax highlighting) style to use. -pygments_style = 'sphinx' +pygments_style = 'native' # A list of ignored prefixes for module index sorting. #modindex_common_prefix = [] +# openstackdocstheme options +openstackdocs_repo_name = 'openstack/watcher' +openstackdocs_bug_project = 'watcher' +openstackdocs_bug_tag = '' # -- Options for HTML output --------------------------------------------------