A hack to let Pyrex 0.3.x users build extension classes on Win32

Graham Fawcett gmfawcett at operamail.com
Tue Jul 9 15:53:12 EDT 2002


Matthias Baas <baas at ira.uka.de> wrote in message 

> I think the easiest way to compile Pyrex modules (either on Windows,
> Linux or anything else) is by using the distutils. For example, to
> compile the file shrubbery.pyx you just need the following setup.py
> script (which assumes you have "pyrexc" somewhere in your path):

You're right, of course, Matthias. It didn't occur to me that I was
replacing distutils functionality with my little script. Pyrex the
language is so deceptively similar to Python -- it "feels" more like
.py-->.pyc compilation than "real" extension programming. I'll revise
the suggestions I posted on my Web site.

I suppose that one could add a distutils.command.pyrexc as a
subcommand of "build_ext" to handle the .pyx compilation. That way the
os.system() call in the build script could be avoided. I've never
written a distutils command, but perhaps I'll give that a try.

Regards,

-- Graham



More information about the Python-list mailing list