lbry-rocksdb/setup.py
Mehdi Abaakouk e4c0de9455 Allow to compile the extension everywhere
This change:
* uses to setuptools Cython automatic extension build system.
* Add tox.ini to run tests and build docs into virtualenv
* Add .travis.yaml and Dockerfile to run tests in CI
* Change requirements to ensure:
  - Cython and setuptools are installed before we build the Cython
    extension
  - tests dependencies are not installed by default
  - doc dependencies are explicit
* Add missing lz4 library
* Allow to build the module with any librocksdb headers (no-rtti)

Closes #15
2018-02-09 09:21:56 +01:00

46 lines
1.2 KiB
Python

import platform
from setuptools import setup
from setuptools import find_packages
from setuptools import Extension
extra_compile_args = [
'-std=c++11',
'-O3',
'-Wall',
'-Wextra',
'-Wconversion',
'-fno-strict-aliasing',
'-fno-rtti',
]
if platform.system() == 'Darwin':
extra_compile_args += ['-mmacosx-version-min=10.7', '-stdlib=libc++']
setup(
name="python-rocksdb",
version='0.6.8',
description="Python bindings for RocksDB",
keywords='rocksdb',
author='Ming Hsuan Tu',
author_email="qrnnis2623891@gmail.com",
url="https://github.com/twmht/python-rocksdb",
license='BSD License',
setup_requires=['setuptools>=25', 'Cython>=0.20'],
install_requires=['setuptools>=25'],
package_dir={'rocksdb': 'rocksdb'},
packages=find_packages('.'),
ext_modules=[Extension(
'rocksdb._rocksdb',
['rocksdb/_rocksdb.pyx'],
extra_compile_args=extra_compile_args,
language='c++',
libraries=['rocksdb', 'snappy', 'bz2', 'z', 'lz4'],
)],
extras_require={
"doc": ['sphinx_rtd_theme', 'sphinx'],
"test": ['pytest'],
},
include_package_data=True
)