diff options
author | Kali Kaneko <kali@leap.se> | 2016-05-18 12:19:35 -0400 |
---|---|---|
committer | Ruben Pollan <meskio@sindominio.net> | 2017-01-26 22:39:34 +0100 |
commit | eec79703d4f09580b20b06f1c8ca16d4068e128f (patch) | |
tree | e9aa87779008304b4d73be6f3e8db665986d5d20 | |
parent | 800c2167ca332e7b59072a1c928cbb9ba996f369 (diff) |
[pkg] update to new versioneer json format
-rw-r--r-- | setup.py | 28 |
1 files changed, 17 insertions, 11 deletions
@@ -72,14 +72,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): @@ -94,9 +100,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) |