# Do all the available tests. Replace .travis.yml with this file and do a
# commit (in a new branch) to trigger the long testing (before a release or
# after big changes).
language: python
matrix:
  include:
    - python: "2.7"
      env: STANDALONE=no TARGET=numpy CYTHON=yes MINIMAL_VERSIONS=no
    - python: "2.7"
      env: STANDALONE=no TARGET=numpy CYTHON=yes MINIMAL_VERSIONS=yes
    - python: "2.7"
      env: STANDALONE=no TARGET=weave CYTHON=yes MINIMAL_VERSIONS=no
    - python: "2.7"
      env: STANDALONE=no TARGET=cython CYTHON=yes MINIMAL_VERSIONS=no
    - python: "3.3"
      env: STANDALONE=no TARGET=numpy CYTHON=yes MINIMAL_VERSIONS=no
    - python: "3.3"
      env: STANDALONE=no TARGET=cython CYTHON=yes MINIMAL_VERSIONS=no
    - python: "3.4"
      env: STANDALONE=no TARGET=numpy CYTHON=yes MINIMAL_VERSIONS=no
    - python: "3.4"
      env: STANDALONE=no TARGET=numpy CYTHON=yes MINIMAL_VERSIONS=yes
    - python: "3.4"
      env: STANDALONE=no TARGET=cython CYTHON=yes MINIMAL_VERSIONS=no
    - python: "2.7"
      env: STANDALONE=yes CYTHON=no MINIMAL_VERSIONS=no
    - python: "3.4"
      env: STANDALONE=yes CYTHON=no MINIMAL_VERSIONS=no
    - python: "2.7"
      env: STANDALONE=yes CYTHON=no MINIMAL_VERSIONS=yes
    - python: "3.4"
      env: STANDALONE=yes CYTHON=no MINIMAL_VERSIONS=yes
    - python: "2.7"
      env: STANDALONE=no TARGET=numpy CYTHON=no MINIMAL_VERSIONS=no
    - python: "2.7"
      env: STANDALONE=no TARGET=weave CYTHON=no MINIMAL_VERSIONS=no

# Use miniconda to install binary versions of numpy etc. from continuum
# analytic's repository. Follows an approach described by Dan Blanchard:
# https://gist.github.com/dan-blanchard/7045057
before_install:
- if [ ${TRAVIS_PYTHON_VERSION:0:1} == "2" ]; then wget http://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh; else wget http://repo.continuum.io/miniconda/Miniconda3-3.7.3-Linux-x86_64.sh -O miniconda.sh; fi
- chmod +x miniconda.sh
- ./miniconda.sh -b
- if [ ${TRAVIS_PYTHON_VERSION:0:1} == "2" ]; then export PATH=/home/travis/miniconda/bin:$PATH; else export PATH=/home/travis/miniconda3/bin:$PATH; fi
# The next couple lines fix a crash with multiprocessing on Travis and are not specific to using Miniconda
- sudo rm -rf /dev/shm
- sudo ln -s /run/shm /dev/shm
# command to install dependencies
install:
  - conda update --yes conda
  - if [[ $MINIMAL_VERSIONS == 'yes' ]]; then
    conda create -n travis_conda --yes pip python=$TRAVIS_PYTHON_VERSION numpy==1.8.0 scipy==0.13.3 nose sphinx ipython sympy==0.7.6 jinja2==2.7 pyparsing;
    else
    conda create -n travis_conda --yes pip python=$TRAVIS_PYTHON_VERSION numpy scipy nose sphinx ipython sympy pyparsing jinja2;
    fi
  - source activate travis_conda
  - if [[ $CYTHON == 'yes' ]]; then conda install --yes cython; SETUP_ARGS=--with-cython; else SETUP_ARGS=""; fi
  - pip install -q coveralls --use-mirrors
  - python setup.py install $SETUP_ARGS --fail-on-error
# command to run tests (make sure to not run it from the source directory)
script:
- export SRCDIR=$(pwd)
- if [[ $STANDALONE == 'yes' ]]; then SCRIPTFILE="$SRCDIR"/dev/tools/run_nose_tests_standalone.py; else SCRIPTFILE="$SRCDIR"/dev/tools/tests/run_nose_tests_"$TARGET"_long.py; fi
- cd ~;coverage run --rcfile="$SRCDIR"/.coveragerc "$SCRIPTFILE"
notifications:
  email: false
