pypa/pip — pull request #865 by qwcode (2013-03-27 05:42:33+00:00)
Title: deal with pre-existing build dirs

redo of pull #712.

addresses issues #413, #709, and #634

the changes:

1) remove the build dir if there's an exception (unless specifying `--no-clean`)
2) a new `--no-clean` option for those who want build dirs left for the sake of analysis
3) fail with an exception if there's a pre-existing build dir. 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.
4) 4 new tests. all are local, and for one of them, since it made sense, I intentionally tried to do the "right" thing and *not* use just use reset_env, but rather worked at a unit level.

the --no-install/--no-download workflow is *not* affected by this. this still works as before (w/o using --no-clean)