heroku/heroku-buildpack-python — pull request #51 by blaze33 (2012-06-15 17:36:19+00:00)
Title: Fix CLEAN_VIRTUALENV usage so it actually works.

Purging the venv using the labs user_env_compile feature with the CLEAN_VIRTUALENV env var doesn't work: since commit 6aadf1683a2e2a3f9cca1ea90cf74bf809214328 VIRTUALENV_DIRS is unassigned, so nothing gets deleted.

I made the distinction between legacy- and modern-style virtualenvs. You may not want to merge this as-is because it will move legacy-venv from /app to /app/.heroku/venv and the user will have to update PYTHONHOME.
Does bin/release force PYTHONHOME to /app/.heroku/venv/ ? In this case we don't want any legacy venv and this commit is ok.

In fact I had the opposite problem after trying to purge my virtualenv with the purge branch (as documented here: http://stackoverflow.com/a/9463068/343834), the venv was moved to /app from /app/.heroku/venv and it broke my app by not being anymore in PYTHONHOME. If you have access to heroku support requests it's the #54723.