From be69ebd8bd904a61e21d9e1398f77751df8f4d0d Mon Sep 17 00:00:00 2001 From: zhuzeyu Date: Wed, 27 Sep 2017 18:01:04 +0800 Subject: [PATCH] Invoke version_string in watcher/version.py directly There is already define version_string in version.py So we don't need generate version in other files, just call it. Change-Id: I7d8294860523eedad92e213ad00569829e120c39 --- doc/ext/term.py | 4 ++-- doc/source/conf.py | 2 +- releasenotes/source/conf.py | 2 +- watcher/version.py | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/ext/term.py b/doc/ext/term.py index 6bbc55dc6..64a233d4b 100644 --- a/doc/ext/term.py +++ b/doc/ext/term.py @@ -22,7 +22,7 @@ from docutils import nodes from docutils.parsers import rst from docutils import statemachine -from watcher.version import version_info +from watcher.version import version_string class BaseWatcherDirective(rst.Directive): @@ -169,4 +169,4 @@ class WatcherFunc(BaseWatcherDirective): def setup(app): app.add_directive('watcher-term', WatcherTerm) app.add_directive('watcher-func', WatcherFunc) - return {'version': version_info.version_string()} + return {'version': version_string} diff --git a/doc/source/conf.py b/doc/source/conf.py index f448e82d1..d975c316c 100755 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -72,7 +72,7 @@ copyright = u'OpenStack Foundation' # The full version, including alpha/beta/rc tags. release = watcher_version.version_info.release_string() # The short X.Y version. -version = watcher_version.version_info.version_string() +version = watcher_version.version_string # A list of ignored prefixes for module index sorting. modindex_common_prefix = ['watcher.'] diff --git a/releasenotes/source/conf.py b/releasenotes/source/conf.py index 8b36a7864..b41d05d07 100644 --- a/releasenotes/source/conf.py +++ b/releasenotes/source/conf.py @@ -63,7 +63,7 @@ copyright = u'2016, Watcher developers' # The short X.Y version. version = watcher_version.version_info.release_string() # The full version, including alpha/beta/rc tags. -release = watcher_version.version_info.version_string() +release = watcher_version.version_string # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/watcher/version.py b/watcher/version.py index 42c81b0a0..d5a95ae61 100644 --- a/watcher/version.py +++ b/watcher/version.py @@ -16,4 +16,4 @@ import pbr.version version_info = pbr.version.VersionInfo('python-watcher') -version_string = version_info.version_string +version_string = version_info.version_string()