From 32d23459dc34d0d99a0a12f36036373221f61689 Mon Sep 17 00:00:00 2001 From: Stephen Finucane Date: Thu, 16 Mar 2017 14:42:17 +0000 Subject: [PATCH] Use Sphinx 1.5 warning-is-error With pbr 2.0 and Sphinx 1.5, the setting for treat sphinx warnings as errors is setting warning-is-error in build_sphinx section. Migrate the setting from the old warnerrors one. There are a number of issues that need to resolved to make this work. Most of these trivial enough but unfortunately the history document contains issue due to its inclusion of ChangeLog, which is based on commit message summary lines and contains some invalid rST. There doesn't appear to be anyway to edit there retroactively nor disable warnings on a specific files, thus the removal. Change-Id: Ied79fc95d3711f8f3880e3e07e20f2c69b9a36ab --- doc/source/conf.py | 3 ++- doc/source/history.rst | 2 -- doc/source/index.rst | 8 -------- oslo_config/cfg.py | 42 +++++++++++++++++++++--------------------- oslo_config/types.py | 3 +-- setup.cfg | 6 ++---- 6 files changed, 26 insertions(+), 38 deletions(-) delete mode 100644 doc/source/history.rst diff --git a/doc/source/conf.py b/doc/source/conf.py index 2335ba23..62b21197 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -53,7 +53,8 @@ modindex_common_prefix = ['oslo_config.'] # Sphinx are currently 'default' and 'sphinxdoc'. # html_theme_path = ["."] # html_theme = '_theme' -html_static_path = ['static'] +# html_static_path = ['static'] + # Output file base name for HTML help builder. htmlhelp_basename = '%sdoc' % project diff --git a/doc/source/history.rst b/doc/source/history.rst deleted file mode 100644 index db8340b5..00000000 --- a/doc/source/history.rst +++ /dev/null @@ -1,2 +0,0 @@ -.. include:: ../../ChangeLog - diff --git a/doc/source/index.rst b/doc/source/index.rst index af4ba20e..cddbd820 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -29,14 +29,6 @@ Contents faq contributing -Release Notes -============= - -.. toctree:: - :maxdepth: 1 - - history - Indices and tables ================== diff --git a/oslo_config/cfg.py b/oslo_config/cfg.py index 58c292e9..fcde1b25 100644 --- a/oslo_config/cfg.py +++ b/oslo_config/cfg.py @@ -46,22 +46,22 @@ the value can not be converted. For convenience, there are predefined option subclasses in :mod:`oslo_config.cfg` that set the option `type` as in the following table: -==================================== ====== -Type Option -==================================== ====== -:class:`oslo_config.types.String` - :class:`oslo_config.cfg.StrOpt` - - :class:`oslo_config.cfg.SubCommandOpt` -:class:`oslo_config.types.Boolean` :class:`oslo_config.cfg.BoolOpt` -:class:`oslo_config.types.Integer` :class:`oslo_config.cfg.IntOpt` -:class:`oslo_config.types.Float` :class:`oslo_config.cfg.FloatOpt` -:class:`oslo_config.types.Port` :class:`oslo_config.cfg.PortOpt` -:class:`oslo_config.types.List` :class:`oslo_config.cfg.ListOpt` -:class:`oslo_config.types.Dict` :class:`oslo_config.cfg.DictOpt` -:class:`oslo_config.types.IPAddress` :class:`oslo_config.cfg.IPOpt` -:class:`oslo_config.types.Hostname` :class:`oslo_config.cfg.HostnameOpt` -:class:`oslo_config.types.HostAddress`:class:`oslo_config.cfg.HostAddressOpt` -:class:`oslo_config.types.URI` :class:`oslo_config.cfg.URIOpt` -==================================== ====== +====================================== ====== +Type Option +====================================== ====== +:class:`oslo_config.types.String` :class:`oslo_config.cfg.StrOpt` +:class:`oslo_config.types.String` :class:`oslo_config.cfg.SubCommandOpt` +:class:`oslo_config.types.Boolean` :class:`oslo_config.cfg.BoolOpt` +:class:`oslo_config.types.Integer` :class:`oslo_config.cfg.IntOpt` +:class:`oslo_config.types.Float` :class:`oslo_config.cfg.FloatOpt` +:class:`oslo_config.types.Port` :class:`oslo_config.cfg.PortOpt` +:class:`oslo_config.types.List` :class:`oslo_config.cfg.ListOpt` +:class:`oslo_config.types.Dict` :class:`oslo_config.cfg.DictOpt` +:class:`oslo_config.types.IPAddress` :class:`oslo_config.cfg.IPOpt` +:class:`oslo_config.types.Hostname` :class:`oslo_config.cfg.HostnameOpt` +:class:`oslo_config.types.HostAddress` :class:`oslo_config.cfg.HostAddressOpt` +:class:`oslo_config.types.URI` :class:`oslo_config.cfg.URIOpt` +====================================== ====== For :class:`oslo_config.cfg.MultiOpt` the `item_type` parameter defines the type of the values. For convenience, :class:`oslo_config.cfg.MultiStrOpt` @@ -2278,7 +2278,7 @@ class ConfigOpts(collections.Mapping): _ConfigDirOpt('config-dir', metavar='DIR', default=default_config_dirs, - help='Path to a config directory to pull *.conf ' + help='Path to a config directory to pull `*.conf` ' 'files from. This file set is sorted, so as to ' 'provide a predictable parse order if ' 'individual options are over-ridden. The set ' @@ -3119,7 +3119,7 @@ class ConfigOpts(collections.Mapping): def reload_config_files(self): """Reload configure files and parse all options - :return False if reload configure files failed or else return True + :return: False if reload configure files failed or else return True """ try: @@ -3141,7 +3141,7 @@ class ConfigOpts(collections.Mapping): :param hook: a function accepting this ConfigOpts object and a dict of config mutations, as returned by mutate_config_files. - :return None + :return: None """ self._mutate_hooks.add(hook) @@ -3153,8 +3153,8 @@ class ConfigOpts(collections.Mapping): Hooks are called in a NON-DETERMINISTIC ORDER. Do not expect hooks to be called in the same order as they were added. - :return {(None or 'group', 'optname'): (old_value, new_value), ... } - :raises Error if reloading fails + :return: {(None or 'group', 'optname'): (old_value, new_value), ... } + :raises: Error if reloading fails """ self.__cache.clear() diff --git a/oslo_config/types.py b/oslo_config/types.py index 81f9cb6b..788dc2d9 100644 --- a/oslo_config/types.py +++ b/oslo_config/types.py @@ -769,9 +769,8 @@ class HostAddress(object): matching the opt values to the respective types as per RFC1912. :param version: defines which version should be explicitly - checked (4 or 6) in case of an IP address + checked (4 or 6) in case of an IP address :param type_name: Type name to be used in the sample config file. - """ def __init__(self, version=None, type_name='host address value'): diff --git a/setup.cfg b/setup.cfg index 80a7b924..e1567b43 100644 --- a/setup.cfg +++ b/setup.cfg @@ -34,15 +34,13 @@ oslo.config.opts = oslo.config = oslo_config._list_opts:list_opts [build_sphinx] +all-files = 1 +warning-is-error = 1 source-dir = doc/source build-dir = doc/build -all_files = 1 [upload_sphinx] upload-dir = doc/build/html -[pbr] -warnerrors = True - [wheel] universal = 1