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