Skip to content

Latest commit

 

History

History
52 lines (38 loc) · 1.7 KB

README.md

File metadata and controls

52 lines (38 loc) · 1.7 KB

xonsh-apipenv

Auto-activate/deactivate a pipenv virtual environment when changing pipenv project directories.

  • pipenv shell does not play nice with xonsh (see here and here )

  • This xontrib uses vox to activate the virtual environment created by pipenv

Installation / Usage

  1. Install

    xpip install xontrib-apipenv
    

    or

    git clone https://github.com/deeuu/xontrib-apipenv.git
    xpip install ./xontrib-apipenv
    
  2. Add xontrib load xonsh-apipenv to your .xonshrc

  3. Turn on auto-activation/deactivation with $APIPENV = True

  4. Now move to a pipenv project directory and watch vox automatically activate the virtual environment. Move to a second pipenv project and the virtual environment will switch. An environment will also be activated when moving to a sub-directory of a pipenv project, and deactivated when leaving the parent project directory in which the Pipfile resides.

  5. 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).

Credits