-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathsetup.py
More file actions
66 lines (56 loc) · 1.49 KB
/
setup.py
File metadata and controls
66 lines (56 loc) · 1.49 KB
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
#!/usr/bin/python
# coding: utf8
from setuptools.command.test import test as TestCommand
import sys
import os
import logging
import re
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
with open('README.md') as readme_file:
readme = readme_file.read()
# parse version
with open(os.path.join(os.path.abspath(os.path.dirname(__file__)),
"simple_hdlc", "__init__.py")) as fdp:
pattern = re.compile(r".*__version__ = '(.*?)'", re.S)
VERSION = pattern.match(fdp.read()).group(1)
test_requirements = [
"pytest"
]
reqs = [
"pyserial",
"pythoncrc",
"six"
]
class PyTest(TestCommand):
def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = []
self.test_suite = True
def run_tests(self):
import pytest
logging.basicConfig(level=logging.INFO)
errcode = pytest.main(self.test_args)
sys.exit(errcode)
setup(
name='simple-hdlc',
version=VERSION,
description="Simple HDLC Protocol",
long_description=readme,
long_description_content_type='text/markdown',
author="Matthias Wutte",
author_email='matthias.wutte@gmail.com',
url='https://github.com/wuttem/simple-hdlc',
packages=[
'simple_hdlc',
],
include_package_data=True,
install_requires=reqs,
zip_safe=False,
keywords='simple-hdlc',
test_suite='tests',
tests_require=test_requirements,
cmdclass={'test': PyTest},
)