summaryrefslogtreecommitdiffstats
path: root/setup.py
diff options
context:
space:
mode:
authorSoren Hansen <soren@linux2go.dk>2011-01-07 23:24:42 +0000
committerTarmac <>2011-01-07 23:24:42 +0000
commit3885195ba05ca5317975797760a0cf81b5e4c647 (patch)
tree3762764ea49d22690039a89faa4fc55af06c7857 /setup.py
parent0ed247f360f77f0a4a469a8d3b155ac5fcfa509c (diff)
parenta29bba7e9f57b97085902fa97d17de32da8044cb (diff)
downloadnova-3885195ba05ca5317975797760a0cf81b5e4c647.tar.gz
nova-3885195ba05ca5317975797760a0cf81b5e4c647.tar.xz
nova-3885195ba05ca5317975797760a0cf81b5e4c647.zip
Adds a mechanism to programmatically determine the version of Nova. The designated version is defined in nova/version.py. When running python setup.py from a bzr checkout, information about the bzr branch is put into nova/vcsversion.py which is conditionally imported in nova/version.py.
In short, you can now do: >>> import nova.version >>> nova.version.canonical_version_string() '2011.1' >>> nova.version.version_string() '2011.1-dev' >>> nova.version.version_string_with_vcs() u'2011.1-newlog2:soren@linux2go.dk-20110107130049-g2cbri7t80vsg2h1' It's also consumed by the docs and setup.py, so this ought to be the canonical place for updating version information from now on.
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/setup.py b/setup.py
index e00911099..5b58274c6 100644
--- a/setup.py
+++ b/setup.py
@@ -24,6 +24,15 @@ from setuptools.command.sdist import sdist
from sphinx.setup_command import BuildDoc
from nova.utils import parse_mailmap, str_dict_replace
+from nova import version
+
+if os.path.isdir('.bzr'):
+ with open("nova/vcsversion.py", 'w') as version_file:
+ vcs_cmd = subprocess.Popen(["bzr", "version-info", "--python"],
+ stdout=subprocess.PIPE)
+ vcsversion = vcs_cmd.communicate()[0]
+ version_file.write(vcsversion)
+
class local_BuildDoc(BuildDoc):
def run(self):
@@ -49,7 +58,7 @@ class local_sdist(sdist):
sdist.run(self)
setup(name='nova',
- version='2011.1',
+ version=version.canonical_version_string(),
description='cloud computing fabric controller',
author='OpenStack',
author_email='nova@lists.launchpad.net',