[Pyrex] Test case for Pyrex and Cython

Jim Kleckner jek-gmane at kleckner.net
Sun Nov 25 19:11:53 CET 2007


This test case showcases two problems, one with Pyrex and one
with Cython.  I'm motivated by a problem that is causing a
segfault and wanted to compare the behavior of Pyrex vs. Cython
to try to narrow down the source of it.  I'm finding it
difficult to switch between them.

To run the test, change directory to pathtest and type ./runtest
from the prompt.  This script will attempt to build the
testcimport extension with both Pyrex and Cython and run a
trivial test of it.

The pyx and pxd file conventions use the recommendation of Pyrex
of including the package name ("testcimport") in the file name.
Cython could relax those restrictions but here I'm trying to
sort out other issues.

Note that using Pyrex, the testcimport/module.dll appears to be
created properly and testit.py is able to "import module" and
invoke the functions.  However, "import testcimport.module"
fails.

Note that using Cython, the type name is not found and the
extension fails to compile.

These tests were performed with versions:
     Pyrex 0.9.6.3 with a setup.py patch from the email list
     Cython 0.9.6.9

David, given your foray into the wilds of hierarchy and
packaging of Cython, would you mind taking a look at this?

I've uploaded the test case as a zip attachment to the wiki page
that David created here:
  http://wiki.cython.org/PackageHierarchy




More information about the Pyrex mailing list