Raw File
.travis.yml
# Travis script that uses miniconda in place of the system installed python
# versions.  Allows substantial flexability for choosing versions of
# required packages and is simpler to use to test up-to-date scientific Python
# stack
sudo: false

language: python

env:
  # Default values for common packages, override as needed
  global:
    - CYTHON=
    - PATSY=
    - OPTIONAL=
    - NUMBA=
    - COVERAGE=false
    - USE_NUMBA=true
    - STATSMODELS_MASTER=false

matrix:
  fast_finish: true
  include:
  - python: 2.7
    env:
    - PYTHON=2.7
    - MATPLOTLIB=1.4
    - NUMPY=1.9
    - SCIPY=0.15
    - USE_NUMBA=false
    - PANDAS=0.16
    - COVERAGE=true
  - python: 2.7
    env:
    - PYTHON=2.7
    - NUMBA=0.21
    - NUMPY=1.10
    - SCIPY=0.16
    - MATPLOTLIB=1.5
    - PANDAS=0.17
  - python: 2.7
    env:
    - PYTHON=3.4
    - NUMPY=1.10
    - SCIPY=0.16
    - NUMBA=0.24
    - MATPLOTLIB=1.4
    - PANDAS=0.18
  - python: 2.7
    env:
    - PYTHON=3.5
    - STATSMODELS_MASTER=true
    - COVERAGE=true

addons:
  apt:
    packages:
    - pandoc

# Setup anaconda
before_install:
  - wget http://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh
  - chmod +x miniconda.sh
  - ./miniconda.sh -b
  - export PATH=/home/travis/miniconda/bin:$PATH
  - export PATH=/home/travis/miniconda2/bin:$PATH
  - conda update --yes --quiet conda
  # Fix for headless TravisCI
  - "export DISPLAY=:99.0"
  - "sh -e /etc/init.d/xvfb start"
  # Avoid noise from matplotlib
  - mkdir $HOME/.config
  - mkdir $HOME/.config/matplotlib
  # Location for older version of matplotlib
  - if [ ${MATPLOTLIB} = "1.2" ]; then mkdir $HOME/.matplotlib; fi
  # Build package list to avoid empty package=versions; only needed for versioned pacakges
  - PKGS="python=${PYTHON}"
  - PKGS="${PKGS} numpy"; if [ ${NUMPY} ]; then PKGS="${PKGS}=${NUMPY}"; fi;
  - PKGS="${PKGS} scipy"; if [ ${SCIPY} ]; then PKGS="${PKGS}=${SCIPY}"; fi;
  - PKGS="${PKGS} patsy"; if [ ${PATSY} ]; then PKGS="${PKGS}=${PATSY}"; fi;
  - PKGS="${PKGS} pandas"; if [ ${PANDAS} ]; then PKGS="${PKGS}=${PANDAS}"; fi;
  - PKGS="${PKGS} Cython"; if [ ${CYTHON} ]; then PKGS="${PKGS}=${CYTHON}"; fi;
  - PKGS="${PKGS} matplotlib"; if [ ${MATPLOTLIB} ]; then PKGS="${PKGS}=${MATPLOTLIB}"; fi;
  - PKGS="${PKGS} statsmodels"; if [ ${STATSMODELS} ]; then PKGS="${PKGS}=${STATSMODELS}"; fi;
  - if [ ${USE_NUMBA} = true ]; then PKGS="${PKGS} numba"; if [ ${NUMBA} ]; then PKGS="${PKGS}=${NUMBA}";  fi; fi;
  # Fix for missing libgfortran
  - if [ ${SCIPY} = "0.15" ]; then PKGS="${PKGS} libgfortran=1"; fi

# Install packages
install:
  - conda create --yes --quiet -n arch-test ${PKGS} ${OPTIONAL} statsmodels nbconvert nbformat pytest flake8
  - source activate arch-test
  - pip install coverage coveralls pytest-cov codecov
  - if [ ${STATSMODELS_MASTER} = true ]; then sh ./ci/statsmodels-master.sh; fi;
  - python setup.py build
  - python setup.py install
  - export SRCDIR=${PWD}

script:
  # Show versions
  - conda list
  # flake testing
  - flake8 arch
  # Main test
  - mkdir -p travis-test && cd travis-test
  - py.test -s --cov=arch --pyargs arch

after_success:
  - if [ ${COVERAGE} = true ]; then coveralls --rcfile=${SRCDIR}/.travis_coveragerc; fi
  - if [ ${COVERAGE} = true ]; then codecov; fi
back to top