2021-07-29 05:44:12 -07:00
|
|
|
#!/usr/bin/env sh
|
2024-07-22 05:28:58 -07:00
|
|
|
# compat: +ash +bash +dash +zsh
|
2021-07-29 00:37:35 -07:00
|
|
|
|
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.
|
2024-03-21 14:36:41 -07:00
|
|
|
### this uses [`maybesudo`](#maybesudo) internally.
|
2024-03-21 14:03:02 -07:00
|
|
|
if [ -s ~/work/automamba ]; then
|
|
|
|
~/work/automamba --pip install --upgrade --upgrade-strategy only-if-needed --dry-run "$@"
|
|
|
|
confirm || return
|
|
|
|
~/work/automamba --pip install --upgrade --upgrade-strategy only-if-needed "$@"
|
|
|
|
return
|
|
|
|
fi
|
2024-07-21 22:06:15 -07:00
|
|
|
maybesudo python3 -m pip install --upgrade --upgrade-strategy only-if-needed "$@"
|
2021-07-29 00:37:35 -07:00
|
|
|
}
|
|
|
|
|
2021-09-23 06:48:05 -07:00
|
|
|
[ -n "${preload+-}" ] || . ~/sh/preload || exit 2
|
2024-03-21 14:03:02 -07:00
|
|
|
eval ${preload:-preload} has maybesudo confirm
|
2021-08-02 13:48:46 -07:00
|
|
|
[ -n "${preload+-}" ] || pippy "$@"
|