2021-07-29 05:44:12 -07:00
|
|
|
#!/usr/bin/env sh
|
2021-07-29 00:37:35 -07:00
|
|
|
# YES_ZSH
|
|
|
|
|
|
|
|
#. ~/sh/maybesudo
|
|
|
|
#. ~/sh/has
|
|
|
|
|
2021-07-30 19:41:16 -07:00
|
|
|
pippy() { ### @-
|
2021-08-01 09:27:25 -07:00
|
|
|
### install Python packages using pip,
|
|
|
|
### but only update their dependencies as required.
|
|
|
|
### this uses [`maybesudo`](#maybesudo_-shmaybesudo) internally.
|
2021-07-29 00:37:35 -07:00
|
|
|
local sudo="$(has sudo || echo maybesudo_)"
|
|
|
|
"$sudo" py -m pip install --upgrade --upgrade-strategy only-if-needed "$@"
|
|
|
|
}
|
|
|
|
|
2021-08-02 13:48:46 -07:00
|
|
|
[ -n "${preload+-}" ] || pippy "$@"
|