File tree Expand file tree Collapse file tree 1 file changed +19
-3
lines changed Expand file tree Collapse file tree 1 file changed +19
-3
lines changed Original file line number Diff line number Diff line change @@ -19,11 +19,24 @@ function run_install_test() {
1919 chmod +x test-venv/bin/protoc
2020
2121 source test-venv/bin/activate
22- pip install -i ${PYPI} protobuf==${VERSION} --no-cache-dir
22+ ( pip install -i ${PYPI} protobuf==${VERSION} --no-cache-dir) || (retry_pip_install ${PYPI} ${VERSION} )
2323 deactivate
2424 rm -fr test-venv
2525}
2626
27+ function retry_pip_install() {
28+ local PYPI=$1
29+ local VERSION=$2
30+
31+ read -p " pip install failed, possibly due to delay between upload and availability on pip. Retry? [y/n]" -r
32+ echo
33+ if [[ ! $REPLY =~ ^[Yy]$ ]]; then
34+ exit 1
35+ fi
36+
37+ (pip install -i ${PYPI} protobuf==${VERSION} --no-cache-dir) || (retry_pip_install ${PYPI} ${VERSION} )
38+ }
39+
2740
2841[ $# -lt 1 ] && {
2942 echo " Usage: $0 VERSION ["
@@ -86,13 +99,16 @@ python3 setup.py test
8699python3 setup.py sdist
87100twine upload --skip-existing -r testpypi -u protobuf-wheel-test dist/*
88101
89- # Test locally with different python versions.
102+ # Sleep to allow time for distribution to be available on pip.
103+ sleep 5m
104+
105+ # Test locally.
90106run_install_test ${TESTING_VERSION} python3 https://test.pypi.org/simple
91107
92108# Deploy egg/wheel packages to testing PyPI and test again.
93109python3 setup.py clean build bdist_wheel
94110twine upload --skip-existing -r testpypi -u protobuf-wheel-test dist/*
95-
111+ sleep 5m
96112run_install_test ${TESTING_VERSION} python3 https://test.pypi.org/simple
97113
98114echo " All install tests have passed using testing PyPI."
You can’t perform that action at this time.
0 commit comments