Skip to content

Commit db2ae96

Browse files
committed
add files for python package
1 parent 884894f commit db2ae96

4 files changed

Lines changed: 156 additions & 0 deletions

File tree

MANIFEST.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
include LICENSE
2+
graft include
3+
include src/*.h src/*.i

README.rst

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
==============================================
2+
GridDB Python Client Library built using SWIG
3+
==============================================
4+
5+
GridDB (https://github.com/griddb/griddb_nosql) is a highly scalable NoSQL database best suited for IoT and Big Data.
6+
This is Python Client Library for GridDB.
7+
8+
Installation
9+
=========================
10+
11+
Package dependencies
12+
13+
* GridDB C Client
14+
15+
16+
Download and install RPM or DEB package in GridDB C Client (https://github.com/griddb/c_client/releases).
17+
18+
Install RPM package by this command:
19+
20+
$ sudo yum localinstall package_name.rpm
21+
22+
Install DEB package by this command:
23+
24+
$ sudo dpkg -i package_name.deb
25+
26+
Install the package by the following:
27+
28+
$ pip3 install griddb_python
29+

setup.cfg

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[meta_data]
2+
license_files = LICENSE
3+

setup.py

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
#!/usr/bin/env python
2+
3+
"""
4+
setup.py file for GridDB python client
5+
"""
6+
7+
from distutils.command.build import build
8+
9+
try:
10+
from setuptools import setup, Extension
11+
except ImportError:
12+
from distutils.core import setup, Extension
13+
14+
try:
15+
with open('README.rst') as f:
16+
readme = f.read()
17+
except IOError:
18+
readme = ''
19+
20+
SOURCES = [
21+
'src/AggregationResult.cpp',
22+
'src/Container.cpp',
23+
'src/ContainerInfo.cpp',
24+
'src/Field.cpp',
25+
'src/PartitionController.cpp',
26+
'src/Query.cpp',
27+
'src/QueryAnalysisEntry.cpp',
28+
'src/RowKeyPredicate.cpp',
29+
'src/RowSet.cpp',
30+
'src/Store.cpp',
31+
'src/StoreFactory.cpp',
32+
'src/TimeSeriesProperties.cpp',
33+
'src/TimestampUtils.cpp',
34+
'src/griddb.i',
35+
'src/Util.cpp',
36+
]
37+
38+
DEPENDENTS = [
39+
'src/AggregationResult.h',
40+
'src/ContainerInfo.h',
41+
'src/Container.h',
42+
'src/ExpirationInfo.h',
43+
'src/Field.h'
44+
'src/GSException.h',
45+
'src/PartitionController.h',
46+
'src/Query.h',
47+
'src/QueryAnalysisEntry.h',
48+
'src/RowKeyPredicate.h',
49+
'src/RowSet.h',
50+
'src/Store.h',
51+
'src/StoreFactory.h',
52+
'src/TimeSeriesProperties.h',
53+
'src/TimestampUtils.h',
54+
'src/gstype_python.i',
55+
'src/gstype.i',
56+
'include/gridstore.h',
57+
'include/Util.h',
58+
]
59+
60+
INCLUDES = [
61+
'include',
62+
'src',
63+
]
64+
65+
COMPILE_ARGS = [
66+
'-std=c++0x'
67+
]
68+
69+
LIBRARIES = [
70+
'rt',
71+
'gridstore',
72+
]
73+
74+
SWIG_OPTS = [
75+
'-DSWIGWORDSIZE64',
76+
'-c++',
77+
'-outdir',
78+
'.',
79+
'-Isrc'
80+
]
81+
82+
83+
class CustomBuild(build):
84+
sub_commands = [
85+
('build_ext', build.has_ext_modules),
86+
('build_py', build.has_pure_modules),
87+
('build_clib', build.has_c_libraries),
88+
('build_scripts', build.has_scripts),
89+
]
90+
91+
92+
griddb_module = Extension('_griddb_python',
93+
sources=SOURCES,
94+
include_dirs=INCLUDES,
95+
libraries=LIBRARIES,
96+
extra_compile_args=COMPILE_ARGS,
97+
swig_opts=SWIG_OPTS,
98+
depends=DEPENDENTS,
99+
)
100+
101+
classifiers = [
102+
"License :: OSI Approved :: Apache Software License",
103+
"Operating System :: POSIX :: Linux",
104+
"Programming Language :: Python",
105+
"Programming Language :: Python :: 3.6",
106+
]
107+
108+
setup(name='griddb_python',
109+
version='0.8.2',
110+
author='Katsuhiko Nonomura',
111+
author_email='contact@griddb.org',
112+
description='GridDB Python Client Library built using SWIG',
113+
long_description=readme,
114+
ext_modules=[griddb_module],
115+
py_modules=['griddb_python'],
116+
url='https://github.com/griddb/python_client/',
117+
license='Apache Software License',
118+
cmdclass={'build': CustomBuild},
119+
long_description_content_type = 'text/x-rst',
120+
classifiers=classifiers,
121+
)

0 commit comments

Comments
 (0)