astropy/astropy — pull request #640 by iguananaut (2013-01-14 18:36:54+00:00)
Title: An alternative to the fix in #634, #630, etc.

This forces the use of Distribute so that we don't generally have to worry about supporting Setuptools. This is Good because although Setuptools and Distribute are both a mess, the latter fixes several bugs that remain unfixed in the former, and includes features we rely on such as 2to3 which are not backwards compatible with Setuptools. I should add that trying to support older versions of Setuptools is a messy business also in part because we can't even use it with Python 3.x. Most OS's including more recent versions of Debian and Ubuntu have switched to using Distribute for obvious reasons.

The fix in #634 is slightly misleading because simply calling `import setuptools` does not, in all cases, imply that the "system distribute" is being used. The "system distribute" is in fact not well-defined because it depends on knowing the default installation path for Python packages on the particular OS in use.

This approach simply checks to see if there's already a Distribute installation on the Python path and forces it to be used over Setuptools if a potential conflict exists between them. It only uses disribute_setup if no version of Distribute is available at all.