File tree 1 file changed +19
-3
lines changed
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() {
19
19
chmod +x test-venv/bin/protoc
20
20
21
21
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} )
23
23
deactivate
24
24
rm -fr test-venv
25
25
}
26
26
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
+
27
40
28
41
[ $# -lt 1 ] && {
29
42
echo " Usage: $0 VERSION ["
@@ -86,13 +99,16 @@ python3 setup.py test
86
99
python3 setup.py sdist
87
100
twine upload --skip-existing -r testpypi -u protobuf-wheel-test dist/*
88
101
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.
90
106
run_install_test ${TESTING_VERSION} python3 https://test.pypi.org/simple
91
107
92
108
# Deploy egg/wheel packages to testing PyPI and test again.
93
109
python3 setup.py clean build bdist_wheel
94
110
twine upload --skip-existing -r testpypi -u protobuf-wheel-test dist/*
95
-
111
+ sleep 5m
96
112
run_install_test ${TESTING_VERSION} python3 https://test.pypi.org/simple
97
113
98
114
echo " All install tests have passed using testing PyPI."
You can’t perform that action at this time.
0 commit comments