diff options
| author | Robert Crews <rcrews@mac.com> | 2024-03-03 04:04:19 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-03-03 13:04:19 +0100 |
| commit | 12cd3b3e399d39b2b458fdd8f1f6286250253476 (patch) | |
| tree | aee9eabde8e0f78a5288f93c2a92f3a4ed0e2ea9 /plugins/python/README.md | |
| parent | 97a86ed1678022683d9f0113ada51f4ed8aa7375 (diff) | |
| download | zsh-12cd3b3e399d39b2b458fdd8f1f6286250253476.tar.gz zsh-12cd3b3e399d39b2b458fdd8f1f6286250253476.tar.bz2 zsh-12cd3b3e399d39b2b458fdd8f1f6286250253476.zip | |
feat(python): add auto venv activation (#12248)
Co-authored-by: Carlo Sala <carlosalag@protonmail.com>
Diffstat (limited to 'plugins/python/README.md')
| -rw-r--r-- | plugins/python/README.md | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/plugins/python/README.md b/plugins/python/README.md index 7bf1b34ac..c99697b22 100644 --- a/plugins/python/README.md +++ b/plugins/python/README.md @@ -22,8 +22,18 @@ plugins=(... python) ## Virtual environments -The plugin provides two utilities to manage Python venvs: +The plugin provides three utilities to manage Python 3.3+ [venv](https://docs.python.org/3/library/venv.html) +virtual environments: -- `mkv [name]`: make a new virtual environment called `name` (default: `venv`) in current directory. +- `mkv [name]`: make a new virtual environment called `name` (default: if set `$PYTHON_VENV_NAME`, else + `venv`) in the current directory. -- `vrun [name]`: activate virtual environment called `name` (default: `venv`) in current directory. +- `vrun [name]`: Activate the virtual environment called `name` (default: if set `$PYTHON_VENV_NAME`, else + `venv`) in the current directory. + +- `auto_vrun`: Automatically activate the venv virtual environment when entering a directory containing + `<venv-name>/bin/activate`, and automatically deactivate it when navigating out of it (including + subdirectories!). + - To enable the feature, set `export PYTHON_AUTO_VRUN=true` before sourcing oh-my-zsh. + - The default virtual environment name is `venv`. To use a different name, set + `export PYTHON_VENV_NAME=<venv-name>`. For example: `export PYTHON_VENV_NAME=".venv"` |
