astropy/astropy — pull request #630 by astrofrog (2013-01-12 13:54:29+00:00)
Title: Astropy does not install when setuptools is installed

Since we now try importing ``setuptools`` before resorting to downloading ``distribute`` (see 0cf0850 and #616), Astropy will not install if vanilla setuptools 0.6c11 is installed:

```
/usr/bin/gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -pipe -O2 -fwrapv -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/tom/tmp/test2.7/lib/python2.7/site-packages/numpy/core/include -I/opt/local/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c astropy/time/sofa_time.c -o build/temp.macosx-10.6-x86_64-2.7/astropy/time/sofa_time.o
astropy/time/sofa_time.c:258:18: error: sofa.h: No such file or directory
astropy/time/sofa_time.c: In function ‘__pyx_pf_7astropy_4time_9sofa_time_2cal2jd’:
astropy/time/sofa_time.c:1901: warning: implicit declaration of function ‘iauCal2jd’
astropy/time/sofa_time.c: In function ‘__pyx_pf_7astropy_4time_9sofa_time_4d_tai_utc’:
astropy/time/sofa_time.c:2287: warning: implicit declaration of function ‘iauDat’
```

and so on. Using distribute 0.6.24 (which is an old version of distribute) does however work. This means we either need to fix the installation with vanilla setuptools, or when we try and import setuptools, we check that it comes from distribute.

The second is easy to implement (I think) so I've attached code to this issue and will push the branch to staging to check.