Crates.io | pyruve |
lib.rs | pyruve |
version | 0.1.0 |
source | src |
created_at | 2023-12-08 22:03:02.912792 |
updated_at | 2023-12-08 22:03:02.912792 |
description | Activate python virtual environment on directory change |
homepage | |
repository | https://github.com/insomnes/pyruve/ |
max_upload_size | |
id | 1062432 |
size | 11,828 |
Tool to automatically activate your python virtual environment inside project folder.
Supported shells:
bash
fish
zsh
You will need cargo:
cargo install pyruve
Add $HOME/.cargo/bin
to your path.
Add to your .bashrc
(commonly in $HOME/.bashrc
):
eval "$(pyruve shell bash)"
Add to your config.fish
(commonly in $HOME/.config/fish/config.fish
):
pyruve shell fish | source
Add to your .zshrc
(commonly in $HOME/.zshrc
):
eval "$(pyruve shell zsh)"
Binary will return specific command on new instances of shell or change directory based on current venv status.
If you have any of: venv
,.venv
subdirs with available
bin/activate
script => it will be activated.
Dir list is configurable by PYRUVE_VENV_DIRS
env var,
list should be delimited by commas like:
venv,.venv,virtenv,.virtenv
It will also try to search combinations of projectdir-{iter of venv dirs}
or
projectdir_{iter of venv dirs}
like pyruve-venv
or pyruve_virtenv
.
This can be disabled via PYRUVE_COMBINE_DIRS
env var with any value except:
"true" | "t" | "1" | "on"
Delimiters are configured via PYRUVE_DELIMITERS
env var,
list should be delimited by commas like:
-,_
Going to any child of directory which contains active virtual environment dir will not lead to deactivation. Only parent or completely another dir in tree will cause deactivation. Going to dir with new virtual environment available will also cause activation of new virtual environment.