Skip to content

Commit

Permalink
Properly set __version__
Browse files Browse the repository at this point in the history
  • Loading branch information
dirn committed Mar 3, 2016
1 parent 48a3590 commit fe2f003
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion henson_sentry.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
"""A Henson plugin to integrate Sentry."""

import asyncio
import os as _os
import pkg_resources as _pkg_resources

from henson import Extension
from raven.base import Client
Expand All @@ -9,7 +11,16 @@

__all__ = ('Sentry',)

__version__ = '0.0.1'
try:
_dist = _pkg_resources.get_distribution(__name__)
if not __file__.startswith(_os.path.join(_dist.location, __name__)):
# Manually raise the exception if there is a distribution but
# it's installed from elsewhere.
raise _pkg_resources.DistributionNotFound
except _pkg_resources.DistributionNotFound:
__version__ = 'development'
else:
__version__ = _dist.version


class Sentry(Extension):
Expand Down

0 comments on commit fe2f003

Please sign in to comment.