Skip to content

Commit 281af14

Browse files
committed
build-install.sh try Windows py.exe
1 parent beb1d02 commit 281af14

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

tools/build-install.sh

+7-2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
# twine
1010
# setuptools
1111
#
12+
# caller can override $PYTHON
13+
#
1214
# Manually tested to run under differing environments including:
1315
# Python 3.7 on MinGW64 shell on Windows 10
1416
# Python 3.5.3 on Debian 9 Stretch Linux on WLS
@@ -33,12 +35,13 @@ if [[ ! "${PYTHON+x}" ]]; then
3335
PYTHON='python' # fallback
3436
if which 'python3' &> /dev/null; then
3537
PYTHON='python3' # Linux Python 3
36-
elif which 'py' &> /dev/null; then
37-
PYTHON='py -3' # Windows launcher
38+
elif which 'py.exe' &> /dev/null; then
39+
PYTHON='py.exe' # Windows launcher, used by MinGW
3840
fi
3941
fi
4042

4143
# check $PYTHON runs
44+
which ${PYTHON}
4245
${PYTHON} --version
4346

4447
#
@@ -112,12 +115,14 @@ uninstall=false
112115
if [[ "${1+x}" == '--uninstall' ]]; then
113116
uninstall=true
114117
fi
118+
115119
function on_exit(){
116120
if ${uninstall}; then
117121
set -x
118122
${PYTHON} -m pip uninstall --yes --verbose "${PACKAGE_NAME}"
119123
fi
120124
}
125+
121126
trap on_exit EXIT
122127

123128
SERVER_TEST=$(readlink -f -- "./tools/ci/server-test.sh")

0 commit comments

Comments
 (0)