Fix doc job, pep8 error and remove py27

This commit does multiple fix
1. Doc building still use deprcated oslosphinx and incompatible
version of yasfb which lead to error-

sphinx.errors.ExtensionError: Could not import extension yasfb (exception: cannot import name 'logging')

Replace oslosphinx with openstackdocstheme to fix the error.

2. Switch py27 job with py37
3. fix the pep8 error

Change-Id: I33ad4d0a2924082b7c56ac7c7973ad02ac6e9df5
This commit is contained in:
Ghanshyam Mann 2019-12-13 22:47:51 +00:00
parent f6f0864bfa
commit 7aa078296c
5 changed files with 11 additions and 14 deletions

View File

@ -3,7 +3,7 @@
- openstack-specs-jobs - openstack-specs-jobs
check: check:
jobs: jobs:
- openstack-tox-py27 - openstack-tox-py37
gate: gate:
jobs: jobs:
- openstack-tox-py27 - openstack-tox-py37

View File

@ -23,7 +23,7 @@ sys.path.insert(0, os.path.abspath('../..'))
extensions = [ extensions = [
'sphinx.ext.autodoc', 'sphinx.ext.autodoc',
#'sphinx.ext.intersphinx', #'sphinx.ext.intersphinx',
'oslosphinx', 'openstackdocstheme',
'yasfb', 'yasfb',
] ]
@ -75,7 +75,7 @@ pygments_style = 'sphinx'
# html_theme_path = ["."] # html_theme_path = ["."]
# html_theme = '_theme' # html_theme = '_theme'
# html_static_path = ['static'] # html_static_path = ['static']
html_theme_options = {} html_theme = "openstackdocs"
# Output file base name for HTML help builder. # Output file base name for HTML help builder.
htmlhelp_basename = '%sdoc' % project htmlhelp_basename = '%sdoc' % project

View File

@ -1,7 +1,7 @@
pbr>=0.6,<1.0 pbr>=0.6,<1.0
oslosphinx>=2.2.0.0a2 openstackdocstheme
sphinx>=1.1.2,<1.2 sphinx!=1.6.6,!=1.6.7,!=2.1.0,>=1.6.2;python_version>='3.4' # BSD
yasfb>=0.5.1 yasfb>=0.8.0
testrepository>=0.0.18 testrepository>=0.0.18
testtools>=0.9.34 testtools>=0.9.34
stestr>=2.0.0 stestr>=2.0.0

View File

@ -41,7 +41,7 @@ class TestTitles(testtools.TestCase):
def _check_titles(self, spec, titles): def _check_titles(self, spec, titles):
self.assertTrue(len(titles) >= 4, self.assertTrue(len(titles) >= 4,
"Titles count in '%s' doesn't match expected" % spec) "Titles count in '%s' doesn't match expected" % spec)
problem = 'Problem description' problem = 'Problem description'
driver = 'Driver description' driver = 'Driver description'
self.assertTrue(problem in titles or driver in titles) self.assertTrue(problem in titles or driver in titles)
@ -84,7 +84,7 @@ class TestTitles(testtools.TestCase):
def test_template(self): def test_template(self):
# NOTE (e0ne): adding 'template.rst' to ignore dirs to exclude it from # NOTE (e0ne): adding 'template.rst' to ignore dirs to exclude it from
# os.listdir output # os.listdir output
ignored_dirs = {'template.rst', 'api',} ignored_dirs = {'template.rst', 'api'}
files = ['specs/template.rst'] files = ['specs/template.rst']

View File

@ -1,9 +1,10 @@
[tox] [tox]
minversion = 1.6 minversion = 1.6
envlist = docs,py27,pep8 envlist = docs,pep8
skipsdist = True skipsdist = True
[testenv] [testenv]
basepython = python3
usedevelop = True usedevelop = True
install_command = pip install -U {opts} {packages} install_command = pip install -U {opts} {packages}
setenv = setenv =
@ -13,11 +14,9 @@ deps = -r{toxinidir}/requirements.txt
commands = stestr run --slowest {posargs} commands = stestr run --slowest {posargs}
[testenv:venv] [testenv:venv]
basepython = python3
commands = {posargs} commands = {posargs}
[testenv:docs] [testenv:docs]
basepython = python3
commands = python setup.py build_sphinx commands = python setup.py build_sphinx
[testenv:spelling] [testenv:spelling]
@ -28,7 +27,6 @@ deps =
commands = sphinx-build -b spelling doc/source doc/build/spelling commands = sphinx-build -b spelling doc/source doc/build/spelling
[testenv:cover] [testenv:cover]
basepython = python3
setenv = setenv =
PYTHON=coverage run --source specs --parallel-mode PYTHON=coverage run --source specs --parallel-mode
commands = commands =
@ -38,7 +36,6 @@ commands =
coverage xml -o cover/coverage.xml coverage xml -o cover/coverage.xml
[testenv:pep8] [testenv:pep8]
basepython = python3
commands = flake8 commands = flake8
[flake8] [flake8]