-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
67 lines (53 loc) · 1.7 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
# coding: utf-8
import sys
from os.path import join, dirname
from setuptools import setup
from setuptools.command.test import test
import pplmyapi
def parse_reqs(f='requirements.txt'):
ret = []
with open(join(dirname(__file__), f)) as fp:
for l in fp.readlines():
l = l.strip()
if l and not l.startswith('#'):
ret.append(l)
return ret
install_requires, tests_require = parse_reqs(), parse_reqs('requirements-test.txt')
setup_requires = ['setuptools'] + install_requires
print('install_requires: ', install_requires)
print('tests_require: ', tests_require)
print('setup_requires: ', setup_requires)
with open('README.md') as readmefile:
long_description = readmefile.read()
class PyTest(test):
def finalize_options(self):
test.finalize_options(self)
self.test_args = []
self.test_suite = True
def run_tests(self):
# import here, cause outside the eggs aren't loaded
import pytest
errno = pytest.main(self.test_args)
sys.exit(errno)
setup(
name='pplmyapi',
version=pplmyapi.__versionstr__,
description='Python client for PPL myAPI',
long_description=long_description,
long_description_content_type='text/markdown',
author='Michal Půlpán',
author_email='michal@michalpulpan.cz',
license='MIT',
url='https://github.com/michalpulpan/pplmyapi',
packages=['pplmyapi',],
include_package_data=True,
classifiers=[
"Programming Language :: Python :: 3.9",
"Topic :: Utilities",
],
zip_safe=False,
setup_requires=setup_requires,
install_requires=install_requires,
tests_require=tests_require,
cmdclass={'test': PyTest}
)