Wrapper for python-venv
Find a file
2024-12-24 23:36:13 -06:00
LICENSE Initial commit 2024-12-24 22:55:02 -06:00
pyv custom venv_dir 2024-12-24 23:29:03 -06:00
pyv_comp.bash custom venv_dir 2024-12-24 23:29:03 -06:00
README.md customize 2024-12-24 23:36:13 -06:00

pyv

Wrapper for python-venv

Install

git clone https://git.tavo.one/tavo/pyv.git ~/.local/share/pyv
printf 'for f in pyv pyv_comp.bash ; do if [ -f ~/.local/share/pyv/$f ] ; then . ~/.local/share/pyv/$f ; fi ; done' >> ~/.bashrc

Usage

pyv [ls|new|rm|enter|exit] myvenv

pyv new v1   # create venv named v1
pyv new v2   # create venv named v2
pyv ls       # list venvs
pyv rm v2    # delete venv named v2
pyv enter v1 # enter venv named v1
pyv exit     # exit current venv

Update

git -C ~/.local/share/pyv pull

Uninstall

rm -rf ~/.local/share/pyv
# Also remove corresponding line in ~/.bashrc

Customize $VENV_DIR

By default, it stores venv data in ${XDG_DATA_HOME}/pyv or ${HOME}/.local/share/pyv, to change this behavior, set a different $VENV_DIR variable:

# Add this line to bashrc to persist
VENV_DIR="$HOME/myvenvs"