mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-01-30 02:44:42 +01:00
python: Add variant of mkv command with system site packages
Sometimes it's useful to include system site packages and use virtual environments to add additional packages without touching system site.
This commit is contained in:
parent
69a6359f7c
commit
6d7749f823
1 changed files with 12 additions and 0 deletions
|
|
@ -81,6 +81,18 @@ function mkv() {
|
|||
vrun "${name}"
|
||||
}
|
||||
|
||||
# Create a new virtual environment using the specified name.
|
||||
# If none specified, use $PYTHON_VENV_NAME
|
||||
# Use system site packages
|
||||
function mkvs() {
|
||||
local name="${1:-$PYTHON_VENV_NAME}"
|
||||
local venvpath="${name:P}"
|
||||
|
||||
python3 -m venv --system-site-packages "${name}" || return
|
||||
echo >&2 "Created venv with system site packages in '${venvpath}'"
|
||||
vrun "${name}"
|
||||
}
|
||||
|
||||
if [[ "$PYTHON_AUTO_VRUN" == "true" ]]; then
|
||||
# Automatically activate venv when changing dir
|
||||
function auto_vrun() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue