File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed
Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -48,21 +48,26 @@ function preferred_python_release {
4848 # Return string with latest Python version triplet for a given version tuple.
4949 # Example: PYVERSION="2.7"; latest_python_release -> "2.7.15"
5050 pyenv install --list \
51- | grep -vE " (^Available versions:|-src|dev|rc|alpha|beta|(a|b)[0-9]+)" \
51+ | grep -vE " (^Available versions:|-src|dev|rc|alpha|beta|(a|b)[0-9]+|t$ )" \
5252 | grep -E " ^\s*$PYVERSION " \
5353 | sed -E ' s/^[[:space:]]+//' \
5454 | tail -1
5555}
5656
5757function install_pyenv {
58- # Install pyenv if missing.
59- if ! [ " $( pyenv --version) " ]; then
60- # MacOS VM does not have pyenv installed by default.
58+ # Install the latest pyenv version to include the latest python versions.
59+ # For installation instructions refer:
60+ # https://github.com/pyenv/pyenv?tab=readme-ov-file#installation
61+ if [[ $KOKORO_JOB_NAME =~ " macos" ]]; then
62+ brew update
63+ brew install pyenv
64+ export PYENV_ROOT=" $( brew --prefix pyenv) "
65+ else
6166 git clone https://github.com/pyenv/pyenv.git ~ /.pyenv
6267 export PYENV_ROOT=" $HOME /.pyenv"
63- export PATH=" $PYENV_ROOT /bin:$PATH "
64- eval " $( pyenv init --path) "
6568 fi
69+ export PATH=" $PYENV_ROOT /bin:$PATH "
70+ eval " $( pyenv init --path) "
6671}
6772
6873function install_python {
You can’t perform that action at this time.
0 commit comments