forked from zalando-stups/python-tokens
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
executable file
·68 lines (54 loc) · 1.91 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
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import sys
from setuptools import setup, find_packages
from setuptools.command.test import test as TestCommand
def read_version(package):
with open(os.path.join(package, '__init__.py'), 'r') as fd:
for line in fd:
if line.startswith('__version__ = '):
return line.split()[-1].strip().strip("'")
__version__ = read_version('tokens')
class PyTest(TestCommand):
user_options = [('cov-html=', None, 'Generate junit html report')]
def initialize_options(self):
TestCommand.initialize_options(self)
self.cov = None
self.pytest_args = ['--cov', 'tokens', '--cov-report', 'term-missing', '-v']
self.cov_html = False
def finalize_options(self):
TestCommand.finalize_options(self)
if self.cov_html:
self.pytest_args.extend(['--cov-report', 'html'])
def run_tests(self):
import pytest
errno = pytest.main(self.pytest_args)
sys.exit(errno)
setup(
name='stups-tokens',
packages=find_packages(),
version=__version__,
description='Python library to manage OAuth access tokens',
long_description=open('README.rst').read(),
author='Henning Jacobs',
author_email='[email protected]',
url='https://github.com/zalando-stups/python-tokens',
license='Apache License Version 2.0',
install_requires=['requests'],
tests_require=['pytest-cov', 'pytest', 'mock'],
extras_require={
'tests': ['flake8'],
},
cmdclass={'test': PyTest},
test_suite='tests',
classifiers=[
'Programming Language :: Python',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'Operating System :: OS Independent',
],
)