add pipr alias, better file format

master
Kebler Network System Administrator 2021-10-28 13:14:41 -07:00
parent 49920c442a
commit d5d76efa8d
1 changed files with 19 additions and 19 deletions

View File

@ -1,11 +1,11 @@
#!/bin/bash
use_pyenv () {
use_pyenv() {
if command -v pyenv >/dev/null 2>&1; then
export PYENV_ROOT="/opt/python/pyenv"
export PYENV_VERSION=${PYENV_VERSION:-3.8.7}
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
export PYENV_ROOT="/opt/python/pyenv"
export PYENV_VERSION=${PYENV_VERSION:-3.8.7}
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
fi
}
@ -21,28 +21,28 @@ alias pipu="pipx upgrade"
alias pipua="pipx upgrade-all"
alias pipupip="pipx upgrade pipx"
alias pipi="pipx install"
alias pipr="pipx uninstall"
alias pipl="pipx list"
alias piplv="pipx list --verbose"
path_append "/opt/python/bin"
if command -v pipx >/dev/null 2>&1; then
path_append "/opt/python/apps/bin"
export PIPX_HOME=/opt/python/apps
export PIPX_BIN_DIR=$PIPX_HOME/bin
path_append "/opt/python/apps/bin"
export PIPX_HOME=/opt/python/apps
export PIPX_BIN_DIR=$PIPX_HOME/bin
fi
[[ $USE_PYENV ]] && use_pyenv
spipua () {
module_load confirm
echo upgrading all base python packages - requires sudo access
# sudo -H python3.8 -m pip list --outdated
local List
local Ver=${1:-3.8}
List="$(sudo -H python$Ver -m pip list -o --format columns)"
echo "$List"
confirm "ATTENTION: upgrade all these packages at once??" || return 0
echo "$List" | cut -d' ' -f1 | xargs -n1 sudo -H python$Ver -m pip install -U
spipua() {
module_load confirm
echo upgrading all base python packages - requires sudo access
# sudo -H python3.8 -m pip list --outdated
local List
local Ver=${1:-3.8}
List="$(sudo -H python$Ver -m pip list -o --format columns)"
echo "$List"
confirm "ATTENTION: upgrade all these packages at once??" || return 0
echo "$List" | cut -d' ' -f1 | xargs -n1 sudo -H python$Ver -m pip install -U
}