summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArmin Ronacher <armin.ronacher@active-4.com>2016-07-29 01:38:56 +0200
committerArmin Ronacher <armin.ronacher@active-4.com>2016-07-29 01:38:56 +0200
commit38fc2d178fb2d8afd77cd3e8f62033d98869e863 (patch)
tree7fce448cc4bf3e9a461a5cc90f308a3a5dd9f66b
parent75cf90996ee22fc3bf9f988a6693e9171bc3a2d0 (diff)
downloadraven-38fc2d178fb2d8afd77cd3e8f62033d98869e863.tar.gz
Hardcode version in package init to avoid issues with badly installed libraries misreporting.
-rw-r--r--raven/__init__.py6
-rwxr-xr-xsetup.py12
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):
diff --git a/setup.py b/setup.py
index f7063ea..11e9432 100755
--- a/setup.py
+++ b/setup.py
@@ -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',