From 766618ba48fc8d87a81fbb8d3118926565b4dfb1 Mon Sep 17 00:00:00 2001 From: rocky Date: Fri, 4 Nov 2022 00:53:45 -0400 Subject: [PATCH] Alow 3.0 setup --- ....1-3.2-versions => pyenv-3.0-3.2-versions} | 2 +- admin-tools/setup-python-3.0.sh | 35 +++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) rename admin-tools/{pyenv-3.1-3.2-versions => pyenv-3.0-3.2-versions} (86%) create mode 100644 admin-tools/setup-python-3.0.sh diff --git a/admin-tools/pyenv-3.1-3.2-versions b/admin-tools/pyenv-3.0-3.2-versions similarity index 86% rename from admin-tools/pyenv-3.1-3.2-versions rename to admin-tools/pyenv-3.0-3.2-versions index 334a2631..df84c5bf 100644 --- a/admin-tools/pyenv-3.1-3.2-versions +++ b/admin-tools/pyenv-3.0-3.2-versions @@ -6,4 +6,4 @@ if [[ $0 == ${BASH_SOURCE[0]} ]] ; then echo "This script should be *sourced* rather than run directly through bash" exit 1 fi -export PYVERSIONS='3.1.5 3.2.6' +export PYVERSIONS='3.0.1 3.1.5 3.2.6' diff --git a/admin-tools/setup-python-3.0.sh b/admin-tools/setup-python-3.0.sh new file mode 100644 index 00000000..27282d53 --- /dev/null +++ b/admin-tools/setup-python-3.0.sh @@ -0,0 +1,35 @@ +#!/bin/bash +PYTHON_VERSION=3.0.1 +pyenv local $PYTHON_VERSION + +# FIXME put some of the below in a common routine +function checkout_version { + local repo=$1 + version=${2:-python-3.0-to-3.2} + echo Checking out $version on $repo ... + (cd ../$repo && git checkout $version && pyenv local $PYTHON_VERSION) && \ + git pull + return $? +} + +function finish { + cd $owd +} + +export PATH=$HOME/.pyenv/bin/pyenv:$PATH +owd=$(pwd) +bs=${BASH_SOURCE[0]} +if [[ $0 == $bs ]] ; then + echo "This script should be *sourced* rather than run directly through bash" + exit 1 +fi + +mydir=$(dirname $bs) +fulldir=$(readlink -f $mydir) +cd $fulldir/.. +(cd $fulldir/.. && checkout_version python-spark master && checkout_version python-xdis && + checkout_version python-uncompyle6) +cd $owd +rm -v */.python-version || true + +git checkout python-3.0-to-3.2 && git pull && pyenv local $PYTHON_VERSION