From 34ddf11016550dd1de02629da516b240356c288f Mon Sep 17 00:00:00 2001 From: Correl Roush Date: Wed, 28 Feb 2018 01:28:08 -0500 Subject: [PATCH] [provisioning] New python recipe using pyenv --- .pip/pip.conf | 2 ++ recipes/python | 36 ++++++++++++++++++++++++++++++++++++ recipes/python3 | 6 ------ 3 files changed, 38 insertions(+), 6 deletions(-) create mode 100644 .pip/pip.conf create mode 100644 recipes/python delete mode 100644 recipes/python3 diff --git a/.pip/pip.conf b/.pip/pip.conf new file mode 100644 index 0000000..b0ba198 --- /dev/null +++ b/.pip/pip.conf @@ -0,0 +1,2 @@ +[global] +user = true diff --git a/recipes/python b/recipes/python new file mode 100644 index 0000000..d09f0f5 --- /dev/null +++ b/recipes/python @@ -0,0 +1,36 @@ +#!/bin/bash +set -e + +__PYTHON_VERSION=3.6.4 + +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 + _recipe _path + _path "${HOME}/.pyenv/bin" + _profile 'eval "$(pyenv init -)"' + _profile 'eval "$(pyenv virtualenv-init -)"' + ;; +esac + +if ! [ -d ~/.pyenv/versions/${__PYTHON_VERSION} ]; then + _run "Install python ${__PYTHON_VERSION}" pyenv install ${__PYTHON_VERSION} +fi +pyenv global ${__PYTHON_VERSION} + +if ! [ -d ${HOME}/.pip ]; then + _run "Install .pip" ln -s ${HOME}/dotfiles/.pip ${HOME}/.pip +fi diff --git a/recipes/python3 b/recipes/python3 deleted file mode 100644 index 40373b6..0000000 --- a/recipes/python3 +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash -set -e - -_recipe brew -_brew python3 -_brew mypy