On Nov 3, 2009, at 5:51 PM, Robert Kern wrote: > On 2009-11-03 18:29 PM, Robert Bradshaw wrote: >> On Nov 3, 2009, at 4:13 PM, David Cournapeau wrote: >> >>> On Wed, Nov 4, 2009 at 3:27 AM, Robert Bradshaw >>> <[email protected]> wrote: >>> >>>> >>>> How would you know, in general, that setuptools has not previously >>>> been imported? >>> >>> The reason for this line is precisely to detect whether setuptools >>> has >>> been previously imported or not. >> >> Yes, I understand that. I should have been more clear--what makes me >> wary is that you are departing from normal behavior if, anywhere in >> the interpreters past history, a certain module has been imported. >> >> Now maybe (probably) I'm missing something here, does "import >> setuptools" in your setupegg.py do something more than just pass a >> flag to setup.py? If so, I'd really like to understand the magic. > > Importing setuptools automatically monkeypatches a couple of things > in distutils > and activates setuptools' features. The "if 'setuptools' in > sys.modules:" check > is the safest way to optionally provide those extra setup() options > only when > the person installing the package explicitly uses easy_install or > setupegg.py.
Ah, that is exactly the kind of thing I was wondering about. In this case I'm +1 for the implementation. I agree with Stefan that we should probably support distribute as well. - Robert _______________________________________________ Cython-dev mailing list [email protected] http://codespeak.net/mailman/listinfo/cython-dev
