-
Notifications
You must be signed in to change notification settings - Fork 22
/
setup.py
107 lines (98 loc) · 3.4 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
#!/usr/bin/python
from setuptools import setup, Extension
from distutils.command.sdist import sdist
import os
cmdclass = {}
try:
from Cython.Distutils import build_ext
cmdclass['build_ext'] = build_ext
suffix = '.pyx'
except:
suffix = '.cpp'
# Ensure Cython .c files are up to date before uploading
def build_cython():
print '#' * 10, 'Cythonizing extensions.'
for f in os.popen('find spartan -name "*.pyx"').read().split('\n'):
if not f.strip(): continue
print'#' * 10, 'Cythonizing %s' % f
assert os.system('cython --cplus "%s"' % f) == 0
class cython_sdist(sdist):
'''Build Cython .c files for source distribution.'''
def run(self):
build_cython()
sdist.run(self)
cmdclass['sdist'] = cython_sdist
import numpy
ext_include_dirs = [numpy.get_include(),]
setup(
name='spartan',
version='0.06',
maintainer='Russell Power',
maintainer_email='[email protected]',
url='http://github.com/rjpower/spartan',
install_requires=[
'appdirs',
'numpy',
'cython',
'pyzmq',
'psutil',
'traits',
# 'yappi',
# 'parakeet',
],
classifiers=[
'Development Status :: 4 - Beta',
'Environment :: Other Environment',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Operating System :: POSIX',
'Programming Language :: Python',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
],
description='Distributed Numpy-like arrays.',
package_dir={'': '.'},
packages=['spartan',
'spartan.expr',
'spartan.rpc',
'spartan.array' ],
ext_modules = [
Extension('spartan.core', ['spartan/core' + suffix]),
Extension('spartan.examples.netflix_core',
['spartan/examples/netflix_core' + suffix],
include_dirs=ext_include_dirs,),
Extension('spartan.examples.cf.helper',
['spartan/examples/cf/helper' + suffix],
include_dirs=ext_include_dirs,),
Extension('spartan.rpc.serialization_buffer',
['spartan/rpc/serialization_buffer' + suffix],
include_dirs=ext_include_dirs,),
Extension('spartan.cloudpickle', ['spartan/cloudpickle' + suffix]),
Extension('spartan.rpc.serialization',
['spartan/rpc/serialization' + suffix],
language='c++',
extra_compile_args=["-std=c++0x"],
extra_link_args=["-std=c++11"]),
Extension('spartan.rpc.rlock',
['spartan/rpc/rlock' + suffix], language="c++"),
Extension('spartan.examples.sklearn.util.graph_shortest_path',
['spartan/examples/sklearn/util/graph_shortest_path' + suffix],
include_dirs=ext_include_dirs,),
Extension('spartan.array.sparse',
['spartan/array/sparse' + suffix],
language='c++',
include_dirs=ext_include_dirs,
extra_compile_args=["-std=c++11"],
extra_link_args=["-std=c++11"]),
Extension('spartan.array.extent',
['spartan/array/extent' + suffix],
include_dirs=ext_include_dirs,),
Extension('spartan.array.tile', ['spartan/array/tile' + suffix]),
Extension('spartan.expr.operator.tiling',
sources=['spartan/expr/operator/tiling.cc'],
language='c++',
extra_compile_args=["-std=c++0x"],
extra_link_args=["-std=c++11", "-fPIC"]),
],
cmdclass=cmdclass,
)