Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto-deactivate venvs in $PROJECT_HOME
This is an attempt to improve my previous pull request about making the auto-activation plugin project aware (justinmayer#175). The solution back then was to only deactivate virtualenvs of projects automatically if they contain a .project file. However, this solution feels very unintuitive to me, partly because it seems against the 'intended' use of the projects plugin, which suggests to only use .project files if the project is not in the $PROJECT_HOME directory - and I like to keep all my projects in $PROJECT_HOME. This patch aims to accommodate this workflow by auto-deactivating virtualenvs of projects in $PROJECT_HOME without needing .project or .venv files. It adds a check to the auto-activation plugin: auto-deactivate venv if a) it's not auto-activated and doesn't contain a .project file, AND b) it's not a subdirectory of $PROJECT_HOME. By testing for these very specific conditions, this patch should not interfere with the normal usage of .venv and .project files in any way.
- Loading branch information