A lightweight wrapper for the python 3.3+ venv utility
Run the venvy.sh
script:
source /path/to/venvy.sh
This line should be added to your shell startup script (.bashrc
, .profile
etc.)
If the VENV_HOME
enviroment variable is defined as a directory then newely created virtual enviroments are created there. If not defined then newely created virtual enviroments are created in the working directory. Add:
export VENV_HOME=/path/to/venv_home
to you shell startup script (.bashrc
, .profile
etc.) if you wish to use a virtual enviroment home directory.
mkenv ENV_NAME
:- create a new virtual enviromentmkproj PROJ_NAME
:- create a new virtual enviroment in $VENV_HOME and project in $PROJECT_HOMEstartenv ENV_NAME
:- activate a virtual enviroment stored in $VENV_HOMEstopenv
:- deactivate the currently active virtual enviroment
Hooks are used to run user defined scripts before or after commands. The following hooks can be configured in the $VENV_HOME/_HOOKS_
directory:
preactivate
:- run before startenvpostactivate
:- run after startenvpredeactivate
:- run before stopenvpostdeactivate
:- run after stopenv
Note: VENV_HOME
must be defined to use hooks (see section on virtual enviroment directory above)