diff --git a/.travis.yml b/.travis.yml index 2f33da83..75aa38c0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -37,16 +37,25 @@ notifications: matrix: include: - - python: 2.7 + - os: linux + python: 2.7 env: PIP_FLAGS="--pre" - - python: 2.7 + - os: linux + python: 2.7 env: WITH_PYAMG=1 MINIMUM_REQUIREMENTS=1 WITH_QT=1 - - python: 3.4 + - os: linux + python: 3.4 env: OPTIONAL_DEPS=1 WITH_PYSIDE=1 - - python: 3.5 + - os: linux + python: 3.5 env: PIP_FLAGS="--pre" + - os: osx + osx_image: xcode7.3 + language: objective-c + env: TRAVIS_PYTHON_VERSION=3.5 before_install: + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then source tools/travis_osx_install.sh ; fi - ccache -s - export PATH=/usr/lib/ccache:${PATH} - source tools/travis_before_install.sh @@ -55,7 +64,9 @@ before_install: - tools/build_versions.py install: + - section build - python setup.py develop + - section_end build script: tools/travis_script.sh diff --git a/tools/travis_before_install.sh b/tools/travis_before_install.sh index 54a431ed..3f397dbc 100755 --- a/tools/travis_before_install.sh +++ b/tools/travis_before_install.sh @@ -1,11 +1,16 @@ #!/usr/bin/env bash set -ex -export WHEELHOUSE="--no-index --trusted-host travis-wheels.scikit-image.org \ - --find-links=http://travis-wheels.scikit-image.org/" + export COVERALLS_REPO_TOKEN=7LdFN9232ZbSY3oaXHbQIzLazrSf6w2pQ export PIP_DEFAULT_TIMEOUT=60 -sh -e /etc/init.d/xvfb start + +if [[ "$TRAVIS_OS_NAME" != "osx" ]]; then + sh -e /etc/init.d/xvfb start + export WHEELHOUSE="--no-index --trusted-host travis-wheels.scikit-image.org \ + --find-links=http://travis-wheels.scikit-image.org/" +fi + export DISPLAY=:99.0 export PYTHONWARNINGS="d,all:::skimage" export TEST_ARGS="--exe --ignore-files=^_test -v --with-doctest \ diff --git a/tools/travis_osx_install.sh b/tools/travis_osx_install.sh new file mode 100755 index 00000000..468c0a99 --- /dev/null +++ b/tools/travis_osx_install.sh @@ -0,0 +1,16 @@ +#!/bin/bash +brew update +brew install ccache +brew tap caskroom/cask +brew cask install basictex + +export PATH="$PATH:/Library/TeX/texbin" +sudo tlmgr update --self +sudo tlmgr install ucs dvipng anyfontsize + +git clone https://github.com/MacPython/terryfy.git ~/terryfy +source ~/terryfy/travis_tools.sh +get_python_environment macpython $TRAVIS_PYTHON_VERSION ~/macpython_venv +source ~/macpython_venv/bin/activate +pip install virtualenv + diff --git a/tools/travis_script.sh b/tools/travis_script.sh index 70bb28a6..6252304c 100755 --- a/tools/travis_script.sh +++ b/tools/travis_script.sh @@ -3,6 +3,20 @@ set -ex PY=$TRAVIS_PYTHON_VERSION +# Matplotlib settings - do not show figures during doc examples +if [[ $MINIMUM_REQUIREMENTS == 1 || $TRAVIS_OS_NAME == "osx" ]]; then + MPL_DIR=$HOME/.matplotlib +else + MPL_DIR=$HOME/.config/matplotlib +fi + +mkdir -p $MPL_DIR +touch $MPL_DIR/matplotlibrc + +if [[ $TRAVIS_OS_NAME == "osx" ]]; then + echo 'backend : Template' > $MPL_DIR/matplotlibrc +fi + section "Test.with.min.requirements" nosetests $TEST_ARGS skimage section_end "Test.with.min.requirements" @@ -56,16 +70,6 @@ section_end "Install.optional.dependencies" section "Run.doc.examples" - -# Matplotlib settings - do not show figures during doc examples -if [[ $MINIMUM_REQUIREMENTS == 1 ]]; then - MPL_DIR=$HOME/.matplotlib -else - MPL_DIR=$HOME/.config/matplotlib -fi - -mkdir -p $MPL_DIR -touch $MPL_DIR/matplotlibrc echo 'backend : Template' > $MPL_DIR/matplotlibrc @@ -96,7 +100,7 @@ elif [[ $WITH_PYSIDE == 1 ]]; then MPL_QT_API=PySide export QT_API=pyside fi -if [ "$WITH_QT" = "1" -o "$WITH_PYSIDE" = "1" ]; then +if [[ $WITH_QT == 1 || $WITH_PYSIDE == 1 ]]; then echo 'backend: Qt4Agg' > $MPL_DIR/matplotlibrc echo 'backend.qt4 : '$MPL_QT_API >> $MPL_DIR/matplotlibrc fi @@ -107,7 +111,7 @@ section_end "Run.doc.applications" section "Test.with.optional.dependencies" # run tests again with optional dependencies to get more coverage -if [ $OPTIONAL_DEPS == 1 ]; then +if [[ $OPTIONAL_DEPS == 1 ]]; then TEST_ARGS="$TEST_ARGS --with-cov --cover-package skimage" fi nosetests $TEST_ARGS