diff options
author | Armin Ronacher <armin.ronacher@active-4.com> | 2016-07-29 01:47:43 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-07-29 01:47:43 +0200 |
commit | a0c1ed7ae8c2e08d40c1e93fc9c212b14981bad2 (patch) | |
tree | 05ea56fcaff6f092f7b94442aebf633e22eed458 | |
parent | e5a0603ade7fd7435bcfcfec6b56e063065dffd6 (diff) | |
parent | 38fc2d178fb2d8afd77cd3e8f62033d98869e863 (diff) | |
download | raven-a0c1ed7ae8c2e08d40c1e93fc9c212b14981bad2.tar.gz |
Merge pull request #815 from getsentry/feature/hardcoded-version
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', |