summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKali Kaneko <kali@leap.se>2016-05-18 11:48:03 -0400
committerKali Kaneko <kali@leap.se>2016-05-18 11:50:28 -0400
commit34e4eec7bb30e1be52aac1665321394a5ef080f0 (patch)
tree27760e7bb0510ee8a881fb1bd938cd4220f93597
parentd0aebe266b09a6787f34b16413db81a20e090601 (diff)
[pkg] setup: use new versioneer json format
-rw-r--r--setup.py29
1 files changed, 17 insertions, 12 deletions
diff --git a/setup.py b/setup.py
index 0d4c281..e23ca7d 100644
--- a/setup.py
+++ b/setup.py
@@ -78,14 +78,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):
@@ -100,14 +106,13 @@ 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)
-
try:
long_description = open('README.rst').read() + '\n\n\n' + \
open('CHANGELOG').read()