New submission from Jari Pennanen <jari.penna...@gmail.com>:

Long story short: Sometimes build_ext should be run before build_py, or 
something similar.

As an example when using SWIG and setup.py the build order is incorrect: 
During build_ext the SWIG generates .py files that should be used during 
build_py, but since build_py was already ran this doesn't work.

It would be useful if one could for example define custom order for 
subcommands in setup, in this case like: 

    setup(..., build_order=['build_ext', 'build_py'])

If adding a new keyword argument to setup is not an option, some other 
way to specify custom build order should be considered.

This is common problem especially using SWIG. Discussion about this 
issue was in here http://mail.python.org/pipermail/distutils-sig/2009-
December/015010.html the workaround for SWIG case is to use following 
setup.py:

   #!/usr/bin/env python
   from distutils.core import setup, Extension
   from distutils.command.build_py import build_py

   dist = setup(...)

   # Rerun the build_py
   build_py = build_py(dist)
   build_py.ensure_finalized()
   build_py.run()

----------
assignee: tarek
components: Distutils
messages: 96798
nosy: ciantic, tarek
severity: normal
status: open
title: Custom order for the subcommands of build
type: feature request

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue7562>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to