[Distutils] Some negative press for easy_install
Andrew Straw
strawman at astraw.com
Thu Feb 9 19:38:31 CET 2006
Phillip J. Eby wrote:
>At 11:10 AM 2/9/2006 -0500, Kevin Dangoor wrote:
>
>
>>Could you do something like this:
>>
>>try:
>> from setuptools import setup
>>except ImportError:
>> from distutils.core import setup
>>
>>On your system, you'd then be able to build eggs at will. Other people
>>who download an sdist but don't have setuptools will just get normal
>>sdist-like behavior.
>>
>>
>
>Almost. You'll have to use MANIFEST.in or they won't be able to do
>bdist_rpm or certain other commands from your sdist. That is, you can't
>use setuptools' revision control features, since they won't have them
>available.
>
>
Note that matplotlib tried essentially this for a while, but apparently
some folks really didn't like it. I'm not sure what exactly broke on
their systems (they didn't complain to the mailing list), but when
setup.py reverted to a plain distutils script, they cheered. Matplotlib
now has setupegg.py:
from setuptools import setup
execfile('setup.py',
{'additional_params' :
{'namespace_packages' : ['matplotlib.toolkits']}})
I guess the point is that just because someone has setuptools installed
on their system doesn't mean they want to use it.
Another option, for a single setup.py, is something like the following:
if 'setuptools' in sys.modules:
use_setuptools_options()
This way, setup.py can be setuptools-aware without doing 'import
setuptools', but the user would have to do:
python -c "import setuptools; execfile('setup.py')"
More information about the Distutils-SIG
mailing list