[pypy-svn] rev 1460 - in pypy/trunk/src: . pypy/translator/test

hpk at codespeak.net hpk at codespeak.net
Tue Sep 30 11:27:39 CEST 2003


Author: hpk
Date: Tue Sep 30 11:27:39 2003
New Revision: 1460

Modified:
   pypy/trunk/src/   (props changed)
   pypy/trunk/src/pypy/translator/test/buildpyxmodule.py   (contents, props changed)
   pypy/trunk/src/pypy/translator/test/test_sourcegen.py
Log:
- fixed various issues

- now Pyrex is named Pyrex (instead of pyrex) 

- fixed  python-2.3 issue 

- there is still too verbose output



Modified: pypy/trunk/src/pypy/translator/test/buildpyxmodule.py
==============================================================================
--- pypy/trunk/src/pypy/translator/test/buildpyxmodule.py	(original)
+++ pypy/trunk/src/pypy/translator/test/buildpyxmodule.py	Tue Sep 30 11:27:39 2003
@@ -10,6 +10,7 @@
     n = num[0] = num[0]+1
     pyxfile = tmpdir.join('test%d.pyx' %n) 
     pyxfile.write(string)
+    print "made pyxfile", pyxfile
     make_c_from_pyxfile(pyxfile)
     module = make_module_from_c(pyxfile)
     #print "made module", module
@@ -18,14 +19,14 @@
 def make_module_from_c(pyxfile):
     from distutils.core import setup
     from distutils.extension import Extension
-    from pyrex.Distutils import build_ext
+    from Pyrex.Distutils import build_ext
 
     dirpath = pyxfile.dirname()
     lastdir = os.curdir
     os.chdir(str(dirpath))
     try:
         modname = pyxfile.purebasename()
-        #print "modname", modname
+        print "modname", modname
         setup(
           name = "testmodules",
           ext_modules=[ 
@@ -33,18 +34,21 @@
           ],
           cmdclass = {'build_ext': build_ext},
           script_name = 'setup.py',
-          script_args = ['build_ext', '--inplace', '-q', '--quiet']
+          script_args = ['build_ext', '--inplace', '-q'] # , '--quiet']
         )
         # XXX not a nice way to import a module
-        sys.path.insert(0, dirpath)
+        print "inserting path to sys.path", dirpath
+        sys.path.insert(0, '.')
+        print "import %(modname)s as testmodule" % locals()
         exec "import %(modname)s as testmodule" % locals()
         sys.path.pop(0)
     finally:
         os.chdir(lastdir)
+        #dirpath.rmtree()
     return testmodule
 
 def make_c_from_pyxfile(pyxfile):
-    from pyrex.Compiler.Main import CompilationOptions, Context, PyrexError
+    from Pyrex.Compiler.Main import CompilationOptions, Context, PyrexError
     try:
         options = CompilationOptions(show_version = 0, 
                                      use_listing_file = 0, 

Modified: pypy/trunk/src/pypy/translator/test/test_sourcegen.py
==============================================================================
--- pypy/trunk/src/pypy/translator/test/test_sourcegen.py	(original)
+++ pypy/trunk/src/pypy/translator/test/test_sourcegen.py	Tue Sep 30 11:27:39 2003
@@ -5,7 +5,7 @@
 from pypy.translator.genpyrex import GenPyrex
 from pypy.translator.controlflow import *
 
-from buildpyxmodule import make_module_from_pyxstring
+from pypy.translator.test.buildpyxmodule import make_module_from_pyxstring
 
 class TestCase(test.IntTestCase):
     def test_simple_func(self):


More information about the Pypy-commit mailing list