[Numpy-svn] r5583 - trunk/numpy

numpy-svn@scip... numpy-svn@scip...
Thu Jul 31 11:31:13 CDT 2008


Author: cdavid
Date: 2008-07-31 11:31:10 -0500 (Thu, 31 Jul 2008)
New Revision: 5583

Modified:
   trunk/numpy/setupscons.py
Log:
Handle inplace generation of __config__.

Modified: trunk/numpy/setupscons.py
===================================================================
--- trunk/numpy/setupscons.py	2008-07-31 16:30:44 UTC (rev 5582)
+++ trunk/numpy/setupscons.py	2008-07-31 16:31:10 UTC (rev 5583)
@@ -1,8 +1,12 @@
 #!/usr/bin/env python
+from os.path import join as pjoin
 
 def configuration(parent_package='',top_path=None):
     from numpy.distutils.misc_util import Configuration
-    config = Configuration('numpy',parent_package,top_path, setup_name = 'setupscons.py')
+    from numpy.distutils.misc_util import scons_generate_config_py
+
+    pkgname = 'numpy'
+    config = Configuration(pkgname,parent_package,top_path, setup_name = 'setupscons.py')
     config.add_subpackage('distutils')
     config.add_subpackage('testing')
     config.add_subpackage('f2py')
@@ -16,7 +20,16 @@
     config.add_subpackage('ma')
     config.add_data_dir('doc')
     config.add_data_dir('tests')
-    config.scons_make_config_py() # installs __config__.py
+
+    def add_config(*args, **kw):
+        # Generate __config__, handle inplace issues.
+        if kw['scons_cmd'].inplace:
+            target = pjoin(kw['pkg_name'], '__config__.py')
+        else:
+            target = pjoin(kw['scons_cmd'].build_lib, kw['pkg_name'], '__config__.py')
+        scons_generate_config_py(target)
+    config.add_sconscript(None, post_hook = add_config)
+
     return config
 
 if __name__ == '__main__':



More information about the Numpy-svn mailing list