retry uv update (#32858)

retry
old-commit-hash: 579b131a6e
pull/33029/head
Maxime Desroches 1 year ago committed by GitHub
parent 4d7567c3b0
commit bc046a3074
  1. 16
      tools/install_python_dependencies.sh

@ -8,6 +8,20 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
ROOT=$DIR/../ ROOT=$DIR/../
cd $ROOT cd $ROOT
# updating uv on macOS results in 403 sometimes
function update_uv() {
for i in $(seq 1 5);
do
if uv self update; then
return 0
else
sleep 2
fi
done
echo "Failed to update uv 5 times!"
exit 1
}
if ! command -v "uv" > /dev/null 2>&1; then if ! command -v "uv" > /dev/null 2>&1; then
echo "installing uv..." echo "installing uv..."
curl -LsSf https://astral.sh/uv/install.sh | sh curl -LsSf https://astral.sh/uv/install.sh | sh
@ -17,7 +31,7 @@ if ! command -v "uv" > /dev/null 2>&1; then
fi fi
echo "updating uv..." echo "updating uv..."
uv self update update_uv
# TODO: remove --no-cache once this is fixed: https://github.com/astral-sh/uv/issues/4378 # TODO: remove --no-cache once this is fixed: https://github.com/astral-sh/uv/issues/4378
echo "installing python packages..." echo "installing python packages..."

Loading…
Cancel
Save