feat: migrate to mise for unified tool management (#309)

This commit is contained in:
2026-03-18 20:59:49 +02:00
committed by GitHub
parent 9875a4d4a0
commit 4b8ee6ffc1
58 changed files with 888 additions and 820 deletions

View File

@@ -1,53 +1,27 @@
#!/usr/bin/env bash
set -euo pipefail
# @description Install Python packages using uv.
# @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 packages"
msgr run "Starting to install Python libraries"
# Ensure uv is available
if ! command -v uv &> /dev/null; then
msgr nested "uv not found, installing via official installer"
curl -LsSf https://astral.sh/uv/install.sh | sh
export PATH="$HOME/.local/bin:$PATH"
msgr err "uv not found install it via mise first (run: dfm install mise)"
exit 1
fi
# CLI tools — installed isolated with `uv tool install`
tools=(
ansible # IT automation and configuration management
openapi-python-client # Generate Python API clients from OpenAPI specs
ruff # Fast Python linter and formatter
)
# Library packages — installed into system Python with `uv pip install --system`
libraries=(
libtmux # Python API for tmux
pynvim # Neovim Python client
)
# Function to install CLI tools via uv tool install
install_tools()
{
msgr run "Installing Python CLI tools"
for pkg in "${tools[@]}"; do
# Strip inline comments and trim whitespace
pkg="${pkg%%#*}"
pkg="${pkg// /}"
[[ -z "$pkg" ]] && continue
msgr nested "Installing tool: $pkg"
uv tool install --upgrade "$pkg"
echo ""
done
return 0
}
# Function to install library packages via uv pip install
install_libraries()
{
msgr run "Installing Python libraries"
for pkg in "${libraries[@]}"; do
# Strip inline comments and trim whitespace
pkg="${pkg%%#*}"
@@ -61,22 +35,5 @@ install_libraries()
return 0
}
# Function to upgrade all uv-managed tools
upgrade_tools()
{
msgr run "Upgrading all uv-managed tools"
uv tool upgrade --all
return 0
}
# Install Python tools, libraries, and upgrade all
main()
{
install_tools
install_libraries
upgrade_tools
msgr yay "Python package installations complete"
return 0
}
main "$@"
install_libraries \
&& msgr yay "Python library installations complete"