From 84c1f1861bbba10c2a987d7e6584ffe484400524 Mon Sep 17 00:00:00 2001 From: Anirudha Bose Date: Thu, 26 May 2016 04:03:02 +0530 Subject: [PATCH] pybind: Add --without-cython to rados/setup.py to suppress cythonization Pre-cythonized file rados.c is now included in the Git tree Signed-off-by: Anirudha Bose --- src/pybind/rados/setup.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/pybind/rados/setup.py b/src/pybind/rados/setup.py index 76686c92fdc..2303f1759bb 100755 --- a/src/pybind/rados/setup.py +++ b/src/pybind/rados/setup.py @@ -122,6 +122,22 @@ if (len(sys.argv) >= 2 and 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) + print('Retry without using --without-cython', file=sys.stderr) + sys.exit(1) + + + def cythonize(x, **kwargs): + return x + + + sys.argv.remove('--without-cython') + source = "rados.c" +else: + source = "rados.pyx" + flags = get_python_flags() setup( @@ -141,7 +157,7 @@ setup( [ Extension( "rados", - ["rados.pyx"], + [source], include_dirs=flags['cflags']['I'], library_dirs=flags['ldflags']['L'], libraries=["rados"] + flags['ldflags']['l'], -- 2.47.3