Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pip harder #124

Merged
merged 3 commits into from
Jul 31, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,24 @@ set +o allexport
# Log some general info about the environment
env | sort

function try-harder() {
for BACKOFF in 0 1 2 4 8 15 15 15 15; do
sleep $BACKOFF
if "$@"; then
return 0
fi
done
return 1
}

# Curl's built-in retry system is not very robust; it gives up on lots of
# network errors that we want to retry on. Wget might work better, but it's
# not installed on azure pipelines's windows boxes. So... let's try some good
# old-fashioned brute force. (This is also a convenient place to put options
# we always want, like -f to tell curl to give an error if the server sends an
# error response, and -L to follow redirects.)
function curl-harder() {
for BACKOFF in 0 1 2 4 8 15 15 15 15; do
sleep $BACKOFF
if curl -fL --connect-timeout 5 "$@"; then
return 0
fi
done
return 1
try-harder curl -fL --connect-timeout 5 "$@"
}

################################################################
Expand All @@ -37,7 +41,7 @@ python -m pip --version

python setup.py sdist --formats=zip
INSTALL_ARTIFACT=$(ls dist/*.zip)
python -m pip install ${INSTALL_ARTIFACT}${INSTALL_EXTRAS}
try-harder python -m pip install ${INSTALL_ARTIFACT}${INSTALL_EXTRAS}

python -m pip list
python -m pip freeze
Expand Down
2 changes: 2 additions & 0 deletions newsfragments/124.misc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Try harder to pip due to
`pypa/warehouse#8330 <https://github.com/pypa/warehouse/issues/8330>`_.