[provisioning] Upgrade python and pyenv

This commit is contained in:
Correl Roush 2018-09-09 00:46:11 -04:00
parent e4ccb052a4
commit b6cc7f5c6b

View file

@ -2,9 +2,10 @@
# Description: The Python programming language # Description: The Python programming language
set -e set -e
__PYTHON_VERSION=3.6.4 __PYTHON_VERSION=3.7.0
_recipe _path _recipe _path
_recipe git
case $_PLATFORM in case $_PLATFORM in
darwin) darwin)
@ -20,7 +21,9 @@ case $_PLATFORM in
_apt $dep _apt $dep
done done
if [ ! -d ~/.pyenv ]; then if [ ! -d ~/.pyenv ]; then
_run "Install pyenv" bash <(curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer) _run "[git] Install pyenv" bash <(curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer)
else
_run "[git] Upgrade pyenv" git -C $(pyenv root) pull
fi fi
_path "${HOME}/.pyenv/bin" _path "${HOME}/.pyenv/bin"
;; ;;
@ -32,6 +35,6 @@ _profile 'pyenv global $(pyenv versions --bare --skip-aliases | egrep "^(\.?[[:d
if ! [ -d ~/.pyenv/versions/${__PYTHON_VERSION} ]; then if ! [ -d ~/.pyenv/versions/${__PYTHON_VERSION} ]; then
_run "Install python ${__PYTHON_VERSION}" pyenv install ${__PYTHON_VERSION} _run "[pyenv] Install python ${__PYTHON_VERSION}" pyenv install ${__PYTHON_VERSION}
fi fi
pyenv global ${__PYTHON_VERSION} pyenv global ${__PYTHON_VERSION}