forked from heavyai/pymapd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
109 lines (92 loc) · 3.01 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
import sys
import os
from codecs import open
from setuptools import setup
from setuptools.extension import Extension
try:
from Cython.Build import cythonize
import numpy as np
except ImportError:
build_extensions = False
else:
build_extensions = True
here = os.path.abspath(os.path.dirname(__file__))
# Get the long description from the README file
with open(os.path.join(here, 'README.rst'), encoding='utf-8') as f:
long_description = f.read()
install_requires = ['six', 'thrift', 'sqlalchemy']
# Optional Requirements
doc_requires = ['sphinx', 'numpydoc', 'sphinx-rtd-theme']
test_requires = ['coverage', 'pytest', 'pytest-mock']
dev_requires = doc_requires + test_requires
gpu_requires = ['pygdf', 'libgdf']
arrow_requires = ['pyarrow']
complete_requires = dev_requires + gpu_requires + arrow_requires
if sys.version_info.major == 2:
test_requires.append("mock")
extra_requires = {
'docs': doc_requires,
'test': test_requires,
'dev': dev_requires,
'gpu': gpu_requires,
'arrow': arrow_requires,
'complete': complete_requires,
}
# ------------
# C Extensions
# ------------
if build_extensions and not sys.platform.startswith('win'):
try:
import pyarrow
except ImportError:
extensions = []
else:
home = os.path.dirname(pyarrow.__file__)
include = os.path.join(home, 'include')
link_args = []
if sys.platform == "darwin":
link_args.append('-Wl,-rpath,@loader_path/pyarrow')
else:
link_args.append("-Wl,-rpath,$ORIGIN/pyarrow")
extensions = [
Extension(
"pymapd.shm",
["pymapd/shm.pyx"],
libraries=['arrow', 'arrow_python'],
include_dirs=[np.get_include(), include],
extra_compile_args=['-std=c++11'],
extra_link_args=['-std=c++11'],
language="c++",
),
]
extra_kwargs = dict(ext_modules=cythonize(extensions))
else:
extra_kwargs = dict()
setup(
name='pymapd',
description='A python DB API 2 compatible client for mapd.',
long_description=long_description,
url='https://github.com/mapd/mapd-core',
author='Tom Augspurger',
author_email='[email protected]',
license='Apache Software License',
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'Topic :: Database',
'Topic :: Scientific/Engineering',
'License :: OSI Approved :: Apache Software License',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
],
packages=['pymapd', 'mapd'],
use_scm_version=True,
setup_requires=['setuptools_scm'],
install_requires=install_requires,
extras_require=extra_requires,
**extra_kwargs
)