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

Post by maur » Thu, 11 Oct 2007 20:36:12

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!


1. Announcing,, and

2. Sample distutil script that uses SWIG and C++?

Could anyone post a simple script that uses a SWIG interface
to C++ code and the mingw compiler?

I followed some online samples, and am using the setup.cfg file to
specify swig-c++=1.

Trying to build using mingw out of the cygwin environment but the
final call to link the extension calls directly to 'cc' which I think
should really be g++ at that point.

Did get everything to build with a Makefile, but that's not the right
way to go.

3. Can I use to ship and install only .pyc files?

4. and file extensions like ".c++"

5. and - duplicating inclusion of files?

6. .Py ***Hot stuff - check this out !!! .Py

7. ANN: py lib 0.9.0: py.test, distributed execution, microthreads ...

8. to py or not to py ?

9. can't build py-opengl

10. Py is Dead! Long live Py!

11. Problem building port py-imaging

12. py.test-1.3.1: new py.test.xfail, --maxfail, better reporting, fixes

13. Jython: Packing several .py on .jar, problem importing .py modules within the .jar

14. builds, but binary doesn't even run locally (shared GTK problem?)

15. Failure in and