Skip to content

Commit

Permalink
Merge pull request #1 from jenskeiner/feature/fix-pypi-detection
Browse files Browse the repository at this point in the history
Correctly detect when package appears in the PyPI index.
  • Loading branch information
jenskeiner authored Aug 17, 2023
2 parents f46c414 + 38fbdf3 commit 83cb8ae
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/publish-rc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,16 @@ jobs:
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
if curl -s https://test.pypi.org/pypi/${{ env.PACKAGE_NAME }}/json | jq -e ".releases | has(\"${{ env.VERSION }}\")"; then
echo "$i/$n Package exists in index."
exists=1
else
((i++))
echo "$i/$n Waiting for package to appear in test index, sleeping 5s."
echo "$i/$n Package has not appeared in index yet. Sleeping 5s."
sleep 5s
fi
done
sleep 5s
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__)'
12 changes: 8 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,16 @@ jobs:
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
if curl -s https://test.pypi.org/pypi/${{ env.PACKAGE_NAME }}/json | jq -e ".releases | has(\"${{ env.VERSION }}\")"; then
echo "$i/$n Package exists in index."
exists=1
else
((i++))
echo "$i/$n Waiting for package to appear in test index, sleeping 5s."
echo "$i/$n Package has not appeared in index yet. Sleeping 5s."
sleep 5s
fi
done
sleep 5s
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__)'
Expand All @@ -76,13 +78,15 @@ jobs:
n=60
exists=0
while [ $i -lt $n ] && [ $exists -eq 0 ]; do
if curl -s https://pypi.org/pypi/${{ env.PACKAGE_NAME }}/json | jq -e '.releases | has("${{ env.VERSION }}")' &> /dev/null; then
if curl -s https://pypi.org/pypi/${{ env.PACKAGE_NAME }}/json | jq -e ".releases | has(\"${{ env.VERSION }}\")"; then
echo "$i/$n Package exists in index."
exists=1
else
((i++))
echo "$i/$n Waiting for package to appear in test index, sleeping 5s."
echo "$i/$n Package has not appeared in index yet. Sleeping 5s."
sleep 5s
fi
done
sleep 5s
pip install --no-cache-dir --index-url https://pypi.org/simple ${{ env.PACKAGE_NAME }}==${{ env.VERSION }}
python -c 'import ${{ env.MODULE_NAME }};print(${{ env.MODULE_NAME }}.__version__)'

0 comments on commit 83cb8ae

Please sign in to comment.