diff options
author | Armin Ronacher <armin.ronacher@active-4.com> | 2016-07-29 01:38:56 +0200 |
---|---|---|
committer | Armin Ronacher <armin.ronacher@active-4.com> | 2016-07-29 01:38:56 +0200 |
commit | 38fc2d178fb2d8afd77cd3e8f62033d98869e863 (patch) | |
tree | 7fce448cc4bf3e9a461a5cc90f308a3a5dd9f66b | |
parent | 75cf90996ee22fc3bf9f988a6693e9171bc3a2d0 (diff) | |
download | raven-38fc2d178fb2d8afd77cd3e8f62033d98869e863.tar.gz |
Hardcode version in package init to avoid issues with badly installed libraries misreporting.
-rw-r--r-- | raven/__init__.py | 6 | ||||
-rwxr-xr-x | setup.py | 12 |
2 files changed, 12 insertions, 6 deletions
diff --git a/raven/__init__.py b/raven/__init__.py index 50cef02..5e317cb 100644 --- a/raven/__init__.py +++ b/raven/__init__.py @@ -12,11 +12,7 @@ import os.path __all__ = ('VERSION', 'Client', 'get_version') -try: - VERSION = __import__('pkg_resources') \ - .get_distribution('raven').version -except Exception as e: - VERSION = 'unknown' +VERSION = '5.23.0' def _get_git_revision(path): @@ -22,7 +22,17 @@ for m in ('multiprocessing', 'billiard'): from setuptools import setup, find_packages from setuptools.command.test import test as TestCommand +import re import sys +import ast + + +_version_re = re.compile(r'VERSION\s+=\s+(.*)') + +with open('raven/__init__.py', 'rb') as f: + version = str(ast.literal_eval(_version_re.search( + f.read().decode('utf-8')).group(1))) + install_requires = [ 'contextlib2', @@ -97,7 +107,7 @@ class PyTest(TestCommand): setup( name='raven', - version='5.23.0', + version=version, author='Sentry', author_email='hello@getsentry.com', url='https://github.com/getsentry/raven-python', |