Update docs building, cleanup

Update docs building and cleanup:
* Switch to sphinx-build
* Update requirements for Sphinx and openstackdocstheme for
  python 3, remove oslosphinx which is dead, create
  doc/requirements.txt file
* Remove unneeded doc and translation sections from setup.cfg
* Remove install_command, it's unneeded, the default is fine.
* Move constraints into deps, use TOX_CONSTRAINTS instead of obsolete
  UPPER_CONSTRAINTS
* Switch to hacking 3.0, fix problems found

Change-Id: If3c5094d7fbdc9033851024c8e3ae364e4768521
This commit is contained in:
Andreas Jaeger 2020-05-03 11:47:04 +02:00
parent fc5ae5e7be
commit 801924705c
8 changed files with 27 additions and 43 deletions

2
doc/requirements.txt Normal file
View File

@ -0,0 +1,2 @@
sphinx>=2.0.0,!=2.1.0 # BSD
openstackdocstheme >=2.0.0 # Apache-2.0

View File

@ -23,9 +23,14 @@ sys.path.insert(0, os.path.abspath('../..'))
extensions = [
'sphinx.ext.autodoc',
#'sphinx.ext.intersphinx',
'oslosphinx'
'openstackdocstheme'
]
# openstackdocstheme options
repository_name = 'openstack/oswin-tempest-plugin'
bug_project = 'os-win'
bug_tag = ''
# autodoc generation is a bit aggressive and a nuisance when doing heavy
# text edit cycles.
# execute "export SPHINX_DEBUG=1" in your terminal to disable
@ -57,6 +62,7 @@ pygments_style = 'sphinx'
# html_theme_path = ["."]
# html_theme = '_theme'
# html_static_path = ['static']
html_theme = 'openstackdocs'
# Output file base name for HTML help builder.
htmlhelp_basename = '%sdoc' % project

View File

@ -33,8 +33,8 @@ def run_wsman_cmd(host, cmd, username, password=None,
url = 'https://%s:5986/wsman' % host
if transport_method == 'ssl':
if not (os.path.exists(cert_pem_path) and
os.path.exists(cert_key_pem_path)):
if not (os.path.exists(cert_pem_path)
and os.path.exists(cert_key_pem_path)):
raise exceptions.WSManException('Could not find certificate path '
'or certificate key path.')

View File

@ -69,8 +69,8 @@ class _LiveMigrateMixin(object):
current_host = admin_server['OS-EXT-SRV-ATTR:host']
block_migration = (CONF.compute_feature_enabled.
block_migration_for_live_migration and
not volume_backed)
block_migration_for_live_migration
and not volume_backed)
self.admin_servers_client.live_migrate_server(
server['id'],

View File

@ -136,8 +136,8 @@ class MetricsCollectionTestCase(test_base.TestBase):
start_res_id = server['id']
resources = self.telemetry_client.list_resources()
res_ids = [r['id'] for r in resources
if r['original_resource_id'].startswith('instance-') and
start_res_id in r['original_resource_id']]
if r['original_resource_id'].startswith('instance-')
and start_res_id in r['original_resource_id']]
self.assertEqual(1, len(res_ids))
return res_ids[0]

View File

@ -5,7 +5,7 @@ description-file =
README.rst
author = Cloudbase Solutions
author-email = info@cloudbasesolutions.com
home-page = https://github.com/openstack/oswin-tempest-plugin
home-page = https://opendev.org/openstack/oswin-tempest-plugin
classifier =
Environment :: OpenStack
Intended Audience :: Information Technology
@ -26,26 +26,3 @@ packages =
[entry_points]
tempest.test_plugins =
oswin_tempest_plugin = oswin_tempest_plugin.plugin:OSWinTempestPlugin
[build_sphinx]
all-files = 1
warning-is-error = 1
source-dir = doc/source
build-dir = doc/build
[upload_sphinx]
upload-dir = doc/build/html
[compile_catalog]
directory = oswin_tempest_plugin/locale
domain = oswin_tempest_plugin
[update_catalog]
domain = oswin_tempest_plugin
output_dir = oswin_tempest_plugin/locale
input_file = oswin_tempest_plugin/locale/oswin_tempest_plugin.pot
[extract_messages]
keywords = _ gettext ngettext l_ lazy_gettext
mapping_file = babel.cfg
output_file = oswin_tempest_plugin/locale/oswin_tempest_plugin.pot

View File

@ -2,13 +2,11 @@
# of appearance. Changing the order has an impact on the overall integration
# process, which may cause wedges in the gate later.
hacking>=1.1.0,<1.2.0 # Apache-2.0
hacking>=3.0.0,<3.1.0 # Apache-2.0
coverage!=4.4,>=4.0 # Apache-2.0
python-subunit>=1.0.0 # Apache-2.0/BSD
sphinx!=1.6.6,>=1.6.2 # BSD
stestr>=2.0.0 # Apache-2.0
oslosphinx>=4.7.0 # Apache-2.0
oslotest>=3.2.0 # Apache-2.0
testscenarios>=0.4 # Apache-2.0/BSD
testtools>=2.2.0 # MIT

19
tox.ini
View File

@ -7,15 +7,13 @@ ignore_basepython_conflict = True
[testenv]
basepython = python3
usedevelop = True
install_command = pip install -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master} {opts} {packages}
setenv =
VIRTUAL_ENV={envdir}
BRANCH_NAME=master
CLIENT_NAME=oswin-tempest-plugin
PYTHONWARNINGS=default::DeprecationWarning
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
deps =
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
commands = stestr run --slowest {posargs}
[testenv:pep8]
@ -28,15 +26,18 @@ commands = {posargs}
commands = python setup.py test --coverage --testr-args='{posargs}'
[testenv:docs]
commands = python setup.py build_sphinx
deps =
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/doc/requirements.txt
commands = sphinx-build -W -b html doc/source doc/build/html
[testenv:debug]
commands = oslo_debug_helper {posargs}
[flake8]
# E123, E125 skipped as they are invalid PEP-8.
# W503 line break before binary operator
show-source = True
ignore = E123,E125
ignore = E123,E125,W503
builtins = _
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build