]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
pybind: Add --without-cython to rados/setup.py to suppress cythonization
authorAnirudha Bose <ani07nov@gmail.com>
Wed, 25 May 2016 22:33:02 +0000 (04:03 +0530)
committerAnirudha Bose <ani07nov@gmail.com>
Sun, 19 Jun 2016 14:48:52 +0000 (20:18 +0530)
Pre-cythonized file rados.c is now included in the Git tree

Signed-off-by: Anirudha Bose <ani07nov@gmail.com>
src/pybind/rados/setup.py

index 76686c92fdc0e5ea4f7b196dde63782b73ca4a38..2303f1759bb09a972adebc9be8d10c47e99ac871 100755 (executable)
@@ -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'],