mirror of
https://github.com/tiyn/dotfiles.git
synced 2026-05-14 16:21:35 +02:00
Zsh: widget for automatic usage of uv with the pip command
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user