Files
computer-playbook/scripts/install/python.sh
T
kevinveenbirkenbachandClaude Opus 5 bc8e45b934 refactor(deps): make pyproject the single source for Python deps
The CI deploy bootstrap hand-listed two packages and let the ubuntu-latest runner image supply the rest, so a new host-side import surfaced as a red deploy job instead of a failed install. Size [project.dependencies] to what runs outside the project image and move the deployment stack into a deploy extra, then have every install site read that instead of naming packages itself: the image build and make install-python take the deploy extra, the CI host and the mirror and instructions workflows take the base.

Declare cryptography, which utils/manager/value_generator.py imports directly and which only reached the environment transitively through ansible. Drop numpy, which nothing in the repository imports. Guard the boundary with a lint test that blocks every deploy package and asserts the runner-host CLI still builds its parser.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 16:20:09 +02:00

47 lines
890 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
: "${PYTHON:?PYTHON not set}"
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "${SCRIPT_DIR}/../.."
EXTRA="${1:-}"
retry() {
local attempts=7
local delay=20
local count=1
while true; do
if "$@"; then
return 0
fi
if [[ $count -ge $attempts ]]; then
echo "❌ Command failed after ${attempts} attempts."
return 1
fi
echo "⚠️ Attempt ${count}/${attempts} failed. Retrying in ${delay}s..."
sleep "${delay}"
((count++))
done
}
install_python_deps() {
echo "📦 Installing Python dependencies"
retry "${PYTHON}" -m pip install --upgrade pip setuptools wheel
if [[ -n "${EXTRA}" ]]; then
echo "→ Installing with extras: [${EXTRA}]"
retry "${PYTHON}" -m pip install -e ".[${EXTRA}]"
else
echo "→ Installing base package"
retry "${PYTHON}" -m pip install -e .
fi
}
install_python_deps