diff options
author | Kali Kaneko <kali@leap.se> | 2016-03-04 11:44:18 -0400 |
---|---|---|
committer | Kali Kaneko <kali@leap.se> | 2016-03-21 15:46:51 -0400 |
commit | 3d2df02b549a32c15b2bb369a33789abadb60c92 (patch) | |
tree | 3f609819c4bd617b65a343b8ea231654e241a140 | |
parent | 470d24ec886adedae6d47e684ab1dc14aa2c21ea (diff) |
[bug] fix some version handling errors
-rwxr-xr-x | setup.py | 11 | ||||
-rw-r--r-- | src/leap/bitmask/__init__.py | 6 | ||||
-rw-r--r-- | src/leap/bitmask/provider/__init__.py | 2 |
3 files changed, 12 insertions, 7 deletions
@@ -24,7 +24,8 @@ import hashlib import sys import os import re -import sys + +from distutils.command.build import build as _build if not sys.version_info[0] == 2: print("[ERROR] Sorry, Python 3 is not supported (yet). " @@ -259,16 +260,16 @@ BITMASK_ROOT = "{bitmask}" cmdclass["hash_binaries"] = cmd_binary_hash -# next two classes need to augment the versioneer modified ones +# sdist class need to augment the versioneer modified ones -versioneer_build = cmdclass['build_py'] +#_build = cmdclass['build_py'] versioneer_sdist = cmdclass['sdist'] -class cmd_build(versioneer_build): +class cmd_build(_build): def run(self): - versioneer_build.run(self) + _build.run(self) copy_reqs(self.build_lib) diff --git a/src/leap/bitmask/__init__.py b/src/leap/bitmask/__init__.py index 966ce91e..6ab55e53 100644 --- a/src/leap/bitmask/__init__.py +++ b/src/leap/bitmask/__init__.py @@ -38,11 +38,15 @@ def _is_release_version(version_str): :rtype: bool """ parts = __version__.split('.') - patch = parts[2] + try: + patch = parts[2] + except IndexError: + return False return patch.isdigit() from ._version import get_versions __version__ = get_versions()['version'] +__version_hash__ = get_versions()['full-revisionid'] IS_RELEASE_VERSION = _is_release_version(__version__) del get_versions diff --git a/src/leap/bitmask/provider/__init__.py b/src/leap/bitmask/provider/__init__.py index 4385a92f..60a41181 100644 --- a/src/leap/bitmask/provider/__init__.py +++ b/src/leap/bitmask/provider/__init__.py @@ -22,7 +22,7 @@ import os from pkg_resources import parse_version -from leap.bitmask import __short_version__ as BITMASK_VERSION +from leap.bitmask import __version__ as BITMASK_VERSION from leap.common.check import leap_assert logger = logging.getLogger(__name__) |