summaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
authorGeorge Kraft <george.kraft@calxeda.com>2013-11-12 03:12:48 -0600
committerGeorge Kraft <george.kraft@calxeda.com>2013-11-12 03:12:48 -0600
commit41eb6f64bd84c62b68a41bf53feb756097d22864 (patch)
tree41b0e878f93dfc92d09c1fcc7b3fe2396cf330a6 /setup.py
parentbb8daedfd5c76615f0d076f7dcc596b12eb96bbb (diff)
downloadpyipmi-41eb6f64bd84c62b68a41bf53feb756097d22864.tar.gz
CXMAN-254: Move version definition from setup.py to __init__.py
This makes the pyipmi version accessible via the pyipmi.__version__ variable, so we no longer have to use pkg_resources to find it.
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/setup.py b/setup.py
index 1fadda7..20bfe0f 100644
--- a/setup.py
+++ b/setup.py
@@ -30,9 +30,17 @@
from setuptools import setup
+def get_version():
+ """ Parse __init__.py to find the package version """
+ for line in open("pyipmi/__init__.py"):
+ key, delim, value = line.partition("=")
+ if key.strip() == "__version__" and delim == "=":
+ return value.strip().strip("'\"")
+ raise Exception("Failed to parse pyipmi package version from __init__.py")
+
setup(
name='pyipmi',
- version='0.9.0',
+ version=get_version(),
packages=['pyipmi',
'pyipmi.commands',
'pyipmi.tools'],