From 948abc2d431bf71bf9c97570f9544e2a1e6575a3 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Thu, 27 Apr 2017 13:39:33 -0400 Subject: [PATCH] dev/+pyenv: install latest pythons and essential packages --- dev/+pyenv/install | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/dev/+pyenv/install b/dev/+pyenv/install index a6876622..5fc2b6e1 100755 --- a/dev/+pyenv/install +++ b/dev/+pyenv/install @@ -1,7 +1,24 @@ #!/usr/bin/env bash -if [[ -d "$HOME/.pyenv" ]]; then - >&2 echo "~/.pyenv already exists, can't install." -else +if [[ ! -d "$HOME/.pyenv" || $FORCE ]]; then git clone https://github.com/yyuu/pyenv.git $HOME/.pyenv + + # Install the latest v2 and v3 versions of python + source "$(cd $(dirname $0) && pwd)"/env.zsh + py2=$(pyenv install --list | sed 's/^ //' | grep -e '^3' | grep --invert-match 'dev\|a\|b' | tail -1) + py3=$(pyenv install --list | sed 's/^ //' | grep -e '^2' | grep --invert-match 'dev\|a\|b' | tail -1) + pyenv install "$py2" + pyenv install "$py3" + pyenv global "$py3" "$py2" + + # Install global packages + for pip in pip2 pip3; do + $pip install --upgrade pip + $pip install ipython setuptools numpy matplotlib PyQT5 + done + + # Install packages needed for dotfile scripts + pip3 install totp pytz tzlocal +else + >&2 echo "~/.pyenv already exists, can't install." fi