From 10764f5849d6231593832e1d7d6a46709521b55b Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Tue, 22 Apr 2008 10:58:56 -0400 Subject: [PATCH] Remove non-existent stuff from MANIFEST.in. Update aksetup. --- MANIFEST.in | 3 +-- aksetup_helper.py | 43 ++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 43 insertions(+), 3 deletions(-) diff --git a/MANIFEST.in b/MANIFEST.in index e85f071..7925243 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,7 +1,5 @@ include src/cpp/*.h include src/cpp/*.hpp -include src/wrapper/*.h -include src/wrapper/*.hpp include LICENSE include test/*.py include test/clean.sh @@ -10,3 +8,4 @@ include ez_setup.py include configure include Makefile.in include aksetup_helper.py +include README_SETUP.txt diff --git a/aksetup_helper.py b/aksetup_helper.py index e0ba249..af6139d 100644 --- a/aksetup_helper.py +++ b/aksetup_helper.py @@ -1,3 +1,4 @@ +# dealings with ez_setup ------------------------------------------------------ import ez_setup ez_setup.use_setuptools() @@ -10,10 +11,50 @@ def setup(*args, **kwargs): try: setup(*args, **kwargs) except: - traceback.print_exc() print "--------------------------------------------------------------------------" print "Sorry, your build failed. Try rerunning configure with different options." print "--------------------------------------------------------------------------" + raise + + + + +class NumpyExtension(Extension): + # nicked from + # http://mail.python.org/pipermail/distutils-sig/2007-September/008253.html + # solution by Michael Hoffmann + def __init__(self, *args, **kwargs): + Extension.__init__(self, *args, **kwargs) + self._include_dirs = self.include_dirs + del self.include_dirs # restore overwritten property + + def get_numpy_incpath(self): + from imp import find_module + # avoid actually importing numpy, it screws up distutils + file, pathname, descr = find_module("numpy") + from os.path import join + return join(pathname, "core", "include") + + @property + def include_dirs(self): + return self._include_dirs + [self.get_numpy_incpath()] + + + + +class PyUblasExtension(NumpyExtension): + def get_pyublas_incpath(self): + from imp import find_module + file, pathname, descr = find_module("pyublas") + from os.path import join + return join(pathname, "..", "include") + + @property + def include_dirs(self): + return self._include_dirs + [ + self.get_numpy_incpath(), + self.get_pyublas_incpath(), + ] -- GitLab