Files

17 lines
755 B
Bash
Raw Permalink Normal View History

#!/bin/bash
# Creates /tmp/venv with Thor's runtime and dev dependencies inside a CI job container
# (Debian trixie: Python 3.13, the same as production on CT 173).
set -euo pipefail
for attempt in 1 2 3; do
if apt-get -o Acquire::Retries=3 update -qq \
&& DEBIAN_FRONTEND=noninteractive apt-get -o Acquire::Retries=3 install -y -qq --no-install-recommends \
python3 python3-venv python3-pip >/dev/null; then
break
fi
[ "$attempt" = 3 ] && { echo "::error::could not install python3"; exit 1; }
echo "apt failed (attempt $attempt); retrying in 10s"
sleep 10
done
python3 -m venv /tmp/venv
/tmp/venv/bin/pip install --quiet --disable-pip-version-check -r requirements.txt -r requirements-dev.txt
/tmp/venv/bin/python --version