From 8481bc2481e3341a0399f360b26df97af7617229 Mon Sep 17 00:00:00 2001 From: hofmockel <dreagonfly@gmx.de> Date: Sun, 16 Aug 2015 12:17:47 +0200 Subject: [PATCH] Only 'cythonize' if Cython is installed. --- setup.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/setup.py b/setup.py index 3f4bf6b..c95a1d5 100644 --- a/setup.py +++ b/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]), -- GitLab