Skip to content

Commit

Permalink
fix: Improve PyPI package availability check in wait script
Browse files Browse the repository at this point in the history
  • Loading branch information
lavie committed Jan 29, 2025
1 parent 21665f0 commit 124a193
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions bin/wait_for_pip.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,20 @@
VER="$1"

echo "Waiting for runlike version $VER to appear on PyPI..."
for tries in {1..15}; do
echo "Attempt $tries/15..."
for tries in {1..30}; do
echo "Attempt $tries/30..."
if curl -sf https://pypi.org/pypi/runlike/json | jq -e --arg ver "$VER" '.releases | has($ver)' > /dev/null; then
echo "Version $VER found on PyPI!"
exit 0
echo "Version $VER found in PyPI index, verifying installability..."
if pip install --dry-run runlike==$VER >/dev/null 2>&1; then
echo "Version $VER is installable from PyPI!"
exit 0
else
echo "Version $VER found but not yet installable, waiting..."
fi
fi
echo "Version $VER not found yet, waiting 5 seconds..."
sleep 5
echo "Version $VER not ready yet, waiting 10 seconds..."
sleep 10
done

echo "ERROR: Timed out waiting for version $VER to appear on PyPI"
echo "ERROR: Timed out waiting for version $VER to be available on PyPI"
exit 1

0 comments on commit 124a193

Please sign in to comment.