Update docs building

Several reorgs:
* setup.cfg/setup.py must be in top-level dir so that siblings
  (installing for example openstackdocstheme from source instead of
  pip) works.
* Update openstackdocstheme version (see below)
* Remove unused entries from setup.cfg
* Remove py27 code from setup.py
* Update tox.ini for a py3 only world and cleanup

Switch to openstackdocstheme 2.2.1 version. Using
this version will allow especially:
* Linking from HTML to PDF document
* Allow parallel building of documents
* Fix some rendering problems

Update Sphinx version as well.

Disable openstackdocs_auto_name 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.

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: I27039f9dc52c3e6c9e667b5699172d0f834e8f6b
This commit is contained in:
Andreas Jaeger 2020-06-04 13:29:55 +02:00
parent c2326a2afa
commit b8cfb53f19
6 changed files with 19 additions and 56 deletions

View File

@ -41,10 +41,11 @@ source_suffix = '.rst'
master_doc = 'index' master_doc = 'index'
# General information about the project. # General information about the project.
repository_name = 'openstack/stx-docs' openstackdocs_repo_name = 'openstack/stx-docs'
project = u'StarlingX' openstackdocs_project = 'StarlingX'
bug_project = 'starlingx' openstackdocs_auto_name = False
bug_tag = 'stx.docs' openstackdocs_bug_project = 'starlingx'
openstackdocs_bug_tag = 'stx.docs'
# If true, the current module name will be prepended to all description # If true, the current module name will be prepended to all description
# unit titles (such as .. function::). # unit titles (such as .. function::).
@ -55,7 +56,7 @@ add_module_names = False
show_authors = False show_authors = False
# The name of the Pygments (syntax highlighting) style to use. # The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx' pygments_style = 'native'
# 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, author, documentclass # (source start file, target name, title, author, documentclass

View File

@ -1,6 +1,5 @@
openstack-doc-tools>=1.6.0 sphinx>=2.0.0,!=2.1.0
sphinx>=1.6.2 openstackdocstheme>=2.2.1 # Apache-2.0
openstackdocstheme>=1.26.0 # Apache-2.0
# API Reference Guide # API Reference Guide
os-api-ref>=1.4.0 # Apache-2.0 os-api-ref>=1.5.0 # Apache-2.0

View File

@ -6,8 +6,6 @@
# full list see the documentation: # full list see the documentation:
# http://www.sphinx-doc.org/en/master/config # http://www.sphinx-doc.org/en/master/config
import pbr.version
# -- Path setup -------------------------------------------------------------- # -- Path setup --------------------------------------------------------------
# If extensions (or modules to document with autodoc) are in another directory, # If extensions (or modules to document with autodoc) are in another directory,
@ -25,17 +23,6 @@ project = u'StarlingX'
copyright = '2018, StarlingX' copyright = '2018, StarlingX'
author = 'StarlingX' author = 'StarlingX'
# 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.
#
version_info = pbr.version.VersionInfo('python-openstackclient')
# The short X.Y version.
version = ''
# The full version, including alpha/beta/rc tags.
release = ''
# -- General configuration --------------------------------------------------- # -- General configuration ---------------------------------------------------
@ -77,6 +64,12 @@ exclude_patterns = []
# The name of the Pygments (syntax highlighting) style to use. # The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx' pygments_style = 'sphinx'
# General information about the project.
openstackdocs_repo_name = 'openstack/stx-docs'
openstackdocs_project = 'StarlingX'
openstackdocs_auto_name = False
openstackdocs_bug_project = 'starlingx'
openstackdocs_bug_tag = 'stx.docs'
# -- Options for HTML output ------------------------------------------------- # -- Options for HTML output -------------------------------------------------

View File

@ -1,5 +1,6 @@
[metadata] [metadata]
summary = StarlingX Documentation summary = StarlingX Documentation
name = docs
author = StarlingX author = StarlingX
author-email = starlingx-discuss@lists.starlingx.io author-email = starlingx-discuss@lists.starlingx.io
home-page = https://starlingx.io home-page = https://starlingx.io
@ -9,20 +10,3 @@ Intended Audience :: Information Technology
License :: OSI Approved :: Apache Software License License :: OSI Approved :: Apache Software License
Operating System :: POSIX :: Linux Operating System :: POSIX :: Linux
Topic :: Documentation Topic :: Documentation
[global]
setup-hooks =
pbr.hooks.setup_hook
[files]
[build_sphinx]
all_files = 1
build-dir = build
source-dir = source
[wheel]
universal = 1
[pbr]
warnerrors = True

View File

@ -13,17 +13,8 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
# THIS FILE IS MANAGED BY THE GLOBAL REQUIREMENTS REPO - DO NOT EDIT
import setuptools import setuptools
# In python < 2.7.4, a lazy loading of package `pbr` will break
# setuptools if some other modules registered functions in `atexit`.
# solution from: http://bugs.python.org/issue15881#msg170215
try:
import multiprocessing # noqa
except ImportError:
pass
setuptools.setup( setuptools.setup(
setup_requires=['pbr'], setup_requires=['pbr'],
pbr=True) pbr=True)

11
tox.ini
View File

@ -4,7 +4,7 @@ minversion = 2.3
skipsdist = True skipsdist = True
[testenv] [testenv]
install_command = pip install -U {opts} {packages} basepython = python3
setenv = VIRTUAL_ENV={envdir} setenv = VIRTUAL_ENV={envdir}
OS_STDOUT_CAPTURE=1 OS_STDOUT_CAPTURE=1
OS_STDERR_CAPTURE=1 OS_STDERR_CAPTURE=1
@ -12,24 +12,20 @@ setenv = VIRTUAL_ENV={envdir}
deps = -r{toxinidir}/test-requirements.txt deps = -r{toxinidir}/test-requirements.txt
[testenv:docs] [testenv:docs]
basepython = python3
deps = deps =
-c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/doc/requirements.txt -r{toxinidir}/doc/requirements.txt
commands = commands =
sphinx-build -a -E -W -d doc/build/doctrees -b html doc/source doc/build/html sphinx-build -a -E -W -d doc/build/doctrees -b html doc/source doc/build/html
[testenv:api-ref] [testenv:api-ref]
basepython = python3 deps = {[testenv:docs]deps}
deps =
-r{toxinidir}/doc/requirements.txt
commands = commands =
rm -rf api-ref/build rm -rf api-ref/build
sphinx-build -W -b html -d api-ref/build/doctrees api-ref/source api-ref/build/html sphinx-build -W -b html -d api-ref/build/doctrees api-ref/source api-ref/build/html
whitelist_externals = rm whitelist_externals = rm
[testenv:linters] [testenv:linters]
basepython = python3
whitelist_externals = bash whitelist_externals = bash
commands = commands =
bash -c "find {toxinidir} \ bash -c "find {toxinidir} \
@ -38,5 +34,4 @@ commands =
-print0 | xargs -0 yamllint" -print0 | xargs -0 yamllint"
[testenv:venv] [testenv:venv]
basepython = python3
commands = {posargs} commands = {posargs}