forked from pycassa/pycassa
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
144 lines (111 loc) · 3.75 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
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
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
try:
import subprocess
has_subprocess = True
except:
has_subprocess = False
try:
from ez_setup import use_setuptools
use_setuptools()
except ImportError:
pass
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
from distutils.cmd import Command
__version__ = "1.11.2"
long_description = """pycassa is a python client library for Apache Cassandra with the following features:
1. Auto-failover single or thread-local connections
2. Connection pooling
3. A batch interface
4. Simplified version of the Thrift interface
5. A method to map an existing class to a Cassandra column family
"""
class rpm(Command):
description = "builds a RPM package"
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
if has_subprocess:
status = subprocess.call(["python", "setup.py", "bdist_rpm", "--install-script", "rpm-install-script.sh"])
if status:
raise RuntimeError("RPM build failed")
print ""
print "RPM built"
else:
print """
`setup.py rpm` is not supported for this version of Python.
Please ask in the user forums for help.
"""
class doc(Command):
description = "generate or test documentation"
user_options = [("test", "t",
"run doctests instead of generating documentation")]
boolean_options = ["test"]
def initialize_options(self):
self.test = False
def finalize_options(self):
pass
def run(self):
if self.test:
path = "doc/_build/doctest"
mode = "doctest"
else:
path = "doc/_build/%s" % __version__
mode = "html"
try:
os.makedirs(path)
except:
pass
if has_subprocess:
status = subprocess.call(["sphinx-build", "-b", mode, "doc", path])
if status:
raise RuntimeError("documentation step '%s' failed" % mode)
print ""
print "Documentation step '%s' performed, results here:" % mode
print " %s/" % path
else:
print """
`setup.py doc` is not supported for this version of Python.
Please ask in the user forums for help.
"""
setup(
name = 'pycassa',
version = __version__,
author = 'Jonathan Hseu',
author_email = 'vomjom AT vomjom.net',
maintainer = 'Tyler Hobbs',
maintainer_email = '[email protected]',
description = 'Python client library for Apache Cassandra',
long_description = long_description,
url = 'http://github.com/pycassa/pycassa',
keywords = ['pycassa', 'cassandra', 'client', 'driver', 'db', 'distributed', 'thrift'],
packages = ['pycassa',
'pycassa.cassandra',
'pycassa.logging',
'pycassa.contrib'],
tests_require = ['nose'],
install_requires = ['thrift==0.9.3'],
py_modules=['ez_setup'],
scripts=['pycassaShell'],
cmdclass={"doc": doc, "rpm": rpm},
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Natural Language :: English',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 2 :: Only',
'Topic :: Software Development :: Libraries :: Python Modules'
]
)