Skip to content

Commit

Permalink
Attempt at fixing wait for new package appearing in PyPI index.
Browse files Browse the repository at this point in the history
  • Loading branch information
jenskeiner committed Aug 17, 2023
1 parent 7d8934d commit 6808e7d
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions .github/workflows/publish-rc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,17 @@ jobs:
- name: Install from testpypi and import.
run: |
i=0
while (($i<120)) && [[ ! $(curl --max-time 120 -s https://test.pypi.org/pypi/${{ env.PACKAGE_NAME }}/json | jq -r '.releases | keys[]') =~ (^|[[:space:]])${{ env.VERSION }}($|[[:space:]]) ]];\
do echo waiting for package to appear in test index, sleeping 5s; sleep 5s; let i++; done
n=60
exists=0
while [ $i -lt $n ] && [ $exists -eq 0 ]; do
if curl -s https://test.pypi.org/pypi/${{ env.PACKAGE_NAME }}/json | jq -e '.releases | has("${{ env.VERSION }}")' &> /dev/null; then
exists=1
else
((i++))
echo "$i/$n Waiting for package to appear in test index, sleeping 5s.
sleep 5s
fi
done
pip install --no-cache-dir --index-url https://test.pypi.org/simple ${{ env.PACKAGE_NAME }}==${{ env.VERSION }} --no-deps
pip install -r requirements.txt
python -c 'import ${{ env.MODULE_NAME }};print(${{ env.MODULE_NAME }}.__version__)'

0 comments on commit 6808e7d

Please sign in to comment.