diff options
author | Dana Powers <dana.powers@rd.io> | 2014-08-10 18:18:02 -0700 |
---|---|---|
committer | Dana Powers <dana.powers@rd.io> | 2014-08-10 18:39:02 -0700 |
commit | e81b13a83211ae00b83dd10a123eea27f9347688 (patch) | |
tree | 042569e424c9c1a9d70d84cbfde9222c12617ad9 | |
parent | 7bfdafa9e727a4bdd48993930bd605b51d049b30 (diff) | |
download | kafka-python-e81b13a83211ae00b83dd10a123eea27f9347688.tar.gz |
Set module version in separate VERSION file
-rw-r--r-- | MANIFEST.in | 2 | ||||
-rw-r--r-- | VERSION | 1 | ||||
-rw-r--r-- | kafka/__init__.py | 4 | ||||
-rw-r--r-- | setup.py | 3 |
4 files changed, 8 insertions, 2 deletions
diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..68bd793 --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,2 @@ +include VERSION +recursive-include kafka *.py @@ -0,0 +1 @@ +0.9.0 diff --git a/kafka/__init__.py b/kafka/__init__.py index e446f58..41dc25a 100644 --- a/kafka/__init__.py +++ b/kafka/__init__.py @@ -1,5 +1,7 @@ __title__ = 'kafka' -__version__ = '0.9.0' +# Use setuptools to get version from setup.py +import pkg_resources +__version__ = pkg_resources.require('kafka-python')[0].version __author__ = 'David Arthur' __license__ = 'Apache License 2.0' __copyright__ = 'Copyright 2012, David Arthur under Apache License, v2.0' @@ -2,7 +2,8 @@ import sys from setuptools import setup, Command -from kafka import __version__ +with open('VERSION', 'r') as v: + __version__ = v.read().rstrip() class Tox(Command): |