[Distutils] Swig build_py ran before build_ext

Tarek Ziadé ziade.tarek at gmail.com
Tue Dec 22 11:19:46 CET 2009

On Tue, Dec 22, 2009 at 10:49 AM, Jari Pennanen <jari.pennanen at gmail.com> wrote:
> Well, if that is so, I will paste my workaround for the sake of
> completeness if other people come here to wonder:
>   #!/usr/bin/env python
>   from distutils.core import setup, Extension
>   from distutils.command.build_py import build_py
>   dist = setup(...)
>   # Rerun the build_py to ensure that swig generated py files are also copied
>   build_py = build_py(dist)
>   build_py.ensure_finalized()
>   build_py.run()
> Btw, this could be mentioned in
> http://docs.python.org/distutils/setupscript.html since SWIG is rather
> common tool... it took me a notable time to figure this out.

Having an option to define explicitely a custom order for the
subcommands for the build command in setup.py sounds like a feature we
could add.

Please add an issue in bugs.python.org, I'll add Marc-André in cc.
there and we can investigate in this,


More information about the Distutils-SIG mailing list