From bc046a3074b1600a85ccce262bec6c1786d3c167 Mon Sep 17 00:00:00 2001 From: Maxime Desroches Date: Thu, 27 Jun 2024 20:29:11 -0700 Subject: [PATCH] retry uv update (#32858) retry old-commit-hash: 579b131a6efe67463d5b2d06abe743302c9cdc08 --- tools/install_python_dependencies.sh | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/tools/install_python_dependencies.sh b/tools/install_python_dependencies.sh index 0a8275d50c..4e37d1347f 100755 --- a/tools/install_python_dependencies.sh +++ b/tools/install_python_dependencies.sh @@ -8,6 +8,20 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" ROOT=$DIR/../ 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 echo "installing uv..." curl -LsSf https://astral.sh/uv/install.sh | sh @@ -17,7 +31,7 @@ if ! command -v "uv" > /dev/null 2>&1; then fi echo "updating uv..." -uv self update +update_uv # TODO: remove --no-cache once this is fixed: https://github.com/astral-sh/uv/issues/4378 echo "installing python packages..."