]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
pybind: Fix build and libs path in rados/setup.py
authorAnirudha Bose <ani07nov@gmail.com>
Fri, 27 May 2016 21:27:31 +0000 (02:57 +0530)
committerAnirudha Bose <ani07nov@gmail.com>
Sun, 19 Jun 2016 14:50:01 +0000 (20:20 +0530)
* Remove rados.c from Git tree
* Remove Python 2.6, 3.2, 3.3 from classifiers
* Export CEPH_LIB_DIR to setup.py files in pybind

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

index 9f779dd5f8ef47dfc9543b82b0ed39695ee7c8be..b3ecd7a46b8c1dd207e7dab1c3aadb6aa39607be 100644 (file)
@@ -13,6 +13,7 @@ PY_DISTUTILS = \
        CFLAGS="-iquote \${abs_srcdir}/include ${AM_CFLAGS} ${PYTHON_CFLAGS}" \
        LDFLAGS="-L\${abs_builddir}/.libs $(subst -pie,,${AM_LDFLAGS}) ${PYTHON_LDFLAGS}" \
        CYTHON_BUILD_DIR=$(CYTHON_BUILD_DIR) \
+       CEPH_LIB_DIR="$(abs_builddir)/.libs" \
        ${PYTHON} ./setup.py
 
 if WITH_RADOS
index 4bdfcbd89beed78d603630b177ae45a8d398d364..90d0763307c5e953cd71614e693de5cc542f80af 100755 (executable)
@@ -91,10 +91,14 @@ def check_sanity():
     if set(['MAKEFLAGS', 'MFLAGS', 'MAKELEVEL']).issubset(set(os.environ.keys())):
         # The setup.py has been invoked by a top-level Ceph make.
         # Set the appropriate CFLAGS and LDFLAGS
-        CEPH_ROOT = subprocess.check_output(['git', 'rev-parse', '--show-toplevel']).strip().decode('utf-8')
+        CEPH_SRC_DIR = os.path.join(
+            os.path.dirname(os.path.abspath(__file__)),
+            '..',
+            '..'
+        )
 
-        compiler.add_include_dir(os.path.join(CEPH_ROOT, 'src', 'include'))
-        compiler.add_library_dir(os.path.join(CEPH_ROOT, 'src', '.libs'))
+        compiler.add_include_dir(os.path.join(CEPH_SRC_DIR, 'include'))
+        compiler.add_library_dir(os.environ['CEPH_LIB_DIR'])
 
     try:
         compiler.link_executable(
@@ -119,22 +123,21 @@ def check_sanity():
 if not check_sanity():
     sys.exit(1)
 
-if '--without-cython' in sys.argv:
+try:
+    from Cython.Build import cythonize
+except ImportError:
+    print("WARNING: Cython is not installed.")
+
     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)
+        print('ERROR: Cannot find Cythonized file rados.c', file=sys.stderr)
         sys.exit(1)
+    else:
+        def cythonize(x, **kwargs):
+            return x
 
 
-    def cythonize(x, **kwargs):
-        return x
-
-
-    sys.argv.remove('--without-cython')
-    source = "rados.c"
+        source = "rados.c"
 else:
-    from Cython.Build import cythonize
-
     source = "rados.pyx"
 
 # Disable cythonification if we're not really building anything
@@ -177,10 +180,7 @@ setup(
         'License :: OSI Approved :: GNU Lesser General Public License v2 or later (LGPLv2+)',
         'Operating System :: POSIX :: Linux',
         'Programming Language :: Cython',
-        'Programming Language :: Python :: 2.6',
         'Programming Language :: Python :: 2.7',
-        'Programming Language :: Python :: 3.2',
-        'Programming Language :: Python :: 3.3',
         'Programming Language :: Python :: 3.4',
         'Programming Language :: Python :: 3.5'
     ],