From 4caa45d00fc615aaec188f1c21d8f5ccddd9e134 Mon Sep 17 00:00:00 2001 From: Andreas Jaeger Date: Mon, 18 May 2020 22:13:55 +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 * Adds version to PDF files Update Sphinx version as well. 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. 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. 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. Add Pygments to fix pep8 failure. See also http://lists.openstack.org/pipermail/openstack-discuss/2020-May/014971.html Change-Id: I964ac70a4ab0b1ff92876e85e3bca21e089480b3 --- README.rst | 12 +++++++++--- doc/requirements.txt | 6 +++--- doc/source/conf.py | 18 ++++-------------- lower-constraints.txt | 1 + releasenotes/source/conf.py | 7 +++---- test-requirements.txt | 1 + 6 files changed, 21 insertions(+), 24 deletions(-) diff --git a/README.rst b/README.rst index 6632dcf..adad8cb 100644 --- a/README.rst +++ b/README.rst @@ -32,15 +32,21 @@ Getting Started .. note:: This is an OpenStack Client plugin. The ``python-openstackclient`` project should be installed to use this plugin. -Octavia client can be installed from PyPI using pip:: +Octavia client can be installed from PyPI using pip + +.. code-block:: bash pip install python-octaviaclient If you want to make changes to the Octavia client for testing and contribution, -make any changes and then run:: +make any changes and then run + +.. code-block:: bash python setup.py develop -or:: +or + +.. code-block:: bash pip install -e . diff --git a/doc/requirements.txt b/doc/requirements.txt index 92e60d0..f60ef19 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -2,11 +2,11 @@ # of appearance. Changing the order has an impact on the overall integration # process, which may cause wedges in the gate later. -sphinx>=1.6.2,!=1.6.6,!=1.6.7,!=2.1.0 # BSD -openstackdocstheme>=1.20.0 # Apache-2.0 +sphinx>=2.0.0,!=2.1.0 # BSD +openstackdocstheme>=2.2.1 # Apache-2.0 # releasenotes -reno>=2.5.0 # Apache-2.0 +reno>=3.1.0 # Apache-2.0 # PDF Docs sphinxcontrib-svg2pdfconverter>=0.1.0 # BSD diff --git a/doc/source/conf.py b/doc/source/conf.py index 752c071..bd7e8a2 100755 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -41,16 +41,6 @@ master_doc = 'index' # General information about the project. copyright = u'2016-2019, 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. -# -# Version info -from octaviaclient.version import version_info as octavia_client_version -release = octavia_client_version.release_string() -# The short X.Y version. -version = octavia_client_version.version_string() - # If true, '()' will be appended to :func: etc. cross-reference text. add_function_parentheses = True @@ -59,12 +49,12 @@ add_function_parentheses = True add_module_names = True # The name of the Pygments (syntax highlighting) style to use. -pygments_style = 'sphinx' +pygments_style = 'native' # openstackdocstheme options -repository_name = 'openstack/python-octaviaclient' -bug_project = '911' -bug_tag = 'doc' +openstackdocs_repo_name = 'openstack/python-octaviaclient' +openstackdocs_pdf_link = True +openstackdocs_use_storyboard = True autoprogram_cliff_application = 'openstack' diff --git a/lower-constraints.txt b/lower-constraints.txt index 6f4fa71..b17d28c 100644 --- a/lower-constraints.txt +++ b/lower-constraints.txt @@ -36,6 +36,7 @@ pep8==1.5.7 positional==1.2.1 pycparser==2.18 pyflakes==0.8.1 +Pygments==2.2.0 pylint==1.9.2 pyOpenSSL==17.1.0 pyperclip==1.5.27 diff --git a/releasenotes/source/conf.py b/releasenotes/source/conf.py index e0c033f..37037fb 100644 --- a/releasenotes/source/conf.py +++ b/releasenotes/source/conf.py @@ -43,9 +43,8 @@ extensions = [ ] # openstackdocstheme options -repository_name = 'openstack/python-octaviaclient' -bug_project = '911' -bug_tag = 'doc' +openstackdocs_repo_name = 'openstack/python-octaviaclient' +openstackdocs_use_storyboard = True # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] @@ -92,7 +91,7 @@ exclude_patterns = [] # 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 = [] diff --git a/test-requirements.txt b/test-requirements.txt index 585a19a..2b52050 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -6,6 +6,7 @@ hacking>=3.0,<3.1.0 # Apache-2.0 requests-mock>=1.2.0 # Apache-2.0 coverage!=4.4,>=4.0 # Apache-2.0 doc8>=0.6.0 # Apache-2.0 +Pygments>=2.2.0 # BSD license bandit!=1.6.0,>=1.1.0 # Apache-2.0 flake8-import-order==0.12 # LGPLv3 pylint>=2.2.0 # GPLv2