Repository navigation
Expand file tree
/
Copy pathsetup.py
More file actions
127 lines (102 loc) · 2.88 KB
/
Copy pathsetup.py
File metadata and controls
127 lines (102 loc) · 2.88 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
import sys
import setuptools.command.build_py
import subprocess
from distutils.spawn import find_executable
from setuptools import setup, find_packages
PY3 = (sys.version_info.major == 3)
install_requires = [
"requests",
"posix_ipc",
"pyjwt",
]
tests_require = [
"nose",
"coverage",
"webtest",
]
if not PY3:
tests_require.append("mock")
install_requires.append("enum34")
extras_require = {
"gevent": [
"gevent",
],
"thrift": [
"thrift",
],
"pyramid": [
"pyramid",
],
"docs": [
"sphinx",
"sphinxcontrib-spelling",
"alabaster",
],
}
class BuildPyCommand(setuptools.command.build_py.build_py):
"""Custom build command for packaging."""
def _make_thrift(self):
"""Generate Baseplate Thrift definitions.
"""
# Verify build dependencies are installed.
if not find_executable('make'):
print("'make' not found.")
exit(1)
if not find_executable('thrift1'):
print("Thrift compiler not found.")
exit(1)
make_cmd = ['/usr/bin/make', 'thrift']
subprocess.check_call(make_cmd)
def run(self):
self._make_thrift()
setuptools.command.build_py.build_py.run(self)
setup(
name="baseplate",
description="A library to build services on",
long_description=open("README.rst").read(),
author="Neil Williams",
author_email="neil@reddit.com",
license="BSD",
url="https://baseplate.readthedocs.io/en/stable/",
version="0.27.0",
packages=find_packages(exclude=["tests", "tests.*"]),
install_requires=install_requires,
extras_require=extras_require,
test_suite="tests",
tests_require=tests_require,
scripts=[
"bin/baseplate-serve",
"bin/baseplate-script",
"bin/baseplate-tshell",
"bin/baseplate-healthcheck",
],
# the thrift compiler must be able to find baseplate.thrift to build
# services which extend BaseplateService.
package_data={
"baseplate.thrift": [
"*.thrift"
],
},
zip_safe=False,
entry_points={
"distutils.commands": [
"build_thrift = baseplate.integration.thrift.command:BuildThriftCommand",
],
"paste.app_factory": [
"main = baseplate.integration.pyramid:paste_make_app",
],
},
classifiers=[
"Development Status :: 5 - Production/Stable",
"License :: OSI Approved :: BSD License",
"Operating System :: POSIX :: Linux",
"Programming Language :: Python",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3.4",
"Topic :: Software Development :: Libraries",
"Topic :: Software Development :: Libraries :: Application Frameworks",
],
cmdclass={
'build_py': BuildPyCommand,
},
)