[ussuri][goal] Drop python 2.7 support

OpenStack is dropping the py2.7 support in ussuri cycle.

Update and cleanup requrirements.

Change to use openstackdocstheme, oslosphinx does not work with Python
3.
Fix redirect.py for newer sphinx versions, app.builder.info does not
exist anymore.

Remove py27 testing, we'll add py36 testing in followup with fixes for
problems found.

Use modern sphinx-build for building.

Ussuri Communtiy-wide goal:
https://governance.openstack.org/tc/goals/selected/ussuri/drop-py27.html

Co-Authored-By: Andreas Jaeger <aj@suse.com>
Change-Id: Ib467fca6f9033fc331c153ba52a7a292057bb75c
This commit is contained in:
Ghanshyam Mann 2020-02-02 14:23:23 +01:00 committed by Andreas Jaeger
parent 3c7b04aa10
commit 37b99ecd30
6 changed files with 20 additions and 29 deletions

View File

@ -1,9 +1,3 @@
- project:
templates:
- openstack-specs-jobs
check:
jobs:
- openstack-tox-py27
gate:
jobs:
- openstack-tox-py27

View File

@ -5,7 +5,4 @@ sphinx!=1.6.6,!=1.6.7,>=1.6.2 # BSD
sphinxcontrib-apidoc>=0.2.0 # BSD
openstackdocstheme>=1.18.1 # Apache-2.0
reno>=2.5.0 # Apache-2.0
mock>=2.0.0 # BSD
ddt>=1.0.1 # MIT
testtools>=2.2.0 # MIT
tempest>=17.1.0 # Apache-2.0
yasfb>=0.5.1

View File

@ -31,7 +31,7 @@ extensions = ['redirect',
'sphinx.ext.autodoc',
'sphinx.ext.todo',
'sphinx.ext.viewcode',
'oslosphinx',
'openstackdocstheme',
'yasfb',
]
@ -57,6 +57,11 @@ master_doc = 'index'
project = u'Freezer Specs'
copyright = u'%s, OpenStack Freezer Team' % datetime.date.today().year
# openstackdocstheme options
repository_name = 'openstack/freezer-specs'
use_storyboard = True
html_theme = 'openstackdocs'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#language = None
@ -100,7 +105,7 @@ man_pages = []
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
html_theme = 'nature'
# html_theme = 'nature'
# 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
@ -126,11 +131,6 @@ html_theme = 'nature'
# pixels large.
#html_favicon = None
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.
git_cmd = "git log --pretty=format:'%ad, commit %h' --date=local -n1"
html_last_updated_fmt = os.popen(git_cmd).read()
# If true, SmartyPants will be used to convert quotes and dashes to
# typographically correct entities.
#html_use_smartypants = True

View File

@ -6,9 +6,12 @@
import os.path
from sphinx.application import ENV_PICKLE_FILENAME
from sphinx.util import logging
from sphinx.util.console import bold
LOG = logging.getLogger(__name__)
def setup(app):
from sphinx.application import Sphinx
if not isinstance(app, Sphinx):
@ -35,7 +38,7 @@ def process_redirect_file(app, path, ent):
def emit_redirects(app, exc):
app.builder.info(bold('scanning %s for redirects...') % app.builder.srcdir)
LOG.info(bold('scanning %s for redirects...') % app.builder.srcdir)
def process_directory(path):
for ent in os.listdir(path):
@ -43,8 +46,8 @@ def emit_redirects(app, exc):
if os.path.isdir(p):
process_directory(p)
elif ent == 'redirects':
app.builder.info(' found redirects at %s' % p)
LOG.info(' found redirects at %s' % p)
process_redirect_file(app, path, ent)
process_directory(app.builder.srcdir)
app.builder.info('...done')
LOG.info('...done')

View File

@ -1,6 +1,4 @@
oslosphinx>=4.7.0 # Apache-2.0
pbr>=1.8 # Apache-2.0
sphinx>=1.2.1,!=1.3b1,<1.4 # BSD
docutils
stestr>=2.0.0 # Apache-2.0
testtools>=1.4.0 # MIT
yasfb>=0.5.1

11
tox.ini
View File

@ -1,9 +1,11 @@
[tox]
minversion = 2.0
envlist = docs,py27,pep8
minversion = 3.1.1
envlist = docs,pep8,py36
skipsdist = True
ignore_basepython_conflict = True
[testenv]
basepython = python3
usedevelop = True
setenv = VIRTUAL_ENV={envdir}
install_command = pip install -U {opts} {packages}
@ -14,18 +16,15 @@ commands =
stestr run --slowest {posargs}
[testenv:venv]
basepython = python3
commands = {posargs}
[testenv:docs]
basepython = python3
deps = -r{toxinidir}/doc/requirements.txt
commands =
find . -type f -name "*.pyc" -delete
python setup.py build_sphinx
sphinx-build -b html doc/source doc/build/html
[testenv:pep8]
basepython = python3
deps = -r{toxinidir}/test-requirements.txt
commands =
flake8 {posargs}