Logic to pick latest version of pyev.
Builders may have diffrent versions installed.
Signed-off-by: Aric Gardner <agardner@linuxfoundation.org>
Change-Id: I2eb5cc75d815778bb35f166d1512711705b6ccd7
--- /dev/null
+---
+fix:
+ - |
+ Builders may have diffrent pyenv versions installed.
+ Programically pick the latest pyenv version.
+ Since we change pyenv version when building images, we do not know which
+ pyenv version are avaliable.
export PATH="$PYENV_ROOT/bin:$PATH"
PYTHONPATH=$(pwd)
export PYTHONPATH
- pyenv local 3.6.4
+
+ latest_version=$(pyenv versions \
+ | sed s,*,,g \
+ | awk '/[0-9]+/{ print $1 }' \
+ | sort --version-sort \
+ | awk '/./{line=$0} END{print line}')
+
+ pyenv local "$latest_version"
export PYENV_VERSION="3.6.4"
fi
fi
PYTHONPATH=$(pwd)
export PYTHONPATH
-pyenv local 3.6.4
-export PYENV_VERSION="3.6.4"
+
+latest_version=$(pyenv versions \
+ | sed s,*,,g \
+ | awk '/[0-9]+/{ print $1 }' \
+ | sort --version-sort \
+ | awk '/./{line=$0} END{print line}')
+
+pyenv local "$latest_version"
+
+export PYENV_VERSION="$latest_version"
pip install --user lftools[nexus] jsonschema niet yq
#Functions.