From 93377e41b6c8427fa71497431a03f53e85211bbf Mon Sep 17 00:00:00 2001 From: Jakob Lombacher Date: Fri, 22 May 2015 14:14:50 +0200 Subject: [PATCH 1/2] Requirements for setup (numpy, Cython) added --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 1108fa893..6523ce8db 100755 --- a/setup.py +++ b/setup.py @@ -136,6 +136,6 @@ def run(self): ext_modules = [Extension('h5py.x',['x.c'])], # To trick build into running build_ext requires = ['numpy (>=1.6.1)', 'Cython (>=0.17)'], install_requires = ['numpy>=1.6.1', 'Cython>=0.17', 'six'], - setup_requires = ['pkgconfig', 'six'], + setup_requires = ['numpy>=1.6.1', 'Cython>=0.17', 'pkgconfig', 'six'], cmdclass = CMDCLASS, ) From ab38f553ee520b5ee2c90193917a8989c4b23e87 Mon Sep 17 00:00:00 2001 From: Jakob Lombacher Date: Sat, 23 May 2015 15:15:13 +0200 Subject: [PATCH 2/2] 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 bc3a8b065..ccc0f27a1 100644 --- a/setup_build.py +++ b/setup_build.py @@ -83,7 +83,14 @@ def _make_extensions(config): 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()]