Auto-activate/deactivate a pipenv
virtual environment when changing pipenv
project directories.
-
pipenv shell
does not play nice withxonsh
(see here and here ) -
This
xontrib
usesvox
to activate the virtual environment created bypipenv
-
Install
xpip install xontrib-apipenv
or
git clone https://github.com/deeuu/xontrib-apipenv.git xpip install ./xontrib-apipenv
-
Add
xontrib load xonsh-apipenv
to your.xonshrc
-
Turn on auto-activation/deactivation with
$APIPENV = True
-
Now move to a
pipenv
project directory and watchvox
automatically activate the virtual environment. Move to a secondpipenv
project and the virtual environment will switch. An environment will also be activated when moving to a sub-directory of apipenv
project, and deactivated when leaving the parent project directory in which thePipfile
resides. -
Use
vox deactivate
to deactivate
Note:
If you just want to activate a pipenv
virtual environment, use the alias
apipenv
from within the project (works regardless of $APIPENV
).
-
@rca for the
vox
-based activation hack -
This package was created with cookiecutter and the xontrib template.