[Numpy-svn] r4472 - in branches/numpy.scons: . numpy/distutils/scons/core numpy/distutils/scons/tools

numpy-svn@scip... numpy-svn@scip...
Mon Nov 19 23:28:57 CST 2007


Author: cdavid
Date: 2007-11-19 23:28:48 -0600 (Mon, 19 Nov 2007)
New Revision: 4472

Added:
   branches/numpy.scons/numpy/distutils/scons/tools/npyctpl.py
Removed:
   branches/numpy.scons/numpy/distutils/scons/tools/npytpl.py
Modified:
   branches/numpy.scons/numpy/distutils/scons/core/numpyenv.py
   branches/numpy.scons/test.sh
Log:
Change name of npytpl to npyctpl in scons/tools

Modified: branches/numpy.scons/numpy/distutils/scons/core/numpyenv.py
===================================================================
--- branches/numpy.scons/numpy/distutils/scons/core/numpyenv.py	2007-11-20 05:26:50 UTC (rev 4471)
+++ branches/numpy.scons/numpy/distutils/scons/core/numpyenv.py	2007-11-20 05:28:48 UTC (rev 4472)
@@ -242,20 +242,28 @@
     for t in FindAllTools(DEF_OTHER_TOOLS, env):
         Tool(t)(env)
 
+    # Add our own, custom tools (f2py, from_template, etc...)
     t = Tool('f2py', toolpath = [os.path.dirname(numpy.distutils.scons.tools.__file__)])
     try:
         t(env)
     except Exception, e:
         pass
         #print "===== BOOTSTRAPPING, f2py scons tool not available (%s) =====" % e
-    t = Tool('npytpl', 
+
+    t = Tool('npyctpl', 
              toolpath = [os.path.dirname(numpy.distutils.scons.tools.__file__)])
     try:
         t(env)
     except Exception, e:
         pass
-        #print "===== BOOTSTRAPPING, f2py scons tool not available (%s) =====" % e
 
+    t = Tool('npyftpl', 
+             toolpath = [os.path.dirname(numpy.distutils.scons.tools.__file__)])
+    try:
+        t(env)
+    except Exception, e:
+        pass
+
     finalize_env(env)
 
     # Add the tool paths in the environment

Copied: branches/numpy.scons/numpy/distutils/scons/tools/npyctpl.py (from rev 4471, branches/numpy.scons/numpy/distutils/scons/tools/npytpl.py)

Deleted: branches/numpy.scons/numpy/distutils/scons/tools/npytpl.py
===================================================================
--- branches/numpy.scons/numpy/distutils/scons/tools/npytpl.py	2007-11-20 05:26:50 UTC (rev 4471)
+++ branches/numpy.scons/numpy/distutils/scons/tools/npytpl.py	2007-11-20 05:28:48 UTC (rev 4472)
@@ -1,70 +0,0 @@
-"""npytpl Tool
-
-Tool-specific initialization for npyctpl, a tool to generate C source file from
-.c.src files.
-
-There normally shouldn't be any need to import this module directly.
-It will usually be imported through the generic SCons.Tool.Tool()
-selection method.
-
-"""
-
-from os.path import basename as pbasename, splitext, join as pjoin, dirname as pdirname
-#import re
-
-import SCons.Action
-#import SCons.Defaults
-import SCons.Scanner
-import SCons.Tool
-
-from numpy.distutils.conv_template import process_str
-
-# XXX: this is general and can be used outside numpy.core.
-def _do_generate_from_template(targetfile, sourcefile, env):
-    t = open(targetfile, 'w')
-    s = open(sourcefile, 'r')
-    allstr = s.read()
-    s.close()
-    writestr = process_str(allstr)
-    t.write(writestr)
-    t.close()
-    return 0
-
-def _generate_from_template(target, source, env):
-    for t, s in zip(target, source):
-        _do_generate_from_template(str(t), str(s), env)
-    return 0
-
-def _generate_from_template_emitter(target, source, env):
-    base, ext = splitext(pbasename(str(source[0])))
-    t = pjoin(pdirname(str(target[0])), base)
-    return ([t], source)
-    
-def generate(env):
-    """Add Builders and construction variables for npytpl to an Environment."""
-    c_file, cxx_file = SCons.Tool.createCFileBuilders(env)
-
-    #c_file.suffix['.src'] = _generate_from_template_emitter
-
-    c_file.add_action('.c.src', SCons.Action.Action(_generate_from_template))
-    c_file.add_emitter('.c.src', _generate_from_template_emitter)
-
-    env['NPYTPLOPTIONS']      = SCons.Util.CLVar('')
-    #env['NPYTPLBUILDDIR']     = ''
-    #env['NPYTPLCFILESUFFIX']  = 'module$CFILESUFFIX'
-    #env['NPYTPLINCLUDEDIR']   = os.path.join(d, 'src')
-
-    # # XXX: adding a scanner using c_file.add_scanner does not work...
-    # expr = '(<)include_file=(\S+)>'
-    # scanner = SCons.Scanner.ClassicCPP("F2PYScan", ".pyf", "F2PYPATH", expr)
-    # env.Append(SCANNERS = scanner)
-
-def exists(env):
-    try:
-        import numpy.distutils.conv_template
-        st = 1
-    except ImportError, e:
-        print "Warning : npytpl tool not found, error was %s" % e
-        st = 0
-
-    return st

Modified: branches/numpy.scons/test.sh
===================================================================
--- branches/numpy.scons/test.sh	2007-11-20 05:26:50 UTC (rev 4471)
+++ branches/numpy.scons/test.sh	2007-11-20 05:28:48 UTC (rev 4472)
@@ -4,6 +4,12 @@
 # MKL=None python setupscons.py scons --jobs=4 install --prefix=$PREFIX/tmp
 # (cd $PREFIX/tmp && PYTHONPATH=$PREFIX/tmp/lib/python2.5/site-packages python -c "import numpy; print numpy; numpy.test(level = 9999); numpy.show_config()")
 
+# PREFIX=$PWD
+# rm -rf $PREFIX/build
+# rm -rf $PREFIX/tmp
+# python setupscons.py scons --jobs=4 install --prefix=$PREFIX/tmp
+# (cd $PREFIX/tmp && PYTHONPATH=$PREFIX/tmp/lib/python2.5/site-packages python -c "import numpy; print numpy; numpy.test(level = 9999); numpy.show_config()")
+
 PREFIX=$PWD
 #rm -rf $PREFIX/build
 #rm -rf $PREFIX/tmp



More information about the Numpy-svn mailing list