blob: 5a0d27faa5eb15762fc4d7297d4594a5c1f1f543 [file] [log] [blame]
cliechtia3d9de52010-10-23 22:13:39 +00001# setup.py for pySerial
cliechtiff945632009-07-25 01:15:00 +00002#
cliechtia3d9de52010-10-23 22:13:39 +00003# 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 ..."
cliechtiff945632009-07-25 01:15:00 +000011
cliechti7aaead32009-07-23 14:02:41 +000012import sys
13
cliechti1eb947d2009-07-25 00:44:23 +000014from distutils.core import setup
cliechti89b4af12002-02-12 23:24:41 +000015
cliechti99110032011-08-22 01:15:46 +000016if sys.version_info >= (3, 0):
17 try:
18 from distutils.command.build_py import build_py_2to3 as build_py
19 from distutils.command.build_scripts import build_scripts_2to3 as build_scripts
20 except ImportError:
cliechti1eb947d2009-07-25 00:44:23 +000021 raise ImportError("build_py_2to3 not found in distutils - it is required for Python 3.x")
cliechti67bbe912013-10-13 22:24:37 +000022 else:
23 sys.stderr.write('Detected Python 3, using 2to3\n')
cliechti99110032011-08-22 01:15:46 +000024else:
cliechti1eb947d2009-07-25 00:44:23 +000025 from distutils.command.build_py import build_py
cliechtia3d9de52010-10-23 22:13:39 +000026 from distutils.command.build_scripts import build_scripts
cliechti05e6f792009-07-30 17:27:48 +000027
cliechti1eb947d2009-07-25 00:44:23 +000028
cliechtif81362e2009-07-25 03:44:33 +000029if 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
cliechtidaf47ba2009-07-28 01:28:16 +000032 raise ValueError("Sorry Python versions older than 2.3 are no longer"
cliechti1eb947d2009-07-25 00:44:23 +000033 "supported - check http://pyserial.sf.net for older "
34 "releases or upgrade your Python installation.")
cliechti5600e7c2003-11-06 22:17:21 +000035
cliechtie428c0b2011-08-22 00:10:11 +000036# importing version does not work with Python 3 as files have not yet been
37# converted.
38#~ import serial
39#~ version = serial.VERSION
40
41import re, os
42version = re.search(
43 "VERSION.*'(.+)'",
44 open(os.path.join('serial', '__init__.py')).read()).group(1)
45
cliechtif0c9f512011-03-18 11:16:15 +000046
cliechti89b4af12002-02-12 23:24:41 +000047setup(
cliechti67bbe912013-10-13 22:24:37 +000048 name = "pyserial",
cliechti54f69b62009-07-21 19:48:41 +000049 description = "Python Serial Port Extension",
cliechtie428c0b2011-08-22 00:10:11 +000050 version = version,
cliechti54f69b62009-07-21 19:48:41 +000051 author = "Chris Liechti",
52 author_email = "cliechti@gmx.net",
53 url = "http://pyserial.sourceforge.net/",
cliechti0e69a9c2011-03-09 15:30:11 +000054 packages = ['serial', 'serial.tools', 'serial.urlhandler'],
cliechti54f69b62009-07-21 19:48:41 +000055 license = "Python",
56 long_description = "Python Serial Port Extension for Win32, Linux, BSD, Jython, IronPython",
cliechti5600e7c2003-11-06 22:17:21 +000057 classifiers = [
cliechti8db88b62003-09-10 20:14:53 +000058 'Development Status :: 5 - Production/Stable',
59 'Intended Audience :: Developers',
60 'Intended Audience :: End Users/Desktop',
61 'License :: OSI Approved :: Python Software Foundation License',
62 'Natural Language :: English',
63 'Operating System :: POSIX',
64 'Operating System :: Microsoft :: Windows',
cliechtiff945632009-07-25 01:15:00 +000065 #~ 'Operating System :: Microsoft :: Windows :: Windows CE', # could work due to new ctypes impl. someone needs to confirm that
cliechti8db88b62003-09-10 20:14:53 +000066 'Programming Language :: Python',
cliechti1eb947d2009-07-25 00:44:23 +000067 'Programming Language :: Python :: 2',
68 'Programming Language :: Python :: 2.3',
69 'Programming Language :: Python :: 2.4',
70 'Programming Language :: Python :: 2.5',
71 'Programming Language :: Python :: 2.6',
cliechti07709e42010-05-21 00:30:09 +000072 'Programming Language :: Python :: 2.7',
cliechti1eb947d2009-07-25 00:44:23 +000073 'Programming Language :: Python :: 3',
74 'Programming Language :: Python :: 3.0',
75 'Programming Language :: Python :: 3.1',
cliechti99110032011-08-22 01:15:46 +000076 'Programming Language :: Python :: 3.2',
cliechti67bbe912013-10-13 22:24:37 +000077 'Programming Language :: Python :: 3.3',
cliechti8db88b62003-09-10 20:14:53 +000078 'Topic :: Communications',
79 'Topic :: Software Development :: Libraries',
cliechtiff945632009-07-25 01:15:00 +000080 'Topic :: Software Development :: Libraries :: Python Modules',
cliechti8db88b62003-09-10 20:14:53 +000081 'Topic :: Terminals :: Serial',
82 ],
cliechti54f69b62009-07-21 19:48:41 +000083 platforms = 'any',
cliechtia3d9de52010-10-23 22:13:39 +000084 cmdclass = {'build_py': build_py, 'build_scripts': build_scripts},
cliechti67bbe912013-10-13 22:24:37 +000085 use_2to3 = sys.version_info >= (3, 0), # for distribute
cliechti1eb947d2009-07-25 00:44:23 +000086
cliechti16d73772011-03-09 15:33:33 +000087 scripts = ['serial/tools/miniterm.py'],
cliechti54f69b62009-07-21 19:48:41 +000088)