perf: install env checks

This commit is contained in:
2025-12-23 20:53:55 +02:00
parent a286817ce3
commit 891ae505f8
30 changed files with 492 additions and 490 deletions

View File

@@ -10,8 +10,8 @@ if ! echo "$PATH" | grep -q "$PYENV_ROOT"; then
export PATH="$PYENV_ROOT/bin:$PATH"
fi
if ! command -v pyenv &>/dev/null; then
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
if command -v apt-get >/dev/null 2>&1; then
case "$DOTS_PKG" in
apt)
# https://github.com/pyenv/pyenv/wiki#suggested-build-environment
sudo apt-get install -qq build-essential libssl-dev zlib1g-dev \
libbz2-dev libreadline-dev libsqlite3-dev curl \
@@ -19,7 +19,8 @@ if ! command -v pyenv &>/dev/null; then
# see https://github.com/pyenv/pyenv-installer
bash -c "$(curl -fsSL https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer)"
elif command -v pacman >/dev/null 2>&1; then
;;
pacman)
# Prefer native packages if available; otherwise install build deps then use installer
if ! sudo pacman -Qi pyenv >/dev/null 2>&1; then
sudo pacman -S --noconfirm --needed base-devel openssl zlib-ng-compat bzip2 readline sqlite xz tk libffi curl
@@ -27,16 +28,18 @@ if ! command -v pyenv &>/dev/null; then
else
sudo pacman -S --noconfirm --needed pyenv pyenv-virtualenv
fi
else
;;
brew)
brew install pyenv
brew install pyenv-virtualenv
;;
*)
log_warn "Skipping pyenv install: no supported package manager found"
fi
elif [[ "$OSTYPE" == "darwin"* ]]; then
brew install pyenv
brew install pyenv-virtualenv
fi
;;
esac
fi
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
if [[ "$DOTS_OS" == "linux" ]]; then
virtualenv_path="$(pyenv root)/plugins/pyenv-virtualenv"
if [ ! -d "$virtualenv_path" ]; then
git clone \