[Numpy-svn] r4460 - in branches/numpy.scons/numpy/distutils: . command scons/core

numpy-svn@scip... numpy-svn@scip...
Thu Nov 15 04:42:55 CST 2007


Author: cdavid
Date: 2007-11-15 04:42:48 -0600 (Thu, 15 Nov 2007)
New Revision: 4460

Modified:
   branches/numpy.scons/numpy/distutils/command/scons.py
   branches/numpy.scons/numpy/distutils/misc_util.py
   branches/numpy.scons/numpy/distutils/numpy_distribution.py
   branches/numpy.scons/numpy/distutils/scons/core/extension_scons.py
Log:
Add pkg_name in scons data in distutils distribution, for correct installation in sub package only build

Modified: branches/numpy.scons/numpy/distutils/command/scons.py
===================================================================
--- branches/numpy.scons/numpy/distutils/command/scons.py	2007-11-15 10:21:46 UTC (rev 4459)
+++ branches/numpy.scons/numpy/distutils/command/scons.py	2007-11-15 10:42:48 UTC (rev 4460)
@@ -150,10 +150,12 @@
             self.sconscripts = self.distribution.get_scons_scripts()
             self.pre_hooks = self.distribution.get_scons_pre_hooks()
             self.post_hooks = self.distribution.get_scons_post_hooks()
+            self.pkg_names = self.distribution.get_scons_parent_names()
         else:
             self.sconscripts = []
             self.pre_hooks = []
             self.post_hooks = []
+            self.pkg_names = []
 
         # Try to get the same compiler than the ones used by distutils: this is
         # non trivial because distutils and scons have totally different
@@ -207,8 +209,9 @@
         scons_exec = get_python_exec_invoc()
         scons_exec += ' ' + protect_path(pjoin(get_scons_local_path(), 'scons.py'))
 
-        for sconscript, pre_hook, post_hook in zip(self.sconscripts,
-                                                   self.pre_hooks, self.post_hooks):
+        for sconscript, pre_hook, post_hook, pkg_name in zip(self.sconscripts,
+                                                   self.pre_hooks, self.post_hooks,
+                                                   self.pkg_names):
             if pre_hook:
                 pre_hook()
 
@@ -216,6 +219,7 @@
             if self.jobs:
                 cmd.append(" --jobs=%d" % int(self.jobs))
             cmd.append('src_dir="%s"' % pdirname(sconscript))
+            cmd.append('pkg_name="%s"' % pkg_name)
             cmd.append('distutils_libdir=%s' % protect_path(pjoin(self.build_lib,
                                                                 pdirname(sconscript))))
 

Modified: branches/numpy.scons/numpy/distutils/misc_util.py
===================================================================
--- branches/numpy.scons/numpy/distutils/misc_util.py	2007-11-15 10:21:46 UTC (rev 4459)
+++ branches/numpy.scons/numpy/distutils/misc_util.py	2007-11-15 10:42:48 UTC (rev 4460)
@@ -1200,7 +1200,8 @@
             dist.scons_data.append((fullsconsname, 
                                     pre_hook, 
                                     post_hook,
-                                    full_source_files))
+                                    full_source_files,
+                                    parent_name))
             self.warn('distutils distribution has been initialized,'\
                       ' it may be too late to add a subpackage '+ subpackage_name)
             # XXX: we add a fake extension, to correctly initialize some
@@ -1210,7 +1211,8 @@
             self.scons_data.append((fullsconsname, 
                                     pre_hook, 
                                     post_hook,
-                                    full_source_files))
+                                    full_source_files,
+                                    parent_name))
             # XXX: we add a fake extension, to correctly initialize some
             # options in distutils command.
             self.add_extension('', sources = [])

Modified: branches/numpy.scons/numpy/distutils/numpy_distribution.py
===================================================================
--- branches/numpy.scons/numpy/distutils/numpy_distribution.py	2007-11-15 10:21:46 UTC (rev 4459)
+++ branches/numpy.scons/numpy/distutils/numpy_distribution.py	2007-11-15 10:42:48 UTC (rev 4460)
@@ -24,3 +24,5 @@
     def get_scons_sources(self):
         return [i[3] for i in self.scons_data]
 
+    def get_scons_parent_names(self):
+        return [i[4] for i in self.scons_data]

Modified: branches/numpy.scons/numpy/distutils/scons/core/extension_scons.py
===================================================================
--- branches/numpy.scons/numpy/distutils/scons/core/extension_scons.py	2007-11-15 10:21:46 UTC (rev 4459)
+++ branches/numpy.scons/numpy/distutils/scons/core/extension_scons.py	2007-11-15 10:42:48 UTC (rev 4460)
@@ -1,5 +1,5 @@
 #! /usr/bin/env python
-# Last Change: Mon Nov 12 07:00 PM 2007 J
+# Last Change: Thu Nov 15 07:00 PM 2007 J
 
 # Module for support to build python extension. scons specific code goes here.
 import sys
@@ -87,7 +87,7 @@
         # XXX: When those should be used ? (which version of Mac OS X ?)
         LINKFLAGS += ' -undefined dynamic_lookup '
     else:
-	pass
+        pass
 
     # Use LoadableModule because of Mac OS X
     # ... but scons has a bug (#issue 1669) with mingw and Loadable



More information about the Numpy-svn mailing list