2018-02-28 06:28:08 +00:00
|
|
|
#!/bin/bash
|
2018-04-12 18:07:33 +00:00
|
|
|
# Description: The Python programming language
|
2018-02-28 06:28:08 +00:00
|
|
|
set -e
|
|
|
|
|
|
|
|
__PYTHON_VERSION=3.6.4
|
|
|
|
|
2018-02-28 15:07:41 +00:00
|
|
|
_recipe _path
|
|
|
|
|
2018-02-28 06:28:08 +00:00
|
|
|
case $_PLATFORM in
|
|
|
|
darwin)
|
|
|
|
_recipe brew
|
|
|
|
_brew pyenv
|
|
|
|
_brew pyenv-virtualenv
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
_recipe _apt
|
|
|
|
for dep in make build-essential libssl-dev zlib1g-dev libbz2-dev \
|
|
|
|
libreadline-dev libsqlite3-dev wget curl llvm \
|
|
|
|
libncurses5-dev libncursesw5-dev xz-utils tk-dev; do
|
|
|
|
_apt $dep
|
|
|
|
done
|
|
|
|
if [ ! -d ~/.pyenv ]; then
|
|
|
|
_run "Install pyenv" bash <(curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer)
|
|
|
|
fi
|
|
|
|
_path "${HOME}/.pyenv/bin"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2018-02-28 15:07:41 +00:00
|
|
|
_profile 'eval "$(pyenv init -)"'
|
|
|
|
_profile 'eval "$(pyenv virtualenv-init -)"'
|
|
|
|
|
2018-02-28 06:28:08 +00:00
|
|
|
if ! [ -d ~/.pyenv/versions/${__PYTHON_VERSION} ]; then
|
|
|
|
_run "Install python ${__PYTHON_VERSION}" pyenv install ${__PYTHON_VERSION}
|
|
|
|
fi
|
|
|
|
pyenv global ${__PYTHON_VERSION}
|