summaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
authorcliechti <cliechti@f19166aa-fa4f-0410-85c2-fa1106f25c8a>2011-08-22 00:10:11 +0000
committercliechti <cliechti@f19166aa-fa4f-0410-85c2-fa1106f25c8a>2011-08-22 00:10:11 +0000
commit4370b3def9f01a8f5bd565056b45c47023105c99 (patch)
tree0b2a33e3803db08c16bfa2b53756f4aeb5c63eb7 /setup.py
parent774f1b38c5c441a917174d66607767727144d8bb (diff)
downloadpyserial-4370b3def9f01a8f5bd565056b45c47023105c99.tar.gz
get version by regexp as import can not work w/ py 3k before 2to3 was run
git-svn-id: http://svn.code.sf.net/p/pyserial/code/trunk/pyserial@422 f19166aa-fa4f-0410-85c2-fa1106f25c8a
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/setup.py b/setup.py
index 8776361..8b8e0bf 100644
--- a/setup.py
+++ b/setup.py
@@ -33,12 +33,21 @@ if sys.version < '2.3':
"supported - check http://pyserial.sf.net for older "
"releases or upgrade your Python installation.")
-import serial
+# importing version does not work with Python 3 as files have not yet been
+# converted.
+#~ import serial
+#~ version = serial.VERSION
+
+import re, os
+version = re.search(
+ "VERSION.*'(.+)'",
+ open(os.path.join('serial', '__init__.py')).read()).group(1)
+
setup(
name = "pyserial" + suffix,
description = "Python Serial Port Extension",
- version = serial.VERSION,
+ version = version,
author = "Chris Liechti",
author_email = "cliechti@gmx.net",
url = "http://pyserial.sourceforge.net/",