summaryrefslogtreecommitdiff
path: root/keymanager/setup.py
diff options
context:
space:
mode:
authorKali Kaneko (leap communications) <kali@leap.se>2016-05-18 11:56:37 -0400
committerKali Kaneko (leap communications) <kali@leap.se>2016-05-18 11:56:37 -0400
commitc201648c735850ecc000c88855aa26f551d22900 (patch)
treefaabb04924fd10fdc0376ea01944644a700d6e5f /keymanager/setup.py
parentcabdef05d8e397c16b438502da78d0ac7c7fe6f4 (diff)
[pkg] update to new versioneer json format
Diffstat (limited to 'keymanager/setup.py')
-rw-r--r--keymanager/setup.py27
1 files changed, 16 insertions, 11 deletions
diff --git a/keymanager/setup.py b/keymanager/setup.py
index 4a05a1e6..cde5f8b6 100644
--- a/keymanager/setup.py
+++ b/keymanager/setup.py
@@ -53,7 +53,6 @@ if len(_version_short) > 0:
VERSION_SHORT = _version_short[0]
DOWNLOAD_URL = DOWNLOAD_BASE % VERSION_SHORT
-
class freeze_debianver(Command):
"""
@@ -68,14 +67,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):
@@ -90,9 +95,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)