Comment 5 for bug 504968

Revision history for this message
Fernando Perez (fdo.perez) wrote : Re: [Bug 504968] Re: Better setuptools detection

On Fri, Jan 8, 2010 at 2:32 PM, Gael Varoquaux
<email address hidden> wrote:
> On Fri, Jan 08, 2010 at 10:24:16PM -0000, Fernando Perez wrote:
>> But we will NEVER use setuptools in the default setup.py, it simply has
>> too many detrimental and unavoidable side-effects to be used by default
>> (since simply importing it monkeypatches distutils, there's no way to
>> avoid its problems once you've imported it).
>
> There are ways to use setuptools for the good features it has and avoid
> these problems. Have a look at the setup.py and setupegg.py in the
> following project, for instance:
> http://bazaar.launchpad.net/~gael-varoquaux/joblib/trunk/files

You mean this, I assume:

# For some commands, use setuptools
if len(set(('develop', 'sdist', 'release', 'bdist_egg', 'bdist_rpm',
           'bdist', 'bdist_dumb', 'bdist_wininst', 'install_egg_info',
           'build_sphinx', 'egg_info', 'easy_install', 'upload',
            )).intersection(sys.argv)) > 0:
    from setupegg import extra_setuptools_args

# extra_setuptools_args is injected by the setupegg.py script, for
# running the setup with setuptools.
if not 'extra_setuptools_args' in globals():
    extra_setuptools_args = dict()

Yes, that's very nice in that for many commands provided by
setuptools, it wil transparently work for the user, thanks. We should
adopt that code ourselves too, it's a good solution for all those
commands. Thanks!

However, it doesn't change the resolution for this bug, which was for
'setup.py install', because for the install command, we are not going
to pull setuptools in, as that's where the easy-install.pth mess
happens.

In summary: bug resolution stays unchanged, but using your solution to
be more setuptools-friendly is a great idea.

Cheers,

f