Improve setuptools support.
Improve setuptools support.

Many thanks to Gael for the code/idea for the solution, see bug page for
details.

Fixes: https://bugs.launchpad.net/ipython/+bug/504968

ipython/ipython,ipython/ipython