From 8cb61b9a61f95e06e9ea52cbd1fee5d940787505 Mon Sep 17 00:00:00 2001 From: Andreas Jaeger Date: Sat, 11 Apr 2020 14:51:43 +0200 Subject: [PATCH] Cleanup py27 support for docs This repo is now testing only with Python 3, so let's make a few cleanups: - Remove python 2.7 stanza from setup.py - Remove obsolete sections from setup.cfg - Update requirements, no need for python_version anymore - Cleanup */source/conf.py to remove now obsolete content. - Use newer openstackdocstheme version Change-Id: I5f6aabc271e21fe8edbf2aadd2f78f8bdc407e80 --- deploy-guide/source/conf.py | 36 +++++++----------------------------- doc/requirements.txt | 5 ++--- doc/source/conf.py | 13 ------------- setup.cfg | 12 ------------ setup.py | 9 --------- 5 files changed, 9 insertions(+), 66 deletions(-) diff --git a/deploy-guide/source/conf.py b/deploy-guide/source/conf.py index af3fdd5..d679138 100644 --- a/deploy-guide/source/conf.py +++ b/deploy-guide/source/conf.py @@ -21,10 +21,6 @@ # serve to show the default. import os -# import sys - - -import openstackdocstheme # 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 @@ -40,7 +36,11 @@ import openstackdocstheme # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. # TODO(ajaeger): enable PDF building, for example add 'rst2pdf.pdfbuilder' -# extensions = + +extensions = [ + 'openstackdocstheme' +] + # Add any paths that contain templates here, relative to this directory. # templates_path = ['_templates'] @@ -56,6 +56,8 @@ master_doc = 'index' # General information about the project. project = u'Deployment Guide for OpenStack Chef Cookbooks' +repository_name = 'openstack/openstack-chef' +bug_project = 'openstack-chef' bug_tag = u'deploy-guide' copyright = u'2019, OpenStack contributors' @@ -68,19 +70,6 @@ version = '0.1' # The full version, including alpha/beta/rc tags. release = '0.1' -# A few variables have to be set for the log-a-bug feature. -# giturl: The location of conf.py on Git. Must be set manually. -# 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. -giturl = u'https://opendev.org/cgit/openstack/openstack-chef/tree/deploy-guide/source' # noqa -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, - "giturl": giturl, - "bug_project": "openstack-chef"} - # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. # language = None @@ -131,9 +120,6 @@ html_theme = 'openstackdocs' # documentation. # html_theme_options = {} -# Add any paths that contain custom themes here, relative to this directory. -html_theme_path = [openstackdocstheme.get_html_theme_path()] - # The name for this set of Sphinx documents. If None, it defaults to # " v documentation". # html_title = None @@ -160,14 +146,6 @@ html_theme_path = [openstackdocstheme.get_html_theme_path()] # directly to the root of the documentation. # html_extra_path = [] -# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, -# using the given strftime format. -# 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 -# minutes. -html_last_updated_fmt = '%Y-%m-%d %H:%M' - - # If true, SmartyPants will be used to convert quotes and dashes to # typographically correct entities. # html_use_smartypants = True diff --git a/doc/requirements.txt b/doc/requirements.txt index af5d87b..b1ff253 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -3,7 +3,6 @@ # process, which may cause wedges in the gate later. # this is required for the docs build jobs -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.18.1 # Apache-2.0 +sphinx>=1.8.0,!=2.1.0 # BSD +openstackdocstheme>=1.31.2 # Apache-2.0 reno>=2.5.0 # Apache-2.0 diff --git a/doc/source/conf.py b/doc/source/conf.py index 39c0195..ccd313b 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -7,15 +7,6 @@ # full list see the documentation: # http://www.sphinx-doc.org/en/stable/config.html -# -- Path setup -------------------------------------------------------------- - -import imp -import os -import re -import sys - -import openstackdocstheme - # -- Chef OpenStack configuration -------------------------------------------- target_name = 'openstack-chef' description = 'Chef OpenStack uses Chef to deploy OpenStack environments.' @@ -97,10 +88,6 @@ html_static_path = ['_static'] # directly to the root of the documentation. # html_extra_path = [] -# 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' - # 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 # documentation. diff --git a/setup.cfg b/setup.cfg index 5e89cc5..79a4ee5 100644 --- a/setup.cfg +++ b/setup.cfg @@ -11,15 +11,3 @@ classifier = Intended Audience :: System Administrators License :: OSI Approved :: Apache Software License Operating System :: POSIX :: Linux - -[build_sphinx] -all_files = 1 -build-dir = doc/build -source-dir = doc/source -warning-is-error = 1 - -[pbr] -warnerrors = True - -[wheel] -universal = 1 diff --git a/setup.py b/setup.py index 2f790e9..ccaf7d8 100644 --- a/setup.py +++ b/setup.py @@ -13,17 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -# THIS FILE IS MANAGED BY THE GLOBAL REQUIREMENTS REPO - DO NOT EDIT 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( setup_requires=['pbr>=2.0.0'], pbr=True)