diff --git a/MANIFEST.in b/MANIFEST.in index e85f07147744aa9ac92b29d8665d3fb86278ad86..7925243dce80a38f910c9e55f5f639e0890f234b 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 e0ba249e5f832aa7959572d2711a3b7c3144fb77..af6139d640bb8cf774a14e2b31b4e208a43a75bc 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(), + ]