-
Notifications
You must be signed in to change notification settings - Fork 61
/
Copy pathsetup.py
127 lines (110 loc) · 2.88 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
#!/usr/bin/env python
"""
setup.py file for GridDB python client
"""
from distutils.command.build import build
import os
try:
from setuptools import setup, Extension
except ImportError:
from distutils.core import setup, Extension
try:
with open('README.rst') as f:
readme = f.read()
except IOError:
readme = ''
os.environ["CXX"] = "g++"
os.environ["CC"] = "g++"
SOURCES = [
'src/AggregationResult.cpp',
'src/Container.cpp',
'src/ContainerInfo.cpp',
'src/Field.cpp',
'src/PartitionController.cpp',
'src/Query.cpp',
'src/QueryAnalysisEntry.cpp',
'src/RowKeyPredicate.cpp',
'src/RowList.cpp',
'src/RowSet.cpp',
'src/Store.cpp',
'src/StoreFactory.cpp',
'src/TimeSeriesProperties.cpp',
'src/TimestampUtils.cpp',
'src/griddb.i',
'src/Util.cpp'
]
DEPENDENTS = [
'src/AggregationResult.h',
'src/ContainerInfo.h',
'src/Container.h',
'src/ExpirationInfo.h',
'src/Field.h'
'src/GSException.h',
'src/PartitionController.h',
'src/Query.h',
'src/QueryAnalysisEntry.h',
'src/RowKeyPredicate.h',
'src/RowList.h',
'src/RowSet.h',
'src/Store.h',
'src/StoreFactory.h',
'src/TimeSeriesProperties.h',
'src/TimestampUtils.h',
'src/gstype_python.i',
'src/gstype.i',
'src/Util.h',
'include/gridstore.h'
]
INCLUDES = [
'include',
'src',
os.environ['HOME'] + '/.pyenv/versions/3.6.9/lib/python3.6/site-packages/numpy/core/include/'
]
COMPILE_ARGS = [
'-std=c++0x'
]
LIBRARIES = [
'rt',
'gridstore'
]
SWIG_OPTS = [
'-DSWIGWORDSIZE64',
'-c++',
'-outdir',
'.',
'-Isrc'
]
class CustomBuild(build):
sub_commands = [
('build_ext', build.has_ext_modules),
('build_py', build.has_pure_modules),
('build_clib', build.has_c_libraries),
('build_scripts', build.has_scripts)
]
griddb_module = Extension('_griddb_python',
sources=SOURCES,
include_dirs=INCLUDES,
libraries=LIBRARIES,
extra_compile_args=COMPILE_ARGS,
swig_opts=SWIG_OPTS,
depends=DEPENDENTS
)
classifiers = [
"License :: OSI Approved :: Apache Software License",
"Operating System :: POSIX :: Linux",
"Programming Language :: Python :: 3.6"
]
setup(name='griddb_python',
version='0.8.3',
author='Katsuhiko Nonomura',
author_email='contact@griddb.org',
description='GridDB Python Client Library built using SWIG',
long_description=readme,
ext_modules=[griddb_module],
py_modules=['griddb_python'],
url='https://github.com/griddb/python_client/',
license='Apache Software License',
cmdclass={'build': CustomBuild},
long_description_content_type = 'text/x-rst',
classifiers=classifiers
)