forked from rhjdjong/SlipLib
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsetup.py
105 lines (80 loc) · 3.25 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# Copyright (c) 2020 Ruud de Jong
# This file is part of the SlipLib project which is released under the MIT license.
# See https://github.com/rhjdjong/SlipLib for details.
"""
Setup.py for module sliplib
Use ``pip install sliplib[test]`` to allow the tests to be run
Use ``pip install sliplib[dev]`` for development (including documentation)
"""
import os.path
from setuptools import setup, find_packages # Always prefer setuptools over distutils
version_dict = {}
with open(os.path.join('src', 'sliplib', 'version.py')) as version_file:
exec(version_file.read(), version_dict) # pylint: disable=exec-used
__version__ = version_dict['__version__']
del version_dict
def read_long_description(*filenames, **kwargs):
"""Get the long description from the relevant file"""
encoding = kwargs.get('encoding', 'utf-8')
separator = kwargs.get('sep', '\n')
buf = []
for filename in filenames:
with open(filename, encoding=encoding) as f:
buf.append(f.read())
return separator.join(buf)
long_description = read_long_description('README.rst')
TEST_REQUIRES = ['pytest>=5.4', 'pytest-mock', 'pytest-cov', 'pytest-pylint', 'mypy', 'pylint']
DOC_REQUIRES = ['sphinx', 'sphinx_rtd_theme']
DEV_REQUIRES = ['tox', 'wheel', 'twine']
INSTALL_REQUIRES = ['pyserial']
try:
from typing import Protocol
except ImportError:
INSTALL_REQUIRES.append('typing-extensions')
else:
del Protocol
setup(
name='sliplib',
# Versions should comply with PEP440. For a discussion on single-sourcing
# the version across setup.py and the project code, see
# https://packaging.python.org/en/latest/single_source_version.html
version=__version__,
description='Slip package',
long_description=long_description,
# The project's main homepage.
url='https://github.com/rhjdjong/SlipLib',
# Author details
author='Ruud de Jong',
author_email='ruud.de.jong@xs4all.nl',
# Choose your license
license='MIT',
# See https://pypi.python.org/pypi?%3Aaction=list_classifiers
classifiers=[
# How mature is this project? Common values are
# 3 - Alpha
# 4 - Beta
# 5 - Production/Stable
'Development Status :: 4 - Beta',
# Indicate who your project is intended for
'Intended Audience :: Developers',
# Pick your license as you wish (should match "license" above)
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Topic :: Software Development :: Libraries :: Python Modules',
],
# What does your project relate to?
keywords='slip message framing protocol RFC1055',
# You can just specify the packages manually here if your project is
# simple. Or you can use find_packages().
package_dir={'': 'src'},
packages=find_packages('src'),
install_requires=INSTALL_REQUIRES,
extras_require={
'docs': DOC_REQUIRES,
'dev': DEV_REQUIRES + DOC_REQUIRES + TEST_REQUIRES,
'test': TEST_REQUIRES
}
)