Skip to content

Commit e81b13a

Browse files
author
Dana Powers
committed
Set module version in separate VERSION file
1 parent 7bfdafa commit e81b13a

File tree

4 files changed

+8
-2
lines changed

4 files changed

+8
-2
lines changed

MANIFEST.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
include VERSION
2+
recursive-include kafka *.py

VERSION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
0.9.0

kafka/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
__title__ = 'kafka'
2-
__version__ = '0.9.0'
2+
# Use setuptools to get version from setup.py
3+
import pkg_resources
4+
__version__ = pkg_resources.require('kafka-python')[0].version
35
__author__ = 'David Arthur'
46
__license__ = 'Apache License 2.0'
57
__copyright__ = 'Copyright 2012, David Arthur under Apache License, v2.0'

setup.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
from setuptools import setup, Command
44

5-
from kafka import __version__
5+
with open('VERSION', 'r') as v:
6+
__version__ = v.read().rstrip()
67

78
class Tox(Command):
89

0 commit comments

Comments
 (0)