๐Ÿ“ฆ yochem / venvs

Global Python virtual environments (venv)

โ˜… 0 stars โ‘‚ 0 forks ๐Ÿ‘ 0 watching
๐Ÿ“ฅ Clone https://github.com/yochem/venvs.git
HTTPS git clone https://github.com/yochem/venvs.git
SSH git clone git@github.com:yochem/venvs.git
CLI gh repo clone yochem/venvs
Yochem van Rosmalen Yochem van Rosmalen Global first, then local 3d79fce 2 years ago ๐Ÿ“ History
๐Ÿ“‚ main View all commits โ†’
๐Ÿ“„ README.md
๐Ÿ“„ venvs.bash
๐Ÿ“„ venvs.fish
๐Ÿ“„ venvs.zsh
๐Ÿ“„ README.md

venvs - wrapper for Python's venv

This script gathers all venvs in one folder and gives system-wide access to them.

Warning: It is kinda hacky. Do not trust it without reading through the code (it's not that long).

Installation

Download this repository somewhere on your system. Then put this somewhere in your .bashrc / config.fish:

# for bash:
[ -f "path/to/venvs.bash" ] && source "path/to/venvs.bash"

# for zsh (it's just a link to venvs.bash):
[ -f "path/to/venvs.zsh" ] && source "path/to/venvs.zsh"

# for fish
[ -f "path/to/venvs.fish" ] && source "path/to/venvs.fish"

Venvs locations

The virtual environments are created in $XDGDATAHOME/venvs. This usually means ~/.local/share/venvs.

To place it somewhere else, set $XDGDATAHOME to another value. After that, mv the contents to the new directory.

Usage:
venvs <venv>                 activate venv in the *global venvs directory*
venvs new <venv> <options>   create new venv in *global venvs directory*
                             note: run python3 -m venv --help to see options

venvs                        activate venv in *current directory*
venvs new ./<venv> <options> create new venv in *current directory*
                             note: run python3 -m venv --help to see options

venvs [ls | list]            list all venvs
venvs [rm | remove] <venv>   remove a venv
venvs deactivate             deactivate current venv
venvs [-h | --help]          show this help