From 2a40d6eb9083f38b213bd5793fa5a47d3cd9996d Mon Sep 17 00:00:00 2001 From: Daniel Folkinshteyn Date: Fri, 20 Aug 2010 10:31:05 -0400 Subject: [PATCH] Consolidate the version string to reside in one central place to ease change making. --- sandbox/release.py | 2 +- scripts/supybot | 3 ++- setup.py | 3 ++- src/conf.py | 2 +- src/version.py | 3 +++ 5 files changed, 9 insertions(+), 4 deletions(-) create mode 100644 src/version.py diff --git a/sandbox/release.py b/sandbox/release.py index 0538e6c30..d07eee0b9 100644 --- a/sandbox/release.py +++ b/sandbox/release.py @@ -90,7 +90,7 @@ if __name__ == '__main__': error('Invalid third line in ChangeLog.') print 'Updating version in version files.' - versionFiles = ('src/conf.py', 'scripts/supybot', 'setup.py') + versionFiles = ('src/version.py') for fn in versionFiles: sh = 'perl -pi -e "s/^version\s*=.*/version = \'%s\'/" %s' % (v, fn) system(sh, 'Error changing version in %s' % fn) diff --git a/scripts/supybot b/scripts/supybot index 7f1953776..9054cef57 100644 --- a/scripts/supybot +++ b/scripts/supybot @@ -65,6 +65,8 @@ import supybot.utils as utils import supybot.registry as registry import supybot.questions as questions +from supybot.version import version + def main(): import supybot.conf as conf import supybot.world as world @@ -125,7 +127,6 @@ def main(): log.info('Total CPU time taken: %s seconds.', user+system) log.info('No more Irc objects, exiting.') -version = '0.83.4.1+git' if __name__ == '__main__': parser = optparse.OptionParser(usage='Usage: %prog [options] configFile', version='Supybot %s' % version) diff --git a/setup.py b/setup.py index 538c4e837..166a84cd6 100644 --- a/setup.py +++ b/setup.py @@ -47,6 +47,8 @@ import glob import shutil import os.path +from src.version import version + plugins = [s for s in os.listdir('plugins') if os.path.exists(os.path.join('plugins', s, 'plugin.py'))] @@ -116,7 +118,6 @@ package_dir = {'supybot': 'src', for plugin in plugins: package_dir['supybot.plugins.' + plugin] = 'plugins/' + plugin -version = '0.83.4.1+git' setup( # Metadata name='supybot', diff --git a/src/conf.py b/src/conf.py index 114b87878..3768682f4 100644 --- a/src/conf.py +++ b/src/conf.py @@ -40,7 +40,7 @@ import supybot.ircutils as ircutils ### # version: This should be pretty obvious. ### -version = '0.83.4.1+git' +from supybot.version import version ### # *** The following variables are affected by command-line options. They are diff --git a/src/version.py b/src/version.py new file mode 100644 index 000000000..f87586219 --- /dev/null +++ b/src/version.py @@ -0,0 +1,3 @@ +"""stick the various versioning attributes in here, so we only have to change +them once.""" +version = '0.83.4.1+gribble'