On Wed, Nov 11, 2009 at 10:46 AM, David Cournapeau <da...@ar.media.kyoto-u.ac.jp> wrote: [..] > Example: how to retrieve the install prefix in setup.py. You need a good > understanding of distutils to understand why it is so complicated, and > the example shows almost everything that's wrong in distutils design. > Many expectations are undocumented, like what method/class can be called > where and when. All this implicit behavior is part of the API, and > that's not documented anywhere that I know of.
Ok, so I read this example as a lack of documentation and the lack of clear APIs to get the installation paths. Also, notice that we are in the process of adding a new python module in the stdlib, called "sysconfig", that will contains all installation paths scheme for all supported platforms. I have a branch in the svn going on for that. Knowing where to install things and what is up with a given platform is a wider problem that Distutils in fact, it concerns site.py as well, and having a sysconfig module that handles this will help. I also expect it to help the work people from Jython, PyPy, and IronPython will do in the future. > > Also, what happened in python 2.6.3/2.6.4 w.r.t. distribute has happened > quite often for numpy.distutils, and I consider it inherent to distutils > way of working. I fully agree that this particular example is demonstrating that build_ext is suffering from a lack of API documentation. I am still waiting for you comment on the solution to remove the compile code from build_ext and have it at the Extension level, with an option to add new compilers in a more easier way. > >> If the Numpy projects made some refactoring/improvement, why the >> project didn't try to push >> it back in Distutils itself ? > > They are not improvements or refactoring for most part. They are things > quite specific to our needs: fortran support, support for our internal > code generator, swig, f2py, etc... A few things could be useful to > distutils, like manifest support for mingw for 2.6 and later, as well as > basic autoconf-like tests (checking for functions, type, type size, > etc...). We would be happy to contribute patches to Distribute if this > is considered useful. If there's someone from the Numpy project that can help in isolating patches againts Distutils trunk in our issue tracker, I'd be more than happy to reduce the gap between the two projects. Notice that this may have been done in the past, I didn't manage to review all the distutils bugs yet (some are 5 years old) Tarek _______________________________________________ Distutils-SIG maillist - Distutils-SIG@python.org http://mail.python.org/mailman/listinfo/distutils-sig