[Numpy-svn] r4056 - in branches/numpy.scons: . numpy numpy/distutils numpy/scons_fake

numpy-svn@scip... numpy-svn@scip...
Thu Sep 20 03:33:15 CDT 2007


Author: cdavid
Date: 2007-09-20 03:33:02 -0500 (Thu, 20 Sep 2007)
New Revision: 4056

Added:
   branches/numpy.scons/numpy/distutils/numpy_distribution.py
   branches/numpy.scons/numpy/scons_fake/
   branches/numpy.scons/numpy/scons_fake/setup.py
Modified:
   branches/numpy.scons/
   branches/numpy.scons/numpy/distutils/core.py
Log:
Replace distutils.Distribution by our own NumpyDistribution subclass, for scons support


Property changes on: branches/numpy.scons
___________________________________________________________________
Name: bzr:revision-info
   - timestamp: 2007-09-20 17:15:09.678999901 +0900
committer: david <david@david-laptop>
properties: 
	branch-nick: numpy.scons

   + timestamp: 2007-09-20 17:19:10.516000032 +0900
committer: david <david@david-laptop>
properties: 
	branch-nick: numpy.scons

Name: bzr:file-ids
   - 
   + numpy/scons_fake	scons_fake-20070920081521-unftng09muypbx5t-1
numpy/scons_fake/setup.py	setup.py-20070920081521-unftng09muypbx5t-2
numpy/distutils/numpy_distribution.py	numpy_distribution.p-20070920081526-b24h80xbm48z2tfx-1

Name: bzr:revision-id:v3-trunk0
   - 3737 david@david-laptop-20070920080908-n8pj8vmszdir3zoa
3738 david@david-laptop-20070920081509-58kkojgmml3t7jxs

   + 3737 david@david-laptop-20070920080908-n8pj8vmszdir3zoa
3738 david@david-laptop-20070920081509-58kkojgmml3t7jxs
3739 david@david-laptop-20070920081910-phlk1ujthksgpm0z


Modified: branches/numpy.scons/numpy/distutils/core.py
===================================================================
--- branches/numpy.scons/numpy/distutils/core.py	2007-09-20 08:32:42 UTC (rev 4055)
+++ branches/numpy.scons/numpy/distutils/core.py	2007-09-20 08:33:02 UTC (rev 4056)
@@ -21,6 +21,7 @@
 import distutils.dist
 
 from numpy.distutils.extension import Extension
+from numpy.distutils.numpy_distribution import NumpyDistribution
 from numpy.distutils.command import config, config_compiler, \
      build, build_py, build_ext, build_clib, build_src, build_scripts, \
      sdist, install_data, install_headers, install, bdist_rpm, scons
@@ -94,9 +95,10 @@
     # class is local to a function in setuptools.command.easy_install
     if dist is not None and \
             repr(dist).find('DistributionWithoutHelpCommands') != -1:
+        raise NotImplementedError("setuptools not supported yet for numpy.scons branch")
         dist = None
     if always and dist is None:
-        dist = distutils.dist.Distribution()
+        dist = NumpyDistribution()
     return dist
 
 def _exit_interactive_session(_cache=[]): 
@@ -174,6 +176,9 @@
        and not new_attr.has_key('headers'):
         new_attr['headers'] = []
 
+    # Use our custom NumpyDistribution class instead of distutils' one
+    new_attr['distclass'] = NumpyDistribution
+
     return old_setup(**new_attr)
 
 def _check_append_library(libraries, item):

Added: branches/numpy.scons/numpy/distutils/numpy_distribution.py
===================================================================
--- branches/numpy.scons/numpy/distutils/numpy_distribution.py	2007-09-20 08:32:42 UTC (rev 4055)
+++ branches/numpy.scons/numpy/distutils/numpy_distribution.py	2007-09-20 08:33:02 UTC (rev 4056)
@@ -0,0 +1,9 @@
+from distutils.core import Distribution
+
+class NumpyDistribution(Distribution):
+    def __init__(self, attrs = None):
+        self.scons_scripts = []
+        Distribution.__init__(self, attrs)
+
+    def has_scons_scripts(self):
+        return bool(self.scons_scripts)

Added: branches/numpy.scons/numpy/scons_fake/setup.py
===================================================================
--- branches/numpy.scons/numpy/scons_fake/setup.py	2007-09-20 08:32:42 UTC (rev 4055)
+++ branches/numpy.scons/numpy/scons_fake/setup.py	2007-09-20 08:33:02 UTC (rev 4056)
@@ -0,0 +1,12 @@
+
+def configuration(parent_package='',top_path=None):
+    from numpy.distutils.misc_util import Configuration
+    from numpy.distutils.system_info import get_info
+    config = Configuration('scons_fake',parent_package,top_path)
+
+    config.add_sconscript('SConstruct')
+    return config
+
+if __name__ == '__main__':
+    from numpy.distutils.core import setup
+    setup(configuration=configuration)



More information about the Numpy-svn mailing list