Auto-activate/deactivate a pipenv
virtual environment when changing pipenv project directories.
-
pipenv shelldoes not play nice withxonsh(see here and here ) -
This
xontribusesvoxto activate the virtual environment created bypipenv
-
Install
xpip install xontrib-apipenvor
git clone https://github.com/deeuu/xontrib-apipenv.git xpip install ./xontrib-apipenv -
Add
xontrib load xonsh-apipenvto your.xonshrc -
Turn on auto-activation/deactivation with
$APIPENV = True -
Now move to a
pipenvproject directory and watchvoxautomatically activate the virtual environment. Move to a secondpipenvproject and the virtual environment will switch. An environment will also be activated when moving to a sub-directory of apipenvproject, and deactivated when leaving the parent project directory in which thePipfileresides. -
Use
vox deactivateto 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.