From 3cc5afa692b8ba3a488f61edca823a21f4060816 Mon Sep 17 00:00:00 2001 From: baztian Date: Fri, 3 Apr 2015 14:04:13 +0200 Subject: [PATCH] Improve Jython setup. --- ci/before_install.sh | 4 ---- ci/before_install_jython.sh | 22 ++++++++++++++-------- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/ci/before_install.sh b/ci/before_install.sh index 5780141..621e923 100755 --- a/ci/before_install.sh +++ b/ci/before_install.sh @@ -1,10 +1,6 @@ #!/bin/bash set -e -# JDK is not required for JPype1 anymore -# sudo apt-get update -qq -# sudo apt-get install -qq openjdk-7-jdk openjdk-7-jre - [ -n "$JYTHON" ] && "${TRAVIS_BUILD_DIR}/ci/before_install_jython.sh" || "${TRAVIS_BUILD_DIR}/ci/before_install_nonjython.sh" if [ -f requirements.txt ] diff --git a/ci/before_install_jython.sh b/ci/before_install_jython.sh index 8748f2d..daa096c 100755 --- a/ci/before_install_jython.sh +++ b/ci/before_install_jython.sh @@ -8,15 +8,21 @@ _JYTHON_BASENAME=${NON_GROUP_ID/:/-} OLD_VIRTUAL_ENV=$VIRTUAL_ENV java -jar $OLD_VIRTUAL_ENV/javalib/${_JYTHON_BASENAME}.jar -s -d $HOME/jython -# Travis CI virtualenv version is greater 1.9.1, which was the -# last version compatible with Python version before 2.6 -pip install virtualenv==1.9.1 - -virtualenv --version -# --distribute is a workaround as setuptools don't install on Jython properly -virtualenv --distribute -p $HOME/jython/bin/jython $HOME/myvirtualenv - BEFORE_PY_26=$($HOME/jython/bin/jython -c "import sys; print sys.version_info < (2, 6)") +if [ "$BEFORE_PY_26" == "True" ] +then + curl http://peak.telecommunity.com/dist/ez_setup.py -o ez_setup.py + $HOME/jython/bin/jython ez_setup.py + # Install the latest pip compatible with Jython 2.5.3 + $HOME/jython/bin/easy_install pip==1.2.1 +else + $HOME/jython/bin/jython -m ensurepip +fi + +# Install the latest virtualenv compatible with Jython +$HOME/jython/bin/pip install virtualenv==1.9.1 +$HOME/jython/bin/virtualenv $HOME/myvirtualenv + if [ "$BEFORE_PY_26" == "True" ] then # No SSL support for Jython