From 0cc32f00f5387c84a0bf95a403243b56b5bb9658 Mon Sep 17 00:00:00 2001 From: tedder Date: Tue, 22 Nov 2016 16:36:59 -0800 Subject: [PATCH 1/2] update to pypy 5.6, smarter pip installation - update from 5.1.0 to 5.6.0 (current). File naming scheme changed, instead of pypy-VERSION it is pypy2-vVERSION. - change installation process to remove any existing pypy directory. Otherwise reinstalls fail. (this sets up for #25 nicely) - use ensurepip instead of get-pip.py. One less call. As a side effect the `copy` of get-pip was failing on Ansible v2.2.0, this fi xes #32. - add `PYTHONPATH` to the python wrapper. Allows pypy to use the shipped modules (like `ensurepip`). --- files/bootstrap.sh | 16 +- files/get-pip.py | 17474 ------------------------------------------- tasks/main.yml | 12 - 3 files changed, 9 insertions(+), 17493 deletions(-) delete mode 100644 files/get-pip.py diff --git a/files/bootstrap.sh b/files/bootstrap.sh index 82646de..8bd2abd 100644 --- a/files/bootstrap.sh +++ b/files/bootstrap.sh @@ -8,16 +8,18 @@ if [[ -e $HOME/.bootstrapped ]]; then exit 0 fi -PYPY_VERSION=5.1.0 +PYPY_VERSION=5.6.0 -if [[ -e $HOME/pypy-$PYPY_VERSION-linux64.tar.bz2 ]]; then - tar -xjf $HOME/pypy-$PYPY_VERSION-linux64.tar.bz2 - rm -rf $HOME/pypy-$PYPY_VERSION-linux64.tar.bz2 +if [[ -e $HOME/pypy2-v$PYPY_VERSION-linux64.tar.bz2 ]]; then + tar -xjf $HOME/pypy2-v$PYPY_VERSION-linux64.tar.bz2 + rm -rf $HOME/pypy2-v$PYPY_VERSION-linux64.tar.bz2 else - wget -O - https://bitbucket.org/pypy/pypy/downloads/pypy-$PYPY_VERSION-linux64.tar.bz2 |tar -xjf - + wget -O - https://bitbucket.org/pypy/pypy/downloads/pypy2-v$PYPY_VERSION-linux64.tar.bz2 |tar -xjf - fi -mv -n pypy-$PYPY_VERSION-linux64 pypy +# remove, because otherwise this version will get placed into a subdir of tan existing pypy/ +rm -rf pypy +mv -f pypy2-v$PYPY_VERSION-linux64 pypy ## library fixup mkdir -p pypy/lib @@ -27,7 +29,7 @@ mkdir -p $HOME/bin cat > $HOME/bin/python < Date: Tue, 22 Nov 2016 16:42:44 -0800 Subject: [PATCH 2/2] install pip from bootstrap, fix typo, remove outdated need_pip --- files/bootstrap.sh | 3 ++- tasks/main.yml | 8 +------- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/files/bootstrap.sh b/files/bootstrap.sh index 8bd2abd..a11cd00 100644 --- a/files/bootstrap.sh +++ b/files/bootstrap.sh @@ -17,7 +17,7 @@ else wget -O - https://bitbucket.org/pypy/pypy/downloads/pypy2-v$PYPY_VERSION-linux64.tar.bz2 |tar -xjf - fi -# remove, because otherwise this version will get placed into a subdir of tan existing pypy/ +# remove, because otherwise this version will get placed into a subdir of an existing pypy/ rm -rf pypy mv -f pypy2-v$PYPY_VERSION-linux64 pypy @@ -34,5 +34,6 @@ EOF chmod +x $HOME/bin/python $HOME/bin/python --version +$HOME/bin/python -m ensurepip touch $HOME/.bootstrapped diff --git a/tasks/main.yml b/tasks/main.yml index 40284f3..e1e0ff5 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -7,13 +7,7 @@ script: bootstrap.sh when: need_bootstrap | failed -- name: Check if we need to install pip - shell: "{{ansible_python_interpreter}} -m pip --version" - register: need_pip - ignore_errors: True - changed_when: false - when: need_bootstrap | failed +- debug: var=ansible_python_interpreter - name: Install pip launcher copy: src=runner dest=~/bin/pip mode=0755 - when: need_pip | failed