From 34e4eec7bb30e1be52aac1665321394a5ef080f0 Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Wed, 18 May 2016 11:48:03 -0400 Subject: [pkg] setup: use new versioneer json format --- setup.py | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) (limited to 'setup.py') 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() -- cgit v1.2.3 From 40e5d40c7c725709ac3fd770e6070fbe02e4b7e0 Mon Sep 17 00:00:00 2001 From: drebs Date: Wed, 6 Jul 2016 08:46:33 +0200 Subject: [pkg] remove dependency on dirspec This commit removes the dep introduced in 5e12233 by just importing some tiny bit of dirspec code. The previous change was introduced because: * pyxdg did not account for Mac OS specifics, i.e. using ~/Library/ directory structure instead of .config (see: https://leap.se/code/issues/3574). * dirspec does the correct thing for xdg on Mac OS. * u1db depends on dirspec anyway. The problem is that dirspec is not maintained and published on pypi, what forces us to download it from an URL and add exceptions to be able to pip install it. As we are removing dependence on u1db on other modules, we can also remove it here. To workaround the Mac OS problem, we just add some code from dirspec to ensure we get the correct directory on Mac OS. --- setup.py | 1 - 1 file changed, 1 deletion(-) (limited to 'setup.py') diff --git a/setup.py b/setup.py index e23ca7d..4269718 100644 --- a/setup.py +++ b/setup.py @@ -30,7 +30,6 @@ dependency_links = [requirement for requirement in requirements if requirement.startswith('http')] requirements = [requirement for requirement in requirements if requirement not in dependency_links] -requirements.append('dirspec') tests_requirements = [ 'mock', -- cgit v1.2.3