[SciPy-dev] weave.inline broken by setuptools?

Fernando Perez fperez.net@gmail....
Fri Sep 26 03:38:21 CDT 2008


On Thu, Sep 25, 2008 at 9:34 PM, Robert Kern <robert.kern@gmail.com> wrote:

> Nope. This is intrinsic to the design of distutils. The only way to
> extend the commands is to subclass. Multiple extensions at the same
> time need to be merged manually. If they are implemented without
> knowledge of the other, it doesn't matter how good or careful the
> authors of each are. In fact, the fork just made things a little
> worse. Now we have to check for both distribute and setuptools.

Actually I do have a question here.  Isn't the problem with the
non-commutativity of

import setuptools
import numpy.distutils

that setuptools monkeypatches python's plain distutils?  The error I
originally gave was because an isinstance() check failed due to
setuptools having overwritten a distutils class by monkeypatching:

In [1]: import distutils.dist

In [2]: id(distutils.dist.Distribution)
Out[2]: 147586284

In [3]: import setuptools

In [4]: id(distutils.dist.Distribution)
Out[4]: 148038444

If setuptools didn't monkeypatch distutils itself but only subclassed
things, then different extensions would still have normal inheritance
diagrams and wouldn't confuse isinstance() checks, no?

It may well be that there are reasons why setuptools can't avoid to
monkeypatch, I don't know.  But it seems to me that this particular
issue stems from the monkeypatching and  not because of subclassing.
Am I missing something?

Cheers,

f


More information about the Scipy-dev mailing list