From db4df7327dff522d61f3f6e44072dc2fad5551a6 Mon Sep 17 00:00:00 2001 From: Anirudha Bose Date: Thu, 26 May 2016 04:49:48 +0530 Subject: [PATCH] pybind: Do not import Cython when invoked using --without-cython Signed-off-by: Anirudha Bose --- src/pybind/rados/setup.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) 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( -- 2.47.3