Crates.io | venv-wrapper |
lib.rs | venv-wrapper |
version | 2.0.2 |
source | src |
created_at | 2021-01-12 17:08:47.051316 |
updated_at | 2021-08-01 15:29:12.081507 |
description | Simple python virtual environment management |
homepage | https://github.com/marier-nico/venv-wrapper |
repository | https://github.com/marier-nico/venv-wrapper |
max_upload_size | |
id | 340962 |
size | 85,792 |
venv-wrapper is a convenient tool to help you manage your Python virtual environments. It used to be
a wrapper around python's built-in venv
module, but that is no longer the case, the required
features from venv
were re-implemented in Rust instead.
cargo
bin path to your PATH
environment variable.
~/.cargo/bin
.cargo install venv-wrapper
.You can install venv-wrapper from the AUR.
$ paru -S venv-wrapper-bin
$ brew install marier-nico/packages/venv-wrapper
Coming soon!
venv-wrapper
command (it should be in your shell's
$PATH
).~/.bashrc
, ~/.zshrc
, ~/.config/fish/config.fish
) and add the
following anywhere in there :eval "$(venv-wrapper init bash)"
venv completions # Optional, if you want shell completions
eval "$(venv-wrapper init zsh)"
venv completions # Optional, if you want shell completions
venv-wrapper init fish | source
venv completions # Optional, if you want shell completions
It's possible to configure venv-wrapper with either a configuration file, environment variables, or CLI flags.
venv_root
: The directory in which to store all virtualenvs (defaults to ~/.virtualenvs
).The config file is a simple ini
file that contains no sections, like this :
venv_root = /home/me/.non-default-location
CAUTION: Paths in your configuration MUST be absolute, otherwise you might end up putting virtual environments where you don't intend to.
The location for the configuration file depends on your platform of choice. For specific implementation details, see the directories crate.
Linux
The XDG user directory specification is
followed. Assuming defaults, the configuration should be located in
~/.config/venv-wrapper/config.ini
.
macOS
The Standard Directories
are used. By default, the configuration should be in ~/Library/Application support/venv-wrapper/config.ini
Note that paths do not need to be absolute here because your shell will perform path expansion. You do need the path to be absolute if your shell does not expand paths.
VENVWRAPPER_VENV_ROOT=~/.a-different-venvs-directory venv ls
The same note as with environment variables applies here : no need for an absolute path unless your shell does not expand paths.
venv -r ~/.a-different-venvs-directory venv ls
These shells are fully supported and should all work correctly :
However, all features except shell completions should work in most bash-like shells.
By default, shell completions are not active, but enabling them is really easy. All you have to do is run :
$ venv completions
Note: You must initialize venv-wrapper in your shell before activating completions.
Mostly, you should install pre-commit and run pre-commit install
to
make sure your commits are up to stuff! Also, your commits should adhere to
conventional commits. To do this, you can use a
tool like commitizen, which will help make sure
all commits look good.
The commit convention was added recently, so most commits are not yet compliant!
In its current state, this project does not quite match the features of virtualenvwrapper
. The
missing features are as follows :
To release a new version, there a few simple steps to follow.
RELEASE_CHANGELOG.md
file (at the repo's root) to contain a changelog for the release.
cargo.toml
, and src/cli/get_app.rs
.main
.main
branch.
git tag -s vX.Y.Z -m "Release vX.Y.Z"
git push --tags