Originally reported byChris McDonough (Bitbucket: chrism, GitHub: chrism)
I'd suggest getting rid of setup.py dependency on ez_setup.py and distribute_setup.py.
If someone has an older setup of Python 3.2.3 that has eg. distribute 0.6.24 installed:
[chrism@perspire Python-3.2.3]$ bin/easy_install coverage
Searching for coverage
Best match: coverage 3.5.3
Running coverage-3.5.3/setup.py -q bdist_egg --dist-dir /tmp/easy_install-s8o1kl/coverage-3.5.3/egg-dist-tmp-hyw4pc
The required version of distribute (>=0.6.27) is not available, and can't be installed while this script is running. Please install a more recent version first, using 'easy_install -U distribute'.
(Currently using distribute 0.6.24
error: Setup script exited with 2
This is a bogus error, because that version of distribute would work just fine to install that version of coverage if distribute_setup.py were not used.
This isn't a terrible hardship interactively but it was a real problem for me while running tox, which creates a virtualenv under the hood using whatever version of virtualenv is installed. Since older virtualenvs ship with older distribute versions, there was be about a half hour of headscratching when this error occured during a tox run. The solution was to upgrade virtualenv to brandnewshiny, but this isn't always possible or desirable.
The reason to get rid of ez_setup.py is because it will have similar problems when executed and the version of setuptools/distribute installed doesn't match its worldview. (Grep for "was_imported" in ez_setup.py).
And of course the other reason is that you don't want to continually need to bump the versions of these files over time; it's a losing game.
Instead of relying on these files and "use_setuptools" in the setup.py, I'd either a) document that folks need either setuptools or distribute to install coverage or b) rely only on distutils.