summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKali Kaneko <kali@leap.se>2016-05-18 12:09:20 -0400
committerKali Kaneko <kali@leap.se>2016-05-18 12:09:20 -0400
commit75941a7d0bc82738209d42d434042c76ab990dbe (patch)
tree750034c0730e7bd504a0c5fc1adf326dba3e5b1c
parenta3ce6051caa3a515913a4bb25c13c355b72f7df4 (diff)
[pkg] update to new versioneer json format
-rw-r--r--mail/setup.py30
1 files changed, 19 insertions, 11 deletions
diff --git a/mail/setup.py b/mail/setup.py
index 960cea14..ede620da 100644
--- a/mail/setup.py
+++ b/mail/setup.py
@@ -62,6 +62,7 @@ cmdclass = versioneer.get_cmdclass()
class freeze_debianver(Command):
+
"""
Freezes the version in a debian branch.
To be used after merging the development branch onto the debian one.
@@ -74,14 +75,20 @@ class freeze_debianver(Command):
# unpacked source archive. Distribution tarballs contain a pre-generated copy
# of this file.
-version_version = '{version}'
-full_revisionid = '{full_revisionid}'
-"""
- templatefun = r"""
+import json
+import sys
+
+version_json = '''
+{
+ "dirty": false,
+ "error": null,
+ "full-revisionid": "FULL_REVISIONID",
+ "version": "VERSION_STRING"
+}
+''' # END VERSION_JSON
-def get_versions(default={}, verbose=False):
- return {'version': version_version,
- 'full-revisionid': full_revisionid}
+def get_versions():
+ return json.loads(version_json)
"""
def initialize_options(self):
@@ -96,10 +103,11 @@ def get_versions(default={}, verbose=False):
if proceed != "y":
print("He. You scared. Aborting.")
return
- subst_template = self.template.format(
- version=VERSION_SHORT,
- version_full=VERSION_REVISION) + self.templatefun
- with open(versioneer.versionfile_source, 'w') as f:
+ subst_template = self.template.replace(
+ 'VERSION_STRING', VERSION_SHORT).replace(
+ 'FULL_REVISIONID', VERSION_REVISION)
+ versioneer_cfg = versioneer.get_config_from_root('.')
+ with open(versioneer_cfg.versionfile_source, 'w') as f:
f.write(subst_template)