summaryrefslogtreecommitdiff
path: root/trove/version.py
diff options
context:
space:
mode:
authorMichael Basnight <mbasnight@gmail.com>2013-06-19 13:44:44 -0700
committerMichael Basnight <mbasnight@gmail.com>2013-06-24 14:11:15 -0700
commit7ab80b554dde5f1f1e61b6a8c45492c5ac27ed6b (patch)
treec2c850053b70561a3d15b784cf21c5bcad1c993f /trove/version.py
parent18664fa9d8b422d132c60bc0bb085b1ebcc1a9a7 (diff)
downloadtrove-7ab80b554dde5f1f1e61b6a8c45492c5ac27ed6b.tar.gz
Rename from reddwarf to trove.
Implements Blueprint reddwarf-trove-rename Change-Id: Ia9ee609bbc06a1d8b9d6917642529f30347541fd
Diffstat (limited to 'trove/version.py')
-rw-r--r--trove/version.py47
1 files changed, 47 insertions, 0 deletions
diff --git a/trove/version.py b/trove/version.py
new file mode 100644
index 00000000..aac93d2f
--- /dev/null
+++ b/trove/version.py
@@ -0,0 +1,47 @@
+# vim: tabstop=4 shiftwidth=4 softtabstop=4
+
+# Copyright 2011 OpenStack Foundation
+# All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+
+try:
+ from trove.vcsversion import version_info
+except ImportError:
+ version_info = {'branch_nick': u'LOCALBRANCH',
+ 'revision_id': 'LOCALREVISION',
+ 'revno': 0}
+
+REDDWARF_VERSION = ['2012', '1']
+YEAR, COUNT = REDDWARF_VERSION
+
+FINAL = False # This becomes true at Release Candidate time
+
+
+def canonical_version_string():
+ return '.'.join([YEAR, COUNT])
+
+
+def version_string():
+ if FINAL:
+ return canonical_version_string()
+ else:
+ return '%s-dev' % (canonical_version_string(),)
+
+
+def vcs_version_string():
+ return "%s:%s" % (version_info['branch_nick'], version_info['revision_id'])
+
+
+def version_string_with_vcs():
+ return "%s-%s" % (canonical_version_string(), vcs_version_string())