Only 'cythonize' if Cython is installed.
This commit is contained in:
parent
61e8ae7668
commit
8481bc2481
1 changed files with 10 additions and 6 deletions
16
setup.py
16
setup.py
|
@ -1,11 +1,18 @@
|
|||
from setuptools import setup
|
||||
from setuptools import find_packages
|
||||
from distutils.extension import Extension
|
||||
from Cython.Build import cythonize
|
||||
|
||||
try:
|
||||
from Cython.Build import cythonize
|
||||
except ImportError:
|
||||
def cythonize(extensions): return extensions
|
||||
sources = ['rocksdb/_rocksdb.cpp']
|
||||
else:
|
||||
sources = ['rocksdb/_rocksdb.pyx']
|
||||
|
||||
mod1 = Extension(
|
||||
'rocksdb._rocksdb',
|
||||
['rocksdb/_rocksdb.pyx'],
|
||||
sources,
|
||||
extra_compile_args=[
|
||||
'-std=c++11',
|
||||
'-O3',
|
||||
|
@ -32,10 +39,7 @@ setup(
|
|||
author_email="Use the github issues",
|
||||
url="https://github.com/stephan-hof/pyrocksdb",
|
||||
license='BSD License',
|
||||
install_requires=[
|
||||
'setuptools',
|
||||
'Cython>=0.20',
|
||||
],
|
||||
install_requires=['setuptools'],
|
||||
package_dir={'rocksdb': 'rocksdb'},
|
||||
packages=find_packages('.'),
|
||||
ext_modules=cythonize([mod1]),
|
||||
|
|
Loading…
Reference in a new issue