summaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
authorKali Kaneko <kali@leap.se>2016-05-18 12:04:59 -0400
committerKali Kaneko <kali@leap.se>2016-05-18 12:04:59 -0400
commit21dbbc534be2c4668011cc9e631a7e4ba24061fa (patch)
tree16e93d686e9f766eff3f665ebad07288bdd04e89 /server
parent695c827db9b60d9a9b368232aac8912b1270bebe (diff)
[pkg] update to new versioneer json format
Diffstat (limited to 'server')
-rw-r--r--server/setup.py28
1 files changed, 17 insertions, 11 deletions
diff --git a/server/setup.py b/server/setup.py
index 8a7fbe45..b3b26010 100644
--- a/server/setup.py
+++ b/server/setup.py
@@ -77,14 +77,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"""
-
-def get_versions(default={}, verbose=False):
- return {'version': version_version,
- 'full-revisionid': full_revisionid}
+import json
+import sys
+
+version_json = '''
+{
+ "dirty": false,
+ "error": null,
+ "full-revisionid": "FULL_REVISIONID",
+ "version": "VERSION_STRING"
+}
+''' # END VERSION_JSON
+
+def get_versions():
+ return json.loads(version_json)
"""
def initialize_options(self):
@@ -99,9 +105,9 @@ def get_versions(default={}, verbose=False):
if proceed != "y":
print("He. You scared. Aborting.")
return
- subst_template = self.template.format(
- version=VERSION_SHORT,
- full_revisionid=VERSION_REVISION) + self.templatefun
+ 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)