From 4a114c1ba8ccb3a66a499fb9c0bcc2b1e2704625 Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Fri, 31 Jul 2020 22:37:44 +0000 Subject: [PATCH 1/3] pip harder --- ci.sh | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/ci.sh b/ci.sh index e5086350..80c1f1d7 100755 --- a/ci.sh +++ b/ci.sh @@ -10,13 +10,7 @@ set +o allexport # Log some general info about the environment env | sort -# 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() { +function try-harder() { for BACKOFF in 0 1 2 4 8 15 15 15 15; do sleep $BACKOFF if curl -fL --connect-timeout 5 "$@"; then @@ -26,6 +20,16 @@ function curl-harder() { 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() { + try-harder curl -fL --connect-timeout 5 "$@" +} + ################################################################ # We have a Python environment! ################################################################ @@ -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 From 202b770258b58d01d47c32c60a21c17f08fd3ec4 Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Fri, 31 Jul 2020 22:41:52 +0000 Subject: [PATCH 2/3] Add newsfragments/124.misc.rst --- newsfragments/124.misc.rst | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 newsfragments/124.misc.rst diff --git a/newsfragments/124.misc.rst b/newsfragments/124.misc.rst new file mode 100644 index 00000000..3d2cc824 --- /dev/null +++ b/newsfragments/124.misc.rst @@ -0,0 +1,2 @@ +Try harder to pip due to +`pypa/warehouse#8330 `_. From a009d553b17f9eab1ab98da2567608ecf5577d98 Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Fri, 31 Jul 2020 22:46:53 +0000 Subject: [PATCH 3/3] less curl --- ci.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci.sh b/ci.sh index 80c1f1d7..4f494839 100755 --- a/ci.sh +++ b/ci.sh @@ -13,7 +13,7 @@ env | sort function try-harder() { for BACKOFF in 0 1 2 4 8 15 15 15 15; do sleep $BACKOFF - if curl -fL --connect-timeout 5 "$@"; then + if "$@"; then return 0 fi done