This repository has been archived by the owner on Sep 19, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
setup.py
90 lines (80 loc) · 2.78 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
#!/usr/bin/env python3
import os
import platform
import sys
import pkgconfig
from Cython.Build import cythonize
from setuptools import Extension, setup, find_packages
extra_compile_args = [
'-std=c++11',
'-O3',
'-Wall',
'-Wextra',
'-Wconversion',
'-fno-strict-aliasing',
'-fno-rtti',
]
if sys.version_info < (3 , 0):
raise Exception('python-rocksdb requires Python 3.x')
try:
ext_args = pkgconfig.parse('rocksdb')
except pkgconfig.PackageNotFoundError:
include_path = os.environ.get('INCLUDE_PATH')
library_path = os.environ.get('LIBRARY_PATH')
ext_args = {
'include_dirs': include_path.split(os.pathsep) if include_path else [],
'library_dirs': library_path.split(os.pathsep) if library_path else [],
'libraries': ['rocksdb', 'snappy', 'bz2', 'z', 'lz4'],
}
if platform.system() == 'Darwin':
extra_compile_args += ['-mmacosx-version-min=10.9', '-stdlib=libc++']
if platform.system() == 'Windows':
extra_compile_args.remove('-Wextra')
extra_compile_args.remove('-Wconversion')
ext_args['libraries'].remove('z')
ext_args['libraries'].append('zlib')
rocksdb_extension = Extension(
'rocksdb._rocksdb',
[
os.path.join('rocksdb','_rocksdb.pyx'),
],
extra_compile_args=extra_compile_args,
language='c++',
**ext_args,
)
setup(
name="faust-streaming-rocksdb",
use_scm_version=True,
description="Python bindings for RocksDB, primarily for use with Faust",
keywords='rocksdb',
author='William Barnhart',
author_email="williambbarnhart@gmail.com",
url="https://github.com/faust-streaming/python-rocksdb",
license='BSD License',
setup_requires=['setuptools>=25', 'Cython>=0.20', 'setuptools_scm'],
install_requires=['setuptools>=25'],
package_dir={'rocksdb': 'rocksdb'},
packages=find_packages('.'),
ext_modules=cythonize([rocksdb_extension]),
classifiers=[
"Intended Audience :: Developers",
"Natural Language :: English",
"License :: OSI Approved :: BSD License",
"Programming Language :: Cython",
"Programming Language :: Python",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: Implementation :: CPython",
"Operating System :: POSIX",
"Operating System :: POSIX :: Linux",
"Operating System :: MacOS :: MacOS X",
"Topic :: Database",
"Development Status :: 7 - Inactive",
],
)