forked from stormpath/stormpath-sdk-python
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
119 lines (90 loc) · 3.29 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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
"""Python packaging stuff."""
from os import chdir, system
from os.path import abspath, dirname, join, normpath
from subprocess import call
from sys import exit, version_info
from setuptools import setup, find_packages, Command
from stormpath import __version__
PY_VERSION = version_info[:2]
class BaseCommand(Command):
user_options = []
def pytest(self, *args):
ret = call(['py.test', '--quiet', '--cov-report=term-missing', '--cov', 'stormpath'] + list(args))
exit(ret)
def initialize_options(self):
pass
def finalize_options(self):
pass
class TestCommand(BaseCommand):
description = 'run self-tests'
def run(self):
self.pytest('--ignore', 'tests/live', 'tests')
class ReleaseCommand(BaseCommand):
description = 'cut a new PyPI release'
def run(self):
call(['rm', '-rf', 'build', 'dist'])
ret = call(['python', 'setup.py', 'sdist', 'bdist_wheel', '--universal', 'upload'])
exit(ret)
class LiveTestCommand(BaseCommand):
description = 'run live-tests'
def run(self):
self.pytest('tests/live')
class DocCommand(BaseCommand):
description = 'generate documentation'
def run(self):
try:
chdir('docs')
ret = system('make html')
exit(ret)
except OSError as e:
print(e)
exit(-1)
setup(
name = 'stormpath',
version = __version__,
description = 'Official Stormpath SDK, used to interact with the Stormpath REST API.',
author = 'Stormpath, Inc.',
author_email = '[email protected]',
url = 'https://github.com/stormpath/stormpath-sdk-python',
zip_safe = False,
keywords = ['stormpath', 'authentication', 'users', 'security'],
install_requires = [
'PyJWT>=1.0.0',
'oauthlib>=0.6.3',
'requests>=2.4.3',
'six>=1.6.1',
'python-dateutil>=2.4.0',
'pydispatcher>=2.0.5',
'isodate>=0.5.4',
],
extras_require = {
'test': ['codacy-coverage', 'mock', 'python-coveralls', 'pytest', 'pytest-cov'],
},
packages = find_packages(exclude=['*.tests', '*.tests.*', 'tests.*', 'tests']),
classifiers = [
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'License :: OSI Approved :: Apache Software License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
'Topic :: Internet :: WWW/HTTP :: Site Management',
'Topic :: Security',
'Topic :: Security :: Cryptography',
'Topic :: Software Development :: Libraries :: Python Modules',
'Topic :: Software Development :: Libraries',
],
cmdclass = {
'test': TestCommand,
'livetest': LiveTestCommand,
'docs': DocCommand,
'release': ReleaseCommand,
},
long_description = open(normpath(join(dirname(abspath(__file__)), 'README.rst'))).read(),
)