Avenv is a very simple bash script to activate and create python virtual environments with ease.
Many asked me. There are a lot of other options out there, so why this? Because it is handy to me. There is no other reason.
I simply didn't like other workflows. And some years ago I developed this one that just resulted to be extreamly optimal for me.
Besides: this is not an entire program, aliases do not do the same thing this script does, and is not changing anything on the package management structure itself.
It just changes WHERE virtual environments are stored, and makes access easier than just python -m venv venv and then source .venv/bin/activate. Also, this
doesn't even let you source the activate script from anywhere else than the directory where the venv is stored itself. Unless you are confortable writing absolute path strings.
Avenv simply creates virtual environments in a predefined directory (by default $HOME/.local/virtualenvs/).
Then, it just returns the path to the selected virtual environments activate script.
So, when you lunch avenv my_env it actually is just echo "$HOME/.local/virtualenvs/my_env/bin/activate".
This makes it enough to activate the script when you combine it with source:
user@local:/wherever/you/are/ > source avenv my_env
(my_env) user@local:/wherever/you/are/ > nvim . # this lunches neovim within my_envto create a venv:
avenv -m my-venv-nameto activate a venv (wherever you are):
source avenv my-venv-nameIf you don't remember which venvs you created:
avenv -lIf you want to permanentely delete a venv:
avenv -r my-env-nameThis Software is distributed under GPLv3 License