1
0
mirror of https://github.com/tiyn/dotfiles.git synced 2026-05-14 08:11:36 +02:00

Zsh: widget for automatic usage of uv with the pip command

This commit is contained in:
2026-05-13 03:19:45 +02:00
parent 71d23fa096
commit 641a124fe3

View File

@@ -152,9 +152,24 @@ uvshim() {
}
python() { uvshim python "$@"; }
python3() { uvshim python3 "$@"; }
pip() { uvshim pip "$@"; }
pytest() { uvshim pytest "$@"; }
pip() {
local uv_root
uv_root="$(find_python_root)"
if [[ -n "$uv_root" ]]; then
if [[ "$1" == "install" ]]; then
shift
uv add "$@"
else
uv pip "$@"
fi
else
command pip "$@"
fi
}
_find_venv_upwards() {
local dir="$PWD"