Skip to content

Commit e390bcf

Browse files
rstzcopybara-github
authored andcommitted
Internal change
PiperOrigin-RevId: 470007432
1 parent c7386b2 commit e390bcf

File tree

1 file changed

+18
-8
lines changed

1 file changed

+18
-8
lines changed

tools/build_pip_package.sh

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -220,8 +220,18 @@ function e2e_pyenv() {
220220
}
221221

222222
ARG="$1"
223+
INSTALL_PYENV="$2"
223224
shift | true
224225

226+
if [ ${INSTALL_PYENV} == "INSTALL_PYENV" ]; then
227+
if ! [ -x "$(command -v pyenv)" ]; then
228+
echo 'Pyenv is not installed. Installing Pyenv'
229+
git clone --branch v1.2.23 https://github.com/pyenv/pyenv.git
230+
PYENV_ROOT="$(pwd)/pyenv"
231+
export PATH="$PYENV_ROOT/bin:$PATH"
232+
fi
233+
fi
234+
225235
if [ -z "${ARG}" ]; then
226236
echo "The first argument should be one of:"
227237
echo " ALL_VERSIONS: Build all pip packages using pyenv."
@@ -232,16 +242,16 @@ elif [ ${ARG} == "ALL_VERSIONS" ]; then
232242
# Compile with all the version of python using pyenv.
233243
assemble_files
234244
eval "$(pyenv init -)"
235-
e2e_pyenv 3.9.2
236-
e2e_pyenv 3.8.7
237-
e2e_pyenv 3.7.7
238-
e2e_pyenv 3.10-dev
245+
e2e_pyenv 3.9.13
246+
e2e_pyenv 3.8.13
247+
e2e_pyenv 3.7.13
248+
e2e_pyenv 3.10.6
239249
elif [ ${ARG} == "ALL_VERSIONS_ALREADY_ASSEMBLED" ]; then
240250
eval "$(pyenv init -)"
241-
e2e_pyenv 3.9.2
242-
e2e_pyenv 3.8.7
243-
e2e_pyenv 3.7.7
244-
e2e_pyenv 3.10-dev
251+
e2e_pyenv 3.9.13
252+
e2e_pyenv 3.8.13
253+
e2e_pyenv 3.7.13
254+
e2e_pyenv 3.10.6
245255
else
246256
# Compile with a specific version of python provided in the call arguments.
247257
assemble_files

0 commit comments

Comments
 (0)