From 4370b3def9f01a8f5bd565056b45c47023105c99 Mon Sep 17 00:00:00 2001 From: cliechti Date: Mon, 22 Aug 2011 00:10:11 +0000 Subject: 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 --- setup.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'setup.py') 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/", -- cgit v1.2.1