[Numpy-svn] r3636 - in trunk/numpy: distutils lib

numpy-svn@scip... numpy-svn@scip...
Sun Apr 1 15:32:10 CDT 2007


Author: cookedm
Date: 2007-04-01 15:32:07 -0500 (Sun, 01 Apr 2007)
New Revision: 3636

Modified:
   trunk/numpy/distutils/misc_util.py
   trunk/numpy/lib/utils.py
Log:
Make numpy.get_include() and numpy.get_numarray_include() not pull in numpy.distutils.


Modified: trunk/numpy/distutils/misc_util.py
===================================================================
--- trunk/numpy/distutils/misc_util.py	2007-04-01 20:12:27 UTC (rev 3635)
+++ trunk/numpy/distutils/misc_util.py	2007-04-01 20:32:07 UTC (rev 3636)
@@ -1372,14 +1372,7 @@
     include_dirs = Configuration.numpy_include_dirs[:]
     if not include_dirs:
         import numpy
-        if numpy.show_config is None:
-            # running from numpy_core source directory
-            include_dirs.append(njoin(os.path.dirname(numpy.__file__),
-                                             'core', 'include'))
-        else:
-            # using installed numpy core headers
-            import numpy.core as core
-            include_dirs.append(njoin(os.path.dirname(core.__file__), 'include'))
+        include_dirs = [ numpy.get_include() ]
     # else running numpy/core/setup.py
     return include_dirs
 

Modified: trunk/numpy/lib/utils.py
===================================================================
--- trunk/numpy/lib/utils.py	2007-04-01 20:12:27 UTC (rev 3635)
+++ trunk/numpy/lib/utils.py	2007-04-01 20:32:07 UTC (rev 3636)
@@ -1,3 +1,4 @@
+import os
 import sys
 import inspect
 import types
@@ -40,10 +41,15 @@
       Extension('extension_name', ...
                 include_dirs=[numpy.get_include()])
     """
-    from numpy.distutils.misc_util import get_numpy_include_dirs
-    include_dirs = get_numpy_include_dirs()
-    assert len(include_dirs)==1,`include_dirs`
-    return include_dirs[0]
+    import numpy
+    if numpy.show_config is None:
+        # running from numpy source directory
+        d = os.path.join(os.path.dirname(numpy.__file__), 'core', 'include')
+    else:
+        # using installed numpy core headers
+        import numpy.core as core
+        d = os.path.join(os.path.dirname(core.__file__), 'include')
+    return d
 
 def get_numarray_include(type=None):
     """Return the directory in the package that contains the numpy/*.h header
@@ -54,15 +60,14 @@
 
       import numpy
       Extension('extension_name', ...
-                include_dirs=[numpy.get_include()])
+                include_dirs=[numpy.get_numarray_include()])
     """
     from numpy.numarray import get_numarray_include_dirs
-    from numpy.distutils.misc_util import get_numpy_include_dirs
     include_dirs = get_numarray_include_dirs()
     if type is None:
         return include_dirs[0]
     else:
-        return include_dirs + get_numpy_include_dirs()
+        return include_dirs + [get_include()]
 
 
 if sys.version_info < (2, 4):



More information about the Numpy-svn mailing list