pypa/pip — pull request #712 by qwcode (2012-10-30 04:16:19+00:00)
Title: clean build dir after errors, and don't reuse a pre-existing build dir

this fixes issues #413, #709, and #634

the changes:

1) remove the build dir if there's an exception during file prep or installation (which usually means an exception during 'setup.py egg_info' or 'setup.py install')

2) fail with an exception if there's a pre-existing build dir for the pkg. it's too risky to do otherwise. just checking the version in the build dir might be considered acceptable, but we changed that check to just warn (and not fail) about 9 months ago for specific reasons. see pull #436. this change does not interfere with the --no-download option which allows you to install against an existing build dir.

and there's 3 new tests for this.