From: Anirudha Bose Date: Wed, 25 May 2016 23:19:48 +0000 (+0530) Subject: pybind: Do not import Cython when invoked using --without-cython X-Git-Tag: ses5-milestone5~486^2~6 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=db4df7327dff522d61f3f6e44072dc2fad5551a6;p=ceph.git pybind: Do not import Cython when invoked using --without-cython Signed-off-by: Anirudha Bose --- diff --git a/src/pybind/rados/setup.py b/src/pybind/rados/setup.py index 2303f1759bb..f0d2b9bb98d 100755 --- a/src/pybind/rados/setup.py +++ b/src/pybind/rados/setup.py @@ -14,8 +14,6 @@ from distutils.errors import CompileError, LinkError from distutils.extension import Extension from distutils.sysconfig import customize_compiler -from Cython.Build import cythonize - # PEP 440 versioning of the Rados package on PyPI # Bump this version, after every changeset # NOTE: This version is not the same as get_ceph_version() @@ -115,13 +113,6 @@ def check_sanity(): if not check_sanity(): sys.exit(1) -# Disable cythonification if we're not really building anything -if (len(sys.argv) >= 2 and - any(i in sys.argv[1:] for i in ('--help', 'clean', 'egg_info', '--version') - )): - def cythonize(x, **kwargs): - return x - if '--without-cython' in sys.argv: if not os.path.isfile('rados.c'): print('Error: Cannot find Cythonized file rados.c', file=sys.stderr) @@ -136,8 +127,17 @@ if '--without-cython' in sys.argv: sys.argv.remove('--without-cython') source = "rados.c" else: + from Cython.Build import cythonize + source = "rados.pyx" +# Disable cythonification if we're not really building anything +if (len(sys.argv) >= 2 and + any(i in sys.argv[1:] for i in ('--help', 'clean', 'egg_info', '--version') + )): + def cythonize(x, **kwargs): + return x + flags = get_python_flags() setup(