forked from stormpath/stormpath-sdk-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
145 lines (113 loc) · 3.95 KB
/
setup.py
File metadata and controls
145 lines (113 loc) · 3.95 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
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
#
# Copyright 2012 - 2014 Stormpath, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
from setuptools import setup, find_packages, Command
import sys
import os
import subprocess
from stormpath import __version__
PY_VERSION = sys.version_info[:2]
class BaseCommand(Command):
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
class TestCommand(BaseCommand):
description = "run self-tests"
def run(self):
os.chdir('tests')
ret = subprocess.call(["py.test", "--quiet",
"--cov-report=term-missing", "--cov", "stormpath",
"--ignore", "test_live.py"])
sys.exit(ret)
class LiveTestCommand(BaseCommand):
description = "run live-tests"
def run(self):
os.chdir("tests")
ret = subprocess.call(["py.test", "--quiet",
"--cov-report=term-missing", "--cov", "stormpath", "test_live.py"])
sys.exit(ret)
class TestDepCommand(BaseCommand):
description = "install test dependencies"
def run(self):
cmd = ["pip", "install", "pytest", "pytest-cov"]
if PY_VERSION >= (3, 2):
cmd.append("mock")
cmd.append("httpretty==0.6.5")
else:
cmd.append("httpretty")
ret = subprocess.call(cmd)
sys.exit(ret)
class DocCommand(BaseCommand):
description = "generate documentation"
def run(self):
try:
os.chdir('doc')
ret = os.system('make html')
sys.exit(ret)
except OSError as e:
print(e)
sys.exit(-1)
# To install the stormpath library, open a Terminal shell, then run this
# file by typing:
#
# python setup.py install
classifiers = [
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 3',
]
setup(
name = 'stormpath',
version = __version__,
description = 'Official Stormpath SDK, used to interact with the Stormpath REST API.',
author = 'Stormpath, Inc.',
author_email = 'python@stormpath.com',
url = 'https://github.com/stormpath/stormpath-sdk-python',
zip_safe = False,
keywords = ['stormpath', 'authentication', 'users', 'security'],
install_requires = ['requests>=1.1.0'],
packages = find_packages(),
classifiers = [
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'License :: OSI Approved :: Apache Software License',
'Operating System :: OS Independent',
'Topic :: Security',
'Topic :: Software Development :: Libraries :: Python Modules',
'Topic :: Software Development :: Libraries',
].extend(classifiers),
cmdclass = {
'test': TestCommand,
'livetest': LiveTestCommand,
'testdep': TestDepCommand,
'docs': DocCommand,
},
long_description="""\
Stormpath SDK
-------------
DESCRIPTION
The Stormpath Python SDK allows any Python-based application to easily use
the Stormpath user management service for all authentication and
access control needs.
When you make SDK method calls, the calls are translated into HTTPS
requests to the Stormpath REST+JSON API. The Stormpath Python SDK provides
a clean object-oriented paradigm natural to Python developers and
alleviates the need to know how to make REST+JSON requests.
LICENSE
The Stormpath Python SDK is distributed under the Apache Software License.
""",
)