From: Anirudha Bose Date: Wed, 25 May 2016 22:33:02 +0000 (+0530) Subject: pybind: Add --without-cython to rados/setup.py to suppress cythonization X-Git-Tag: ses5-milestone5~486^2~8 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=84c1f1861bbba10c2a987d7e6584ffe484400524;p=ceph.git 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 --- diff --git a/src/pybind/rados/setup.py b/src/pybind/rados/setup.py index 76686c92fdc0..2303f1759bb0 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'],