mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-06 02:54:26 +00:00
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>
47 lines
890 B
Bash
Executable File
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
|