Skip to content

Auto-activate/deactivate a Pipenv virtual environment

License

Notifications You must be signed in to change notification settings

deeuu/xontrib-apipenv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Auto-activate/deactivate a Pipenv virtual environment

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages