Improve Jython setup.

master
baztian 2015-04-03 14:04:13 +02:00
parent 32c3bfae6b
commit 3cc5afa692
2 changed files with 14 additions and 12 deletions

View File

@ -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 ]

View File

@ -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