[Numpy-discussion] include file location and .eggs

konrad.hinsen at laposte.net konrad.hinsen at laposte.net
Mon Jan 23 10:40:06 CST 2006


On Jan 23, 2006, at 19:03, Andrew Straw wrote:

> The problem is backwards compatibility. Nothing like this is  
> implemented
> in plain distutils, which is why the packages will have to support it
> themselves. This way they can keep working in both old distutils-based
> environments and new ones, including with setuptools. The current
> solution _works_ on yesteryear's Python 2.3. In my opinion, relying on

Well, I'd argue it doesn't work at all, because it doesn't scale to  
complex dependency trees.

> Distutils never handled the case when, for example you installed  
> Numeric
> with '/usr/local/bin/python2.3 setup.py install
> --prefix=/home/astraw/py23'. In this case, sure, the package got
> installed where I wanted (in my $PYTHONPATH) in
> /home/astraw/py23/lib/python2.3/site-packages/Numeric, but the headers
> were in /home/astraw/py23/include/python2.3/Numeric. Distutils would

True. It was always true that if you install anywhere but in the  
default location, you are on your own. But if you do keep the default  
location (as most users do), everything works fine.

> never find those headers again. This is exactly the same problem, and
> it's one that distutils never solved, and I don't think we should hold
> our breath waiting for Python 2.5's distutils to solve it. For one

Why not contribute to solving it?

> thing, it's already solved at the package level a la numpy. For  
> another,
> given that it's already solved, who's going to bother attempting to  
> make

I don't think it is solved at all.

> Why is "import numpy; include_dirs=numpy.get_numpy_include()" in
> setup.py unpalatable for you? That's all that is required in setup.py.

Let's go back to my initial scenario, and let's even forget about  
multiple versions. I have ScientificPython, which can be compiled for  
use with either Numeric or numarray, and some day NumPy will be a  
third choice. Then I install MMTK, which depends on ScientificPython.  
How is the MMTK installation script supposed to figure out if  
ScientificPython was compiled with Numeric, numarray, or NumPy? And  
how is it supposed to know where each of these packages stores its  
header files?

I don't mind adding some lines to setup.py for each package, that's a  
small price to pay. But I do mind having to worry about indirect  
dependencies.

> to argue this is more pain than you're willing to deal with, I think
> that, to be fair, you need to give a counter-example whereby you  
> explain
> how you handle all those versions of Numeric and Scientific installed
> simultaneously and how you select among them. I'll admit that in the

I don't, except on my development machine, where I used symbolic  
links that are changed using scripts. That's a bit of work to set up,  
but I have only two packages of which I use multiple versions, so  
doing it once is acceptable for me.

In fact, my main worry is not my own machine, nor the machine of any  
competent Python programmer. My worry is the less competent user who  
can't get installation of my packages to work and turns to me for  
help. Tech support takes more of my time than development these days.  
A fragile dependency system such as the one you propose will only  
create more support questions on my side - so don't expect me to  
support it.

> Like I said above, distutils has no such equivalent mechanism, and  
> this
> _allows_ something that simply wasn't possible before and is arguably
> broken in distutils.

I am all for fixing distutils.

Konrad.
--
---------------------------------------------------------------------
Konrad Hinsen
Laboratoire Léon Brillouin, CEA Saclay,
91191 Gif-sur-Yvette Cedex, France
Tel.: +33-1 69 08 79 25
Fax: +33-1 69 08 82 61
E-Mail: khinsen at cea.fr
---------------------------------------------------------------------






More information about the Numpy-discussion mailing list