summaryrefslogtreecommitdiff
path: root/common/setup.py
diff options
context:
space:
mode:
authorKali Kaneko <kali@leap.se>2016-04-01 17:40:49 -0400
committerKali Kaneko <kali@leap.se>2016-04-01 17:40:49 -0400
commit61b31f4e65f80d159831ace42b45812ba6beb995 (patch)
tree39e038a8b184c7e1e2d63715d0abdd0b0bc0542f /common/setup.py
parent45da47b7b5cddfe40820a8589d82527c2629adae (diff)
[pkg] update to versioneer 0.16
Diffstat (limited to 'common/setup.py')
-rw-r--r--common/setup.py63
1 files changed, 29 insertions, 34 deletions
diff --git a/common/setup.py b/common/setup.py
index 383745dc..8d9c4d6e 100644
--- a/common/setup.py
+++ b/common/setup.py
@@ -23,19 +23,15 @@ from os import listdir
from os.path import realpath, dirname, isdir, join, isfile, basename
import re
+from distutils.command.build import build as _build
from setuptools import setup
from setuptools import find_packages
from setuptools import Command
from setuptools.command.develop import develop as _cmd_develop
+import versioneer
from pkg import utils
-import versioneer
-versioneer.versionfile_source = 'src/leap/soledad/common/_version.py'
-versioneer.versionfile_build = 'leap/soledad/common/_version.py'
-versioneer.tag_prefix = '' # tags are like 1.2.0
-versioneer.parentdir_prefix = 'leap.soledad.common-'
-
trove_classifiers = (
"Development Status :: 3 - Alpha",
@@ -51,11 +47,11 @@ trove_classifiers = (
"Topic :: Software Development :: Libraries :: Python Modules"
)
-DOWNLOAD_BASE = ('https://github.com/leapcode/soledad/'
+DOWNLOAD_BASE = ('https://github.com/leapcode/bitmask_client/'
'archive/%s.tar.gz')
_versions = versioneer.get_versions()
VERSION = _versions['version']
-VERSION_FULL = _versions['full']
+VERSION_REVISION = _versions['full-revisionid']
DOWNLOAD_URL = ""
# get the short version for the download url
@@ -64,15 +60,30 @@ if len(_version_short) > 0:
VERSION_SHORT = _version_short[0]
DOWNLOAD_URL = DOWNLOAD_BASE % VERSION_SHORT
-cmdclass = versioneer.get_cmdclass()
-
class freeze_debianver(Command):
+
"""
Freezes the version in a debian branch.
To be used after merging the development branch onto the debian one.
"""
user_options = []
+ template = r"""
+# This file was generated by the `freeze_debianver` command in setup.py
+# Using 'versioneer.py' (0.16) from
+# revision-control system data, or from the parent directory name of an
+# 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}
+"""
def initialize_options(self):
pass
@@ -86,28 +97,16 @@ class freeze_debianver(Command):
if proceed != "y":
print("He. You scared. Aborting.")
return
- template = r"""
-# This file was generated by the `freeze_debianver` command in setup.py
-# Using 'versioneer.py' (0.7+) from
-# revision-control system data, or from the parent directory name of an
-# unpacked source archive. Distribution tarballs contain a pre-generated copy
-# of this file.
-
-version_version = '{version}'
-version_full = '{version_full}'
-"""
- templatefun = r"""
-
-def get_versions(default={}, verbose=False):
- return {'version': version_version, 'full': version_full}
-"""
- subst_template = template.format(
+ subst_template = self.template.format(
version=VERSION_SHORT,
- version_full=VERSION_FULL) + templatefun
- with open(versioneer.versionfile_source, 'w') as f:
+ full_revisionid=VERSION_REVISION) + self.templatefun
+ versioneer_cfg = versioneer.get_config_from_root('.')
+ with open(versioneer_cfg.versionfile_source, 'w') as f:
f.write(subst_template)
+cmdclass = versioneer.get_cmdclass()
+
#
# Couch backend design docs file generation.
#
@@ -229,13 +228,9 @@ class cmd_develop(_cmd_develop):
build_ddocs_py()
-# versioneer powered
-old_cmd_build = cmdclass["build"]
-
-
-class cmd_build(old_cmd_build):
+class cmd_build(_build):
def run(self):
- old_cmd_build.run(self)
+ _build.run(self)
build_ddocs_py(basedir=self.build_lib, with_src=False)