Skip to content

Commit

Permalink
Only 'cythonize' if Cython is installed.
Browse files Browse the repository at this point in the history
  • Loading branch information
stephan-hof committed Aug 16, 2015
1 parent 61e8ae7 commit 8481bc2
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
@@ -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',
Expand All @@ -32,10 +39,7 @@
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]),
Expand Down

0 comments on commit 8481bc2

Please sign in to comment.