diff options
author | Thomas Kluyver <takowl@gmail.com> | 2014-11-23 17:01:29 -0800 |
---|---|---|
committer | Thomas Kluyver <takowl@gmail.com> | 2014-11-23 17:01:29 -0800 |
commit | 76266b5e87ea08b015c4bc27e40a3e4e47d7865f (patch) | |
tree | 60d430bb2f64a6604e21b116cd729399a083fbe0 | |
parent | a9bbfe580b54f6d6c137ee2470287b7cbaf2830e (diff) | |
download | pexpect-76266b5e87ea08b015c4bc27e40a3e4e47d7865f.tar.gz |
Get version without importing pexpect
-rw-r--r-- | setup.py | 13 |
1 files changed, 11 insertions, 2 deletions
@@ -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.', |