cliechti | a3d9de5 | 2010-10-23 22:13:39 +0000 | [diff] [blame] | 1 | # setup.py for pySerial |
cliechti | ff94563 | 2009-07-25 01:15:00 +0000 | [diff] [blame] | 2 | # |
cliechti | a3d9de5 | 2010-10-23 22:13:39 +0000 | [diff] [blame] | 3 | # Windows installer: |
| 4 | # "python setup.py bdist_wininst" |
| 5 | # |
| 6 | # Direct install (all systems): |
| 7 | # "python setup.py install" |
| 8 | # |
| 9 | # For Python 3.x use the corresponding Python executable, |
| 10 | # e.g. "python3 setup.py ..." |
cliechti | ff94563 | 2009-07-25 01:15:00 +0000 | [diff] [blame] | 11 | |
cliechti | 7aaead3 | 2009-07-23 14:02:41 +0000 | [diff] [blame] | 12 | import sys |
| 13 | |
cliechti | 1eb947d | 2009-07-25 00:44:23 +0000 | [diff] [blame] | 14 | from distutils.core import setup |
cliechti | 89b4af1 | 2002-02-12 23:24:41 +0000 | [diff] [blame] | 15 | |
cliechti | 1eb947d | 2009-07-25 00:44:23 +0000 | [diff] [blame] | 16 | try: |
| 17 | from distutils.command.build_py import build_py_2to3 as build_py |
cliechti | a3d9de5 | 2010-10-23 22:13:39 +0000 | [diff] [blame] | 18 | from distutils.command.build_scripts import build_scripts_2to3 as build_scripts |
cliechti | 1eb947d | 2009-07-25 00:44:23 +0000 | [diff] [blame] | 19 | except ImportError: |
| 20 | if sys.version_info >= (3, 0): |
| 21 | raise ImportError("build_py_2to3 not found in distutils - it is required for Python 3.x") |
| 22 | from distutils.command.build_py import build_py |
cliechti | a3d9de5 | 2010-10-23 22:13:39 +0000 | [diff] [blame] | 23 | from distutils.command.build_scripts import build_scripts |
cliechti | 05e6f79 | 2009-07-30 17:27:48 +0000 | [diff] [blame] | 24 | suffix = "" |
| 25 | else: |
| 26 | suffix = "-py3k" |
| 27 | |
cliechti | 1eb947d | 2009-07-25 00:44:23 +0000 | [diff] [blame] | 28 | |
cliechti | f81362e | 2009-07-25 03:44:33 +0000 | [diff] [blame] | 29 | if sys.version < '2.3': |
| 30 | # distutils that old can't cope with the "classifiers" or "download_url" |
| 31 | # keywords and True/False constants and basestring are missing |
cliechti | daf47ba | 2009-07-28 01:28:16 +0000 | [diff] [blame] | 32 | raise ValueError("Sorry Python versions older than 2.3 are no longer" |
cliechti | 1eb947d | 2009-07-25 00:44:23 +0000 | [diff] [blame] | 33 | "supported - check http://pyserial.sf.net for older " |
| 34 | "releases or upgrade your Python installation.") |
cliechti | 5600e7c | 2003-11-06 22:17:21 +0000 | [diff] [blame] | 35 | |
cliechti | 89b4af1 | 2002-02-12 23:24:41 +0000 | [diff] [blame] | 36 | setup( |
cliechti | 05e6f79 | 2009-07-30 17:27:48 +0000 | [diff] [blame] | 37 | name = "pyserial" + suffix, |
cliechti | 54f69b6 | 2009-07-21 19:48:41 +0000 | [diff] [blame] | 38 | description = "Python Serial Port Extension", |
cliechti | 07709e4 | 2010-05-21 00:30:09 +0000 | [diff] [blame] | 39 | version = "2.5", |
cliechti | 54f69b6 | 2009-07-21 19:48:41 +0000 | [diff] [blame] | 40 | author = "Chris Liechti", |
| 41 | author_email = "cliechti@gmx.net", |
| 42 | url = "http://pyserial.sourceforge.net/", |
| 43 | packages = ['serial'], |
| 44 | license = "Python", |
| 45 | long_description = "Python Serial Port Extension for Win32, Linux, BSD, Jython, IronPython", |
cliechti | 5600e7c | 2003-11-06 22:17:21 +0000 | [diff] [blame] | 46 | classifiers = [ |
cliechti | 8db88b6 | 2003-09-10 20:14:53 +0000 | [diff] [blame] | 47 | 'Development Status :: 5 - Production/Stable', |
| 48 | 'Intended Audience :: Developers', |
| 49 | 'Intended Audience :: End Users/Desktop', |
| 50 | 'License :: OSI Approved :: Python Software Foundation License', |
| 51 | 'Natural Language :: English', |
| 52 | 'Operating System :: POSIX', |
| 53 | 'Operating System :: Microsoft :: Windows', |
cliechti | ff94563 | 2009-07-25 01:15:00 +0000 | [diff] [blame] | 54 | #~ 'Operating System :: Microsoft :: Windows :: Windows CE', # could work due to new ctypes impl. someone needs to confirm that |
cliechti | 8db88b6 | 2003-09-10 20:14:53 +0000 | [diff] [blame] | 55 | 'Programming Language :: Python', |
cliechti | 1eb947d | 2009-07-25 00:44:23 +0000 | [diff] [blame] | 56 | 'Programming Language :: Python :: 2', |
| 57 | 'Programming Language :: Python :: 2.3', |
| 58 | 'Programming Language :: Python :: 2.4', |
| 59 | 'Programming Language :: Python :: 2.5', |
| 60 | 'Programming Language :: Python :: 2.6', |
cliechti | 07709e4 | 2010-05-21 00:30:09 +0000 | [diff] [blame] | 61 | 'Programming Language :: Python :: 2.7', |
cliechti | 1eb947d | 2009-07-25 00:44:23 +0000 | [diff] [blame] | 62 | 'Programming Language :: Python :: 3', |
| 63 | 'Programming Language :: Python :: 3.0', |
| 64 | 'Programming Language :: Python :: 3.1', |
cliechti | 8db88b6 | 2003-09-10 20:14:53 +0000 | [diff] [blame] | 65 | 'Topic :: Communications', |
| 66 | 'Topic :: Software Development :: Libraries', |
cliechti | ff94563 | 2009-07-25 01:15:00 +0000 | [diff] [blame] | 67 | 'Topic :: Software Development :: Libraries :: Python Modules', |
cliechti | 8db88b6 | 2003-09-10 20:14:53 +0000 | [diff] [blame] | 68 | 'Topic :: Terminals :: Serial', |
| 69 | ], |
cliechti | 54f69b6 | 2009-07-21 19:48:41 +0000 | [diff] [blame] | 70 | platforms = 'any', |
cliechti | a3d9de5 | 2010-10-23 22:13:39 +0000 | [diff] [blame] | 71 | cmdclass = {'build_py': build_py, 'build_scripts': build_scripts}, |
cliechti | 1eb947d | 2009-07-25 00:44:23 +0000 | [diff] [blame] | 72 | |
cliechti | 8450857 | 2009-07-30 21:15:57 +0000 | [diff] [blame] | 73 | scripts = ['examples/miniterm.py'], |
cliechti | 54f69b6 | 2009-07-21 19:48:41 +0000 | [diff] [blame] | 74 | ) |