Files
dotfiles/scripts/install-python-packages.sh
Ismo Vuorinen e918a41d75 fix: guard success messages on command exit status
- Source x-path instead of capturing empty stdout via command substitution
- Validate --dry-run argument in cleanup script, reject unknown flags
- Gate success messages on preceding command's exit status with &&
- Applies to dfm (fmt, reset_nvim, shfmt) and install scripts
  (fonts, gh-extensions, python-packages, shellspec, z)
2026-03-18 12:33:00 +02:00

40 lines
964 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
# @description Install Python libraries via uv pip (tools are managed by mise).
#
# shellcheck source=shared.sh
source "$DOTFILES/config/shared.sh"
msgr run "Starting to install Python libraries"
# Ensure uv is available
if ! command -v uv &> /dev/null; then
msgr err "uv not found — install it via mise first"
exit 1
fi
# Library packages — installed into system Python with `uv pip install --system`
libraries=(
libtmux # Python API for tmux
pynvim # Neovim Python client
)
# Function to install library packages via uv pip install
install_libraries()
{
for pkg in "${libraries[@]}"; do
# Strip inline comments and trim whitespace
pkg="${pkg%%#*}"
pkg="${pkg// /}"
[[ -z "$pkg" ]] && continue
msgr nested "Installing library: $pkg"
uv pip install --system --upgrade "$pkg"
echo ""
done
return 0
}
install_libraries \
&& msgr yay "Python library installations complete"