blob: 2aee8b1cc257bb78fec8cd49c3d2aa4634d78163 [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# Direct install (all systems):
4# "python setup.py install"
5#
6# For Python 3.x use the corresponding Python executable,
7# e.g. "python3 setup.py ..."
Chris Liechtifbdd8a02015-08-09 02:37:45 +02008#
Chris Liechti6fa82e12020-09-21 00:44:45 +02009# (C) 2001-2020 Chris Liechti <cliechti@gmx.net>
Chris Liechtifbdd8a02015-08-09 02:37:45 +020010#
11# SPDX-License-Identifier: BSD-3-Clause
Robert Smallshirea31f9ac2016-06-13 10:19:38 +020012import io
13import os
14import re
cliechtiff945632009-07-25 01:15:00 +000015
Steven Michalskeb028b252015-08-06 22:29:23 -070016try:
17 from setuptools import setup
18except ImportError:
19 from distutils.core import setup
cliechti5600e7c2003-11-06 22:17:21 +000020
Robert Smallshirea31f9ac2016-06-13 10:19:38 +020021
22def read(*names, **kwargs):
23 """Python 2 and Python 3 compatible text file reading.
24
25 Required for single-sourcing the version string.
26 """
27 with io.open(
28 os.path.join(os.path.dirname(__file__), *names),
29 encoding=kwargs.get("encoding", "utf8")
30 ) as fp:
31 return fp.read()
32
33
34def find_version(*file_paths):
35 """
36 Search the file for a version string.
37
38 file_path contain string path components.
39
40 Reads the supplied Python module as text without importing it.
41 """
42 version_file = read(*file_paths)
43 version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]",
44 version_file, re.M)
45 if version_match:
46 return version_match.group(1)
47 raise RuntimeError("Unable to find version string.")
48
49
50version = find_version('serial', '__init__.py')
51
cliechtif0c9f512011-03-18 11:16:15 +000052
cliechti89b4af12002-02-12 23:24:41 +000053setup(
Chris Liechti8813f572016-01-31 23:28:33 +010054 name="pyserial",
55 description="Python Serial Port Extension",
56 version=version,
57 author="Chris Liechti",
58 author_email="cliechti@gmx.net",
59 url="https://github.com/pyserial/pyserial",
60 packages=['serial', 'serial.tools', 'serial.urlhandler', 'serial.threaded'],
Chris Liechti9852c302016-03-18 23:01:49 +010061 license="BSD",
Chris Liechtibf6d3aa2016-04-28 23:49:37 +020062 long_description="""\
63Python Serial Port Extension for Win32, OSX, Linux, BSD, Jython, IronPython
64
65Stable:
66
67- Documentation: http://pythonhosted.org/pyserial/
68- Download Page: https://pypi.python.org/pypi/pyserial
69
70Latest:
71
72- Documentation: http://pyserial.readthedocs.io/en/latest/
73- Project Homepage: https://github.com/pyserial/pyserial
74""",
Chris Liechti8813f572016-01-31 23:28:33 +010075 classifiers=[
cliechti8db88b62003-09-10 20:14:53 +000076 'Development Status :: 5 - Production/Stable',
77 'Intended Audience :: Developers',
78 'Intended Audience :: End Users/Desktop',
Chris Liechti80e2ae22015-08-04 02:59:50 +020079 'License :: OSI Approved :: BSD License',
cliechti8db88b62003-09-10 20:14:53 +000080 'Natural Language :: English',
81 'Operating System :: POSIX',
82 'Operating System :: Microsoft :: Windows',
Chris Liechti72726d72015-10-23 22:03:04 +020083 'Operating System :: MacOS :: MacOS X',
cliechti8db88b62003-09-10 20:14:53 +000084 'Programming Language :: Python',
cliechti1eb947d2009-07-25 00:44:23 +000085 'Programming Language :: Python :: 2',
cliechti07709e42010-05-21 00:30:09 +000086 'Programming Language :: Python :: 2.7',
cliechti1eb947d2009-07-25 00:44:23 +000087 'Programming Language :: Python :: 3',
Chris Liechti80e2ae22015-08-04 02:59:50 +020088 'Programming Language :: Python :: 3.4',
89 'Programming Language :: Python :: 3.5',
Chris Liechti4f988d42017-03-20 23:59:40 +010090 'Programming Language :: Python :: 3.6',
Chris Liechti6ae64c12020-09-21 02:38:31 +020091 'Programming Language :: Python :: 3.7',
92 'Programming Language :: Python :: 3.8',
cliechti8db88b62003-09-10 20:14:53 +000093 'Topic :: Communications',
94 'Topic :: Software Development :: Libraries',
cliechtiff945632009-07-25 01:15:00 +000095 'Topic :: Software Development :: Libraries :: Python Modules',
cliechti8db88b62003-09-10 20:14:53 +000096 'Topic :: Terminals :: Serial',
97 ],
Chris Liechti8813f572016-01-31 23:28:33 +010098 platforms='any',
Chris Liechti6ae64c12020-09-21 02:38:31 +020099 entry_points = {
100 'console_scripts': [
101 'pyserial-miniterm=serial.tools.miniterm:main',
102 'pyserial-ports=serial.tools.list_ports:main'
103 ],
104 },
Diego Elio Pettenò8b24cbb2019-02-08 12:02:34 +0000105 extras_require = {
106 'cp2110': ['hidapi'],
107 },
cliechti54f69b62009-07-21 19:48:41 +0000108)