From 06306f5b7e056f5ea3f6e8fa4dd7d0d9acd4b599 Mon Sep 17 00:00:00 2001 From: Bastian Kleineidam Date: Tue, 10 Dec 2013 08:48:32 +0100 Subject: [PATCH] Fix travis builds for PIL. --- .travis.yml | 4 ++++ requirements.txt | 1 - scripts/install_pil.sh | 8 ++++++++ 3 files changed, 12 insertions(+), 1 deletion(-) create mode 100755 scripts/install_pil.sh diff --git a/.travis.yml b/.travis.yml index 82ff873a7..53e2aa12b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,9 +10,13 @@ branches: before_install: - sudo apt-get update -qq - sudo apt-get install -qq libjpeg-dev + - sudo ln -s /usr/lib/x86_64-linux-gnu/libjpeg.so /usr/lib + - sudo ln -s /usr/lib/x86_64-linux-gnu/libfreetype.so /usr/lib + - sudo ln -s /usr/lib/x86_64-linux-gnu/libz.so /usr/lib # command to install dependencies install: - pip install -r requirements.txt --use-mirrors + - scripts/install_pil.sh - pip install pytest-xdist --use-mirrors # command to run tests script: make test PYTESTOPTS="--tb=short -n10" diff --git a/requirements.txt b/requirements.txt index 760fdbd79..a37178243 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,4 +2,3 @@ requests # optional: argcomplete -PIL diff --git a/scripts/install_pil.sh b/scripts/install_pil.sh new file mode 100755 index 000000000..b3701549b --- /dev/null +++ b/scripts/install_pil.sh @@ -0,0 +1,8 @@ +#!/bin/sh +# Install PIL in Travis CI environment for Python 2.x builds. +set -e +set -u + +if python -c 'import sys; sys.exit(0 if sys.hexversion<0x03000000 else 1)'; then + pip install PIL +fi