From 7bf7619104a832f8d46861b3a6de3d59714b7f4d Mon Sep 17 00:00:00 2001 From: Gage Hugo Date: Wed, 1 Mar 2017 12:04:14 -0600 Subject: [PATCH] Remove pbr warnerrors in favor of sphinx check This change removes the soon-to-be unused "warnerrors" setting, which will be replaced by "warning-is-error" in sphinx releases >= 1.5.[0] This also pre-emptively fixes most warnings that came up when testing with sphinx >= 1.5: - Multiple cases of Opts - Redundant loading of todo extension Added a comment to not to enable the new sphinx setting until the issues with Changlog building are fixed. Added setup.py to the list of files to ignore when building docs. [0] http://lists.openstack.org/pipermail/openstack-dev/2017-March/113085.html Change-Id: Ia0079c6b551dd3896bc3d922a477f927757bd61b --- doc/source/conf.py | 1 - doc/source/migrating.rst | 2 +- keystoneauth1/extras/oauth1/__init__.py | 2 +- keystoneauth1/loading/opts.py | 5 +++-- setup.cfg | 9 ++++++++- tox.ini | 4 ++++ 6 files changed, 17 insertions(+), 6 deletions(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index 54ffb733..5b6c7361 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -38,7 +38,6 @@ sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), # extensions # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. extensions = ['sphinx.ext.autodoc', - 'sphinx.ext.todo', 'sphinx.ext.coverage', 'sphinx.ext.intersphinx', 'oslosphinx', diff --git a/doc/source/migrating.rst b/doc/source/migrating.rst index 6881b3ff..1e97c866 100644 --- a/doc/source/migrating.rst +++ b/doc/source/migrating.rst @@ -27,7 +27,7 @@ Authentication plugins still implement the base authentication class :py:class:`~keystoneauth1.plugin.BaseAuthPlugin`. To make the plugins capable of being loaded from CLI or CONF file you should implement the base :py:class:`~keystoneauth1.loading.BaseLoader` class which is loaded when -:option:`--os-auth-type` is used. This class handles the options that are +`--os-auth-type` is used. This class handles the options that are presented, and then constructs the authentication plugin for use by the application. diff --git a/keystoneauth1/extras/oauth1/__init__.py b/keystoneauth1/extras/oauth1/__init__.py index a519edd4..e267446a 100644 --- a/keystoneauth1/extras/oauth1/__init__.py +++ b/keystoneauth1/extras/oauth1/__init__.py @@ -12,7 +12,7 @@ from keystoneauth1.extras.oauth1 import v3 -__all__ = ('V3OAuth1Method', 'V3OAuth') +__all__ = ('V3OAuth1Method', 'V3OAuth1') V3OAuth1Method = v3.OAuth1Method diff --git a/keystoneauth1/loading/opts.py b/keystoneauth1/loading/opts.py index b8f17590..03eed845 100644 --- a/keystoneauth1/loading/opts.py +++ b/keystoneauth1/loading/opts.py @@ -50,8 +50,9 @@ class Opt(object): :param str dest: the name of the argument that will be passed to __init__. This allows you to have a different name in loading than is used by the __init__ function. Defaults to the value of name. - :param opt: A list of other options that are deprecated in favour of this - one. This ensures the old options are still registered. + :param keystoneauth1.loading.Opt: A list of other options that are + deprecated in favour of this one. This ensures the old options are + still registered. :type opt: list(Opt) :param default: A default value that can be used if one is not provided. :param str metavar: The that should be printed in CLI help text. diff --git a/setup.cfg b/setup.cfg index c285745b..0b19c6a7 100644 --- a/setup.cfg +++ b/setup.cfg @@ -59,10 +59,17 @@ keystoneauth1.plugin = source-dir = doc/source build-dir = doc/build all_files = 1 +# NOTE(gagehugo): Sphinx currently reads the Changelog in order +# to create the appropriate page, and this causes warnings to be thrown +# which causes the below setting to treat them as errors and fail. +# Once change 439897 merges (or something else is +# done to fix this issue) the below setting can be uncommented +# to allow sphinx warnings to be considered errors. +#warning-is-error = 1 [pbr] -warnerrors = True autodoc_tree_index_modules = True +autodoc_tree_excludes = setup.py [upload_sphinx] upload-dir = doc/build/html diff --git a/tox.ini b/tox.ini index 3a9d0f6e..b51de021 100644 --- a/tox.ini +++ b/tox.ini @@ -16,6 +16,8 @@ deps = -r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt .[kerberos,saml2,betamax,oauth1] commands = ostestr {posargs} +whitelist_externals = + bash [testenv:pep8] commands = @@ -52,6 +54,8 @@ exclude = .venv,.tox,dist,doc,*egg,build [testenv:docs] commands= + bash -c "rm -rf doc/build" + bash -c "rm -rf doc/source/api" python setup.py build_sphinx [testenv:releasenotes]