build & SWIG: missing py files (they are outside the build directory)

mauro mauro.tiz at
Wed Oct 10 13:36:12 CEST 2007

Hi all,
I am trying to make a package distribution containing some extension
module written in C. The problem is that when I run some
files are generated in the wrong position.
Suppose that this is my

from distutils.core import setup, Extension

	package_dir  = {"foo" : "src"},

Here is an example of what I get after running:

python build -cmingw32 bdist


So the problem is that (generated by SWIG) is not in .\build
\lib.win32-2.4\foo\spam but in the same directory as!
Of course I can move it manually, but I have to update also and all this is quite annoying...
Did I miss some option in the setup? Is it possible to run a system
command (copy) after each extension is compiled and linked and the
corresponding .py file is generated?
Thanks in advance!


More information about the Python-list mailing list