Switch to current docs tools

Update repo to use current Sphinx and openstackdocstheme versions:
* update requirements
* update conf.py to correctly set variables
* update tox.ini to use python3

Change-Id: I44d41c3d78dfddf325ef7c65a8e1c9a1ddf96094
This commit is contained in:
Andreas Jaeger 2019-10-25 09:16:39 +02:00
parent 7f618a4dff
commit 4950df7899
3 changed files with 21 additions and 38 deletions

View File

@ -22,8 +22,6 @@
import os import os
import openstackdocstheme
# If extensions (or modules to document with autodoc) are in another directory, # If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the # add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here. # documentation root, use os.path.abspath to make it absolute, like shown here.
@ -38,7 +36,7 @@ import openstackdocstheme
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones. # ones.
# TODO(ajaeger): enable PDF building, for example add 'rst2pdf.pdfbuilder' # TODO(ajaeger): enable PDF building, for example add 'rst2pdf.pdfbuilder'
# extensions = extensions = ['openstackdocstheme']
# Add any paths that contain templates here, relative to this directory. # Add any paths that contain templates here, relative to this directory.
# templates_path = ['_templates'] # templates_path = ['_templates']
@ -53,28 +51,21 @@ source_suffix = '.rst'
master_doc = 'index' master_doc = 'index'
# General information about the project. # General information about the project.
project = u'OpenStack Charms Deployment Guide'
bug_tag = u'deployment-guide'
copyright = u'2016, OpenStack contributors' copyright = u'2016, OpenStack contributors'
# Settings for openstackdocstheme
repository_name = 'openstack/charm-deployment-guide'
bug_project = 'charm-deployment-guide'
bug_tag = u'deployment-guide'
# The version info for the project you're documenting, acts as replacement for # The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the # |version| and |release|, also used in various other places throughout the
# built documents. # built documents.
# #
# The short X.Y version. # The short X.Y version.
version = '0.1' version = ''
# The full version, including alpha/beta/rc tags. # The full version, including alpha/beta/rc tags.
release = '0.1' release = ''
# 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')
html_context = {"gitsha": gitsha, "bug_tag": bug_tag,
"bug_project": "charm-deployment-guide"}
# The language for content autogenerated by Sphinx. Refer to documentation # The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages. # for a list of supported languages.
@ -127,7 +118,7 @@ html_theme = 'openstackdocs'
# html_theme_options = {} # html_theme_options = {}
# Add any paths that contain custom themes here, relative to this directory. # Add any paths that contain custom themes here, relative to this directory.
html_theme_path = [openstackdocstheme.get_html_theme_path()] # html_theme_path = [openstackdocstheme.get_html_theme_path()]
# The name for this set of Sphinx documents. If None, it defaults to # The name for this set of Sphinx documents. If None, it defaults to
# "<project> v<release> documentation". # "<project> v<release> documentation".
@ -160,7 +151,7 @@ html_theme_path = [openstackdocstheme.get_html_theme_path()]
# So that we can enable "log-a-bug" links from each output HTML page, this # So that we can enable "log-a-bug" links from each output HTML page, this
# variable must be set to a format that includes year, month, day, hours and # variable must be set to a format that includes year, month, day, hours and
# minutes. # minutes.
html_last_updated_fmt = '%Y-%m-%d %H:%M' # html_last_updated_fmt = '%Y-%m-%d %H:%M'
# If true, SmartyPants will be used to convert quotes and dashes to # If true, SmartyPants will be used to convert quotes and dashes to
@ -201,24 +192,13 @@ html_show_sourcelink = False
# html_file_suffix = None # html_file_suffix = None
# Output file base name for HTML help builder. # Output file base name for HTML help builder.
htmlhelp_basename = 'install-guide' htmlhelp_basename = 'deploy-guide'
# If true, publish source files # If true, publish source files
html_copy_source = False html_copy_source = False
# -- Options for LaTeX output --------------------------------------------- # -- Options for LaTeX output ---------------------------------------------
latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
# 'papersize': 'letterpaper',
# The font size ('10pt', '11pt' or '12pt').
# 'pointsize': '10pt',
# Additional stuff for the LaTeX preamble.
# 'preamble': '',
}
# Grouping the document tree into LaTeX files. List of tuples # Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, # (source start file, target name, title,
# author, documentclass [howto, manual, or own class]). # author, documentclass [howto, manual, or own class]).

View File

@ -1,3 +1,9 @@
sphinx>=1.1.2,!=1.2.0,!=1.3b1,<1.3 # BSD # The order of packages is significant, because pip processes them in the order
pbr>=1.6 # Apache-2.0 # of appearance. Changing the order has an impact on the overall integration
openstackdocstheme>=1.5.0,<1.18.0 # Apache-2.0 # process, which may cause wedges in the gate later.
pbr!=2.1.0,>=2.0.0 # Apache-2.0
sphinx>=1.8.0,<2.0.0;python_version=='2.7' # BSD
sphinx>=1.8.0,!=2.1.0;python_version>='3.4' # BSD
openstackdocstheme>=1.30.0 # Apache-2.0

View File

@ -4,14 +4,11 @@ envlist = deploy-guide
skipsdist = True skipsdist = True
[testenv] [testenv]
basepython = python2.7 basepython = python3
usedevelop = True usedevelop = True
setenv = VIRTUAL_ENV={envdir}
install_command = pip install -U {opts} {packages}
deps = -r{toxinidir}/requirements.txt deps = -r{toxinidir}/requirements.txt
[testenv:venv] [testenv:venv]
basepython = python3
commands = {posargs} commands = {posargs}
[testenv:deploy-guide] [testenv:deploy-guide]