[Numpy-svn] r4161 - in branches/numpy.scons: . numpy/scons_fake numpy/scons_fake/ctypesext numpy/scons_fake/ctypesext/tests numpy/scons_fake/pyext numpy/scons_fake/pyext/tests

numpy-svn@scip... numpy-svn@scip...
Tue Oct 9 18:17:05 CDT 2007


Author: cdavid
Date: 2007-10-09 18:16:37 -0500 (Tue, 09 Oct 2007)
New Revision: 4161

Added:
   branches/numpy.scons/numpy/scons_fake/ctypesext/
   branches/numpy.scons/numpy/scons_fake/ctypesext/SConstruct
   branches/numpy.scons/numpy/scons_fake/ctypesext/__init__.py
   branches/numpy.scons/numpy/scons_fake/ctypesext/foo.c
   branches/numpy.scons/numpy/scons_fake/ctypesext/foo_py.py
   branches/numpy.scons/numpy/scons_fake/ctypesext/setup.py
   branches/numpy.scons/numpy/scons_fake/ctypesext/tests/
   branches/numpy.scons/numpy/scons_fake/ctypesext/tests/test_foo_py.py
   branches/numpy.scons/numpy/scons_fake/pyext/
   branches/numpy.scons/numpy/scons_fake/pyext/hellomodule.c
   branches/numpy.scons/numpy/scons_fake/pyext/tests/
   branches/numpy.scons/numpy/scons_fake/pyext/tests/test_spam.py
Removed:
   branches/numpy.scons/numpy/scons_fake/SConstruct
   branches/numpy.scons/numpy/scons_fake/__init__.py
   branches/numpy.scons/numpy/scons_fake/foo.c
   branches/numpy.scons/numpy/scons_fake/foo_py.py
   branches/numpy.scons/numpy/scons_fake/hellomodule.c
   branches/numpy.scons/numpy/scons_fake/pyext/tests/test_foo_py.py
   branches/numpy.scons/numpy/scons_fake/pyext/tests/test_spam.py
   branches/numpy.scons/numpy/scons_fake/setup.py
   branches/numpy.scons/numpy/scons_fake/tests/
Modified:
   branches/numpy.scons/
Log:
Split the scons_fake example package into two


Property changes on: branches/numpy.scons
___________________________________________________________________
Name: bzr:revision-info
   - timestamp: 2007-10-10 00:49:54.707000017 +0900
committer: david <david@david-laptop>
properties: 
	branch-nick: numpy.scons

   + timestamp: 2007-10-10 07:31:02.891999960 +0900
committer: david <david@david-laptop>
properties: 
	branch-nick: numpy.scons

Name: bzr:file-ids
   - 
   + numpy/scons_fake/ctypesext	numpyscons_fakectype-20071009222126-tpzs2312hkp03hcu-1
numpy/scons_fake/ctypesext/__init__.py	__init__.py-20070922113634-7m61zd3x0182bwro-1
numpy/scons_fake/ctypesext/foo.c	foo.c-20070920125943-f6sf0rnbhik75mtj-1
numpy/scons_fake/ctypesext/SConstruct	sconstruct-20070920125938-jw3np1dk1gtr5a4s-1
numpy/scons_fake/ctypesext/setup.py	setup.py-20070920081521-unftng09muypbx5t-2
numpy/scons_fake/ctypesext/foo_py.py	foo_py.py-20070924164547-m01dunwfr91x9rg1-1
numpy/scons_fake/ctypesext/tests	numpyscons_fakectype-20071009222215-v9ksajiiyzlhsmmp-1
numpy/scons_fake/ctypesext/tests/test_foo_py.py	test_foo_py.py-20070924163456-f1o01h1eksm5bevu-2
numpy/scons_fake/pyext	numpyscons_fakepyext-20071009222120-mfloawjkwdaonpel-1
numpy/scons_fake/pyext/hellomodule.c	hellomodule.c-20071009151603-naqbhw7952s3b5pl-1
numpy/scons_fake/pyext/tests	tests-20070924163456-f1o01h1eksm5bevu-1
numpy/scons_fake/pyext/tests/test_spam.py	test_spam.py-20071009151607-wobzeu6ne1916j3p-1

Name: bzr:revision-id:v3-trunk0
   - 3737 david@david-laptop-20070920080908-n8pj8vmszdir3zoa
3738 david@david-laptop-20070920081509-58kkojgmml3t7jxs
3739 david@david-laptop-20070920081910-phlk1ujthksgpm0z
3740 david@david-laptop-20070920082641-bdhrt6eafeoli50i
3741 david@ar.media.kyoto-u.ac.jp-20070920130730-satdeppbh1k0bq2p
3743 david@ar.media.kyoto-u.ac.jp-20070921073742-vpv8pwv0j8fbd93m
3744 david@david-laptop-20070922101656-61kfi2faucemr2rl
3745 david@david-laptop-20070922113708-ror18thshang1cpu
3747 david@david-laptop-20070922140534-n9xsl096tjrzmct1
3749 david@david-laptop-20070922154007-usit009fr6vp377j
3750 david@david-laptop-20070923070011-leu2ozc2fy1q5cht
3751 david@david-laptop-20070924015925-dhsiao40jp7zsfp9
3752 david@ar.media.kyoto-u.ac.jp-20070924070657-nbw23j0ayan30cli
3753 david@ar.media.kyoto-u.ac.jp-20070924082918-i1lc1zikywi8czj4
3754 david@ar.media.kyoto-u.ac.jp-20070924083008-c0edtt8zs31yeh1q
3755 david@ar.media.kyoto-u.ac.jp-20070924112351-pnnho638cohz6lj1
3756 david@david-laptop-20070924153247-yftud00bynilxv69
3757 david@david-laptop-20070924163545-pish34x9fq2h66aj
3758 david@david-laptop-20070924164633-iiyygcaw81ji3n34
3759 david@david-laptop-20070924170201-y14v2yzikdpvamfp
3760 david@david-laptop-20070924171208-5bmitorzf49d1aa2
3761 david@david-laptop-20070925014444-ns9v90gotnxt39mq
3769 david@david-laptop-20070925145952-4osi81tvch7v6luj
3773 david@ar.media.kyoto-u.ac.jp-20070926073429-2kdc6yf1o210aer0
3774 david@ar.media.kyoto-u.ac.jp-20070926084356-938djoytjap90rmo
3775 david@ar.media.kyoto-u.ac.jp-20070926085329-3gquq3gu2k8rgzb0
3776 david@ar.media.kyoto-u.ac.jp-20071009084906-9kradhwpu7su633x
3777 david@ar.media.kyoto-u.ac.jp-20071009093339-q5nf5me6ikdi48k6
3778 david@david-laptop-20071009152108-xh5cltii0h6zjk9b
3779 david@david-laptop-20071009154954-v5se05gbq60opo1z

   + 3737 david@david-laptop-20070920080908-n8pj8vmszdir3zoa
3738 david@david-laptop-20070920081509-58kkojgmml3t7jxs
3739 david@david-laptop-20070920081910-phlk1ujthksgpm0z
3740 david@david-laptop-20070920082641-bdhrt6eafeoli50i
3741 david@ar.media.kyoto-u.ac.jp-20070920130730-satdeppbh1k0bq2p
3743 david@ar.media.kyoto-u.ac.jp-20070921073742-vpv8pwv0j8fbd93m
3744 david@david-laptop-20070922101656-61kfi2faucemr2rl
3745 david@david-laptop-20070922113708-ror18thshang1cpu
3747 david@david-laptop-20070922140534-n9xsl096tjrzmct1
3749 david@david-laptop-20070922154007-usit009fr6vp377j
3750 david@david-laptop-20070923070011-leu2ozc2fy1q5cht
3751 david@david-laptop-20070924015925-dhsiao40jp7zsfp9
3752 david@ar.media.kyoto-u.ac.jp-20070924070657-nbw23j0ayan30cli
3753 david@ar.media.kyoto-u.ac.jp-20070924082918-i1lc1zikywi8czj4
3754 david@ar.media.kyoto-u.ac.jp-20070924083008-c0edtt8zs31yeh1q
3755 david@ar.media.kyoto-u.ac.jp-20070924112351-pnnho638cohz6lj1
3756 david@david-laptop-20070924153247-yftud00bynilxv69
3757 david@david-laptop-20070924163545-pish34x9fq2h66aj
3758 david@david-laptop-20070924164633-iiyygcaw81ji3n34
3759 david@david-laptop-20070924170201-y14v2yzikdpvamfp
3760 david@david-laptop-20070924171208-5bmitorzf49d1aa2
3761 david@david-laptop-20070925014444-ns9v90gotnxt39mq
3769 david@david-laptop-20070925145952-4osi81tvch7v6luj
3773 david@ar.media.kyoto-u.ac.jp-20070926073429-2kdc6yf1o210aer0
3774 david@ar.media.kyoto-u.ac.jp-20070926084356-938djoytjap90rmo
3775 david@ar.media.kyoto-u.ac.jp-20070926085329-3gquq3gu2k8rgzb0
3776 david@ar.media.kyoto-u.ac.jp-20071009084906-9kradhwpu7su633x
3777 david@ar.media.kyoto-u.ac.jp-20071009093339-q5nf5me6ikdi48k6
3778 david@david-laptop-20071009152108-xh5cltii0h6zjk9b
3779 david@david-laptop-20071009154954-v5se05gbq60opo1z
3780 david@david-laptop-20071009223102-vz2sgf5i6pncxsd8


Deleted: branches/numpy.scons/numpy/scons_fake/SConstruct
===================================================================
--- branches/numpy.scons/numpy/scons_fake/SConstruct	2007-10-09 15:50:42 UTC (rev 4160)
+++ branches/numpy.scons/numpy/scons_fake/SConstruct	2007-10-09 23:16:37 UTC (rev 4161)
@@ -1,17 +0,0 @@
-# vim:syntax=python
-from numpy.distutils.scons import GetNumpyEnvironment, NumpyCheckLib
-
-env = GetNumpyEnvironment(ARGUMENTS)
-
-config = env.Configure(custom_tests = {'NumpyCheckLib' : NumpyCheckLib})
-config.CheckHeader('stdio.h')
-config.CheckLib('c', 'printf')
-config.NumpyCheckLib(libs = 'sndfile', symbols = 'sf_open', section = 'sndfile')
-config.Finish()
-
-source = ['foo.c']
-import sys
-if sys.platform == 'win32':
-    env.AppendUnique(CPPDEFINES = 'WIN32')
-env.NumpyCtypes('foo', source)
-env.NumpyPythonExtension('spam', 'hellomodule.c')

Deleted: branches/numpy.scons/numpy/scons_fake/__init__.py
===================================================================
--- branches/numpy.scons/numpy/scons_fake/__init__.py	2007-10-09 15:50:42 UTC (rev 4160)
+++ branches/numpy.scons/numpy/scons_fake/__init__.py	2007-10-09 23:16:37 UTC (rev 4161)
@@ -1,7 +0,0 @@
-from foo_py import foo
-from spam import system
-
-__all__ = ['foo', 'system']
-def test(level=1, verbosity=1):
-    from numpy.testing import NumpyTest
-    return NumpyTest().test(level, verbosity)

Copied: branches/numpy.scons/numpy/scons_fake/ctypesext/SConstruct (from rev 4160, branches/numpy.scons/numpy/scons_fake/SConstruct)
===================================================================
--- branches/numpy.scons/numpy/scons_fake/SConstruct	2007-10-09 15:50:42 UTC (rev 4160)
+++ branches/numpy.scons/numpy/scons_fake/ctypesext/SConstruct	2007-10-09 23:16:37 UTC (rev 4161)
@@ -0,0 +1,17 @@
+# vim:syntax=python
+from numpy.distutils.scons import GetNumpyEnvironment, NumpyCheckLib
+
+env = GetNumpyEnvironment(ARGUMENTS)
+
+config = env.Configure(custom_tests = {'NumpyCheckLib' : NumpyCheckLib})
+config.CheckHeader('stdio.h')
+config.CheckLib('c', 'printf')
+config.NumpyCheckLib(libs = 'sndfile', symbols = 'sf_open', section = 'sndfile')
+config.Finish()
+
+source = ['foo.c']
+import sys
+if sys.platform == 'win32':
+    env.AppendUnique(CPPDEFINES = 'WIN32')
+env.NumpyCtypes('foo', source)
+env.NumpyPythonExtension('spam', 'hellomodule.c')

Copied: branches/numpy.scons/numpy/scons_fake/ctypesext/__init__.py (from rev 4160, branches/numpy.scons/numpy/scons_fake/__init__.py)
===================================================================
--- branches/numpy.scons/numpy/scons_fake/__init__.py	2007-10-09 15:50:42 UTC (rev 4160)
+++ branches/numpy.scons/numpy/scons_fake/ctypesext/__init__.py	2007-10-09 23:16:37 UTC (rev 4161)
@@ -0,0 +1,7 @@
+from foo_py import foo
+from spam import system
+
+__all__ = ['foo', 'system']
+def test(level=1, verbosity=1):
+    from numpy.testing import NumpyTest
+    return NumpyTest().test(level, verbosity)

Copied: branches/numpy.scons/numpy/scons_fake/ctypesext/foo.c (from rev 4160, branches/numpy.scons/numpy/scons_fake/foo.c)
===================================================================
--- branches/numpy.scons/numpy/scons_fake/foo.c	2007-10-09 15:50:42 UTC (rev 4160)
+++ branches/numpy.scons/numpy/scons_fake/ctypesext/foo.c	2007-10-09 23:16:37 UTC (rev 4161)
@@ -0,0 +1,13 @@
+#include <stdio.h>
+
+#ifdef WIN32
+#define FOO_EXPORT __declspec(dllexport)
+#else
+#define FOO_EXPORT 
+#endif
+
+int FOO_EXPORT foo(void)
+{
+        printf("hello\n");
+		return 0;
+}

Copied: branches/numpy.scons/numpy/scons_fake/ctypesext/foo_py.py (from rev 4160, branches/numpy.scons/numpy/scons_fake/foo_py.py)
===================================================================
--- branches/numpy.scons/numpy/scons_fake/foo_py.py	2007-10-09 15:50:42 UTC (rev 4160)
+++ branches/numpy.scons/numpy/scons_fake/ctypesext/foo_py.py	2007-10-09 23:16:37 UTC (rev 4161)
@@ -0,0 +1,6 @@
+from numpy.ctypeslib import load_library
+
+_FOO = load_library("foo", __file__)
+def foo():
+    _FOO.foo()
+    

Copied: branches/numpy.scons/numpy/scons_fake/ctypesext/setup.py (from rev 4160, branches/numpy.scons/numpy/scons_fake/setup.py)
===================================================================
--- branches/numpy.scons/numpy/scons_fake/setup.py	2007-10-09 15:50:42 UTC (rev 4160)
+++ branches/numpy.scons/numpy/scons_fake/ctypesext/setup.py	2007-10-09 23:16:37 UTC (rev 4161)
@@ -0,0 +1,44 @@
+import os
+import os.path
+
+def get_object_names(source_filenames, strip_dir=0, output_dir=''):
+    # ripped off distutilc.ccompiler (CCompiler_object_filenames)
+    if output_dir is None:
+        output_dir = ''
+    obj_names = []
+    for src_name in source_filenames:
+        base, ext = os.path.splitext(os.path.normpath(src_name))
+        base = os.path.splitdrive(base)[1] # Chop off the drive
+        base = base[os.path.isabs(base):]  # If abs, chop off leading /
+        if base.startswith('..'):
+            # Resolve starting relative path components, middle ones
+            # (if any) have been handled by os.path.normpath above.
+            i = base.rfind('..')+2
+            d = base[:i]
+            d = os.path.basename(os.path.abspath(d))
+            base = d + base[i:]
+        #XXX: how to know which file types are supported ?
+        #if ext not in self.src_extensions:
+        #    raise UnknownFileError, \
+        #          "unknown file type '%s' (from '%s')" % (ext, src_name)
+        if strip_dir:
+            base = os.path.basename(base)
+        #XXX: change '.o' to something like obj_extension 
+        obj_name = os.path.join(output_dir,base + '.o')
+        obj_names.append(obj_name)
+    return obj_names
+
+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_library('_fortran_foo',
+    #                   sources=['foo.f'])
+    config.add_sconscript('SConstruct')
+    config.add_data_dir('tests')
+    return config
+
+if __name__ == '__main__':
+    from numpy.distutils.core import setup
+    setup(configuration=configuration)

Copied: branches/numpy.scons/numpy/scons_fake/ctypesext/tests/test_foo_py.py (from rev 4160, branches/numpy.scons/numpy/scons_fake/tests/test_foo_py.py)
===================================================================
--- branches/numpy.scons/numpy/scons_fake/tests/test_foo_py.py	2007-10-09 15:50:42 UTC (rev 4160)
+++ branches/numpy.scons/numpy/scons_fake/ctypesext/tests/test_foo_py.py	2007-10-09 23:16:37 UTC (rev 4161)
@@ -0,0 +1,10 @@
+from numpy.testing import *
+
+from numpy.scons_fake import foo
+
+class test_ra(NumpyTestCase):
+    def test(self):
+        foo()
+
+if __name__ == "__main__":
+    NumpyTest('numpy.scons_fake.foo').run()

Deleted: branches/numpy.scons/numpy/scons_fake/foo.c
===================================================================
--- branches/numpy.scons/numpy/scons_fake/foo.c	2007-10-09 15:50:42 UTC (rev 4160)
+++ branches/numpy.scons/numpy/scons_fake/foo.c	2007-10-09 23:16:37 UTC (rev 4161)
@@ -1,13 +0,0 @@
-#include <stdio.h>
-
-#ifdef WIN32
-#define FOO_EXPORT __declspec(dllexport)
-#else
-#define FOO_EXPORT 
-#endif
-
-int FOO_EXPORT foo(void)
-{
-        printf("hello\n");
-		return 0;
-}

Deleted: branches/numpy.scons/numpy/scons_fake/foo_py.py
===================================================================
--- branches/numpy.scons/numpy/scons_fake/foo_py.py	2007-10-09 15:50:42 UTC (rev 4160)
+++ branches/numpy.scons/numpy/scons_fake/foo_py.py	2007-10-09 23:16:37 UTC (rev 4161)
@@ -1,6 +0,0 @@
-from numpy.ctypeslib import load_library
-
-_FOO = load_library("foo", __file__)
-def foo():
-    _FOO.foo()
-    

Deleted: branches/numpy.scons/numpy/scons_fake/hellomodule.c
===================================================================
--- branches/numpy.scons/numpy/scons_fake/hellomodule.c	2007-10-09 15:50:42 UTC (rev 4160)
+++ branches/numpy.scons/numpy/scons_fake/hellomodule.c	2007-10-09 23:16:37 UTC (rev 4161)
@@ -1,25 +0,0 @@
-#include <Python.h>
-
-static PyObject *
-spam_system(PyObject *self, PyObject *args)
-{
-    const char *command;
-    int sts;
-
-    if (!PyArg_ParseTuple(args, "s", &command))
-        return NULL;
-    sts = system(command);
-    return Py_BuildValue("i", sts);
-}
-
-static PyMethodDef SpamMethods[] = {
-    {"system",  spam_system, METH_VARARGS,
-     "Execute a shell command."},
-    {NULL, NULL, 0, NULL}        /* Sentinel */
-};
-
-PyMODINIT_FUNC
-initspam(void)
-{
-    (void) Py_InitModule("spam", SpamMethods);
-}

Copied: branches/numpy.scons/numpy/scons_fake/pyext/hellomodule.c (from rev 4160, branches/numpy.scons/numpy/scons_fake/hellomodule.c)
===================================================================
--- branches/numpy.scons/numpy/scons_fake/hellomodule.c	2007-10-09 15:50:42 UTC (rev 4160)
+++ branches/numpy.scons/numpy/scons_fake/pyext/hellomodule.c	2007-10-09 23:16:37 UTC (rev 4161)
@@ -0,0 +1,25 @@
+#include <Python.h>
+
+static PyObject *
+spam_system(PyObject *self, PyObject *args)
+{
+    const char *command;
+    int sts;
+
+    if (!PyArg_ParseTuple(args, "s", &command))
+        return NULL;
+    sts = system(command);
+    return Py_BuildValue("i", sts);
+}
+
+static PyMethodDef SpamMethods[] = {
+    {"system",  spam_system, METH_VARARGS,
+     "Execute a shell command."},
+    {NULL, NULL, 0, NULL}        /* Sentinel */
+};
+
+PyMODINIT_FUNC
+initspam(void)
+{
+    (void) Py_InitModule("spam", SpamMethods);
+}

Copied: branches/numpy.scons/numpy/scons_fake/pyext/tests (from rev 4160, branches/numpy.scons/numpy/scons_fake/tests)

Deleted: branches/numpy.scons/numpy/scons_fake/pyext/tests/test_foo_py.py
===================================================================
--- branches/numpy.scons/numpy/scons_fake/tests/test_foo_py.py	2007-10-09 15:50:42 UTC (rev 4160)
+++ branches/numpy.scons/numpy/scons_fake/pyext/tests/test_foo_py.py	2007-10-09 23:16:37 UTC (rev 4161)
@@ -1,10 +0,0 @@
-from numpy.testing import *
-
-from numpy.scons_fake import foo
-
-class test_ra(NumpyTestCase):
-    def test(self):
-        foo()
-
-if __name__ == "__main__":
-    NumpyTest('numpy.scons_fake.foo').run()

Deleted: branches/numpy.scons/numpy/scons_fake/pyext/tests/test_spam.py
===================================================================
--- branches/numpy.scons/numpy/scons_fake/tests/test_spam.py	2007-10-09 15:50:42 UTC (rev 4160)
+++ branches/numpy.scons/numpy/scons_fake/pyext/tests/test_spam.py	2007-10-09 23:16:37 UTC (rev 4161)
@@ -1,10 +0,0 @@
-from numpy.testing import *
-
-from numpy.scons_fake import spam
-
-class test_ra(NumpyTestCase):
-    def test(self):
-        spam.system('dir')
-
-if __name__ == "__main__":
-    NumpyTest('numpy.scons_fake.foo').run()

Copied: branches/numpy.scons/numpy/scons_fake/pyext/tests/test_spam.py (from rev 4160, branches/numpy.scons/numpy/scons_fake/tests/test_spam.py)

Deleted: branches/numpy.scons/numpy/scons_fake/setup.py
===================================================================
--- branches/numpy.scons/numpy/scons_fake/setup.py	2007-10-09 15:50:42 UTC (rev 4160)
+++ branches/numpy.scons/numpy/scons_fake/setup.py	2007-10-09 23:16:37 UTC (rev 4161)
@@ -1,44 +0,0 @@
-import os
-import os.path
-
-def get_object_names(source_filenames, strip_dir=0, output_dir=''):
-    # ripped off distutilc.ccompiler (CCompiler_object_filenames)
-    if output_dir is None:
-        output_dir = ''
-    obj_names = []
-    for src_name in source_filenames:
-        base, ext = os.path.splitext(os.path.normpath(src_name))
-        base = os.path.splitdrive(base)[1] # Chop off the drive
-        base = base[os.path.isabs(base):]  # If abs, chop off leading /
-        if base.startswith('..'):
-            # Resolve starting relative path components, middle ones
-            # (if any) have been handled by os.path.normpath above.
-            i = base.rfind('..')+2
-            d = base[:i]
-            d = os.path.basename(os.path.abspath(d))
-            base = d + base[i:]
-        #XXX: how to know which file types are supported ?
-        #if ext not in self.src_extensions:
-        #    raise UnknownFileError, \
-        #          "unknown file type '%s' (from '%s')" % (ext, src_name)
-        if strip_dir:
-            base = os.path.basename(base)
-        #XXX: change '.o' to something like obj_extension 
-        obj_name = os.path.join(output_dir,base + '.o')
-        obj_names.append(obj_name)
-    return obj_names
-
-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_library('_fortran_foo',
-    #                   sources=['foo.f'])
-    config.add_sconscript('SConstruct')
-    config.add_data_dir('tests')
-    return config
-
-if __name__ == '__main__':
-    from numpy.distutils.core import setup
-    setup(configuration=configuration)



More information about the Numpy-svn mailing list