summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Kluyver <takowl@gmail.com>2014-11-23 17:01:29 -0800
committerThomas Kluyver <takowl@gmail.com>2014-11-23 17:01:29 -0800
commit76266b5e87ea08b015c4bc27e40a3e4e47d7865f (patch)
tree60d430bb2f64a6604e21b116cd729399a083fbe0
parenta9bbfe580b54f6d6c137ee2470287b7cbaf2830e (diff)
downloadpexpect-76266b5e87ea08b015c4bc27e40a3e4e47d7865f.tar.gz
Get version without importing pexpect
-rw-r--r--setup.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/setup.py b/setup.py
index 82f5679..126749a 100644
--- a/setup.py
+++ b/setup.py
@@ -1,6 +1,15 @@
from distutils.core import setup
+import os
+import re
-from pexpect import __version__
+with open(os.path.join(os.path.dirname(__file__), 'pexpect', '__init__.py'), 'r') as f:
+ for line in f:
+ version_match = re.search(r"__version__ = ['\"]([^'\"]*)['\"]", line)
+ if version_match:
+ version = version_match.group(1)
+ break
+ else:
+ raise Exception("couldn't find version number")
long_description = """
Pexpect is a pure Python module for spawning child applications; controlling
@@ -19,7 +28,7 @@ The Pexpect interface was designed to be easy to use.
"""
setup (name='pexpect',
- version=__version__,
+ version=version,
py_modules=['pxssh', 'fdpexpect', 'FSM', 'screen', 'ANSI'],
packages=['pexpect'],
description='Pexpect allows easy control of interactive console applications.',