[h5py] 12/38: Fix building error if numpy is not installed before

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Thu Jul 2 18:21:38 UTC 2015


This is an automated email from the git hooks/post-receive script.

ghisvail-guest pushed a commit to branch master
in repository h5py.

commit ab38f553ee520b5ee2c90193917a8989c4b23e87
Author: Jakob Lombacher <Jakob at Lombacher.net>
Date:   Sat May 23 15:15:13 2015 +0200

    Fix building error if numpy is not installed before
---
 setup_build.py | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/setup_build.py b/setup_build.py
index bc3a8b0..ccc0f27 100644
--- a/setup_build.py
+++ b/setup_build.py
@@ -83,7 +83,14 @@ class h5py_build_ext(build_ext):
         except EnvironmentError:
             pass
 
-        settings['include_dirs'] += [numpy.get_include()]
+        try:
+            numpy_includes = numpy.get_include()
+        except AttributeError:
+            # if numpy is not installed get the headers from the .egg directory
+            import numpy.core
+            numpy_includes = os.path.join(os.path.dirname(numpy.core.__file__), 'include')
+
+        settings['include_dirs'] += [numpy_includes]
         if config.mpi:
             import mpi4py
             settings['include_dirs'] += [mpi4py.get_include()]

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/h5py.git



More information about the debian-science-commits mailing list