language: python
python:
  - "2.7"
sudo: true
addons:
  apt:
    packages:
        - libatlas-dev 
        - libatlas-base-dev 
        - liblapack-dev
        - libproj-dev
        - gfortran
        - gdal-bin
        - libgdal1-dev
install:
    # Expand include path for building python-gdal bindings.
    - export CPLUS_INCLUDE_PATH="/usr/include/gdal"
    - export C_INCLUDE_PATH="/usr/include/gdal"
    # GDAL python version must match system libgdal version.
    - travis_retry pip install pyflakes pytest pep8 GDAL==1.10.0 pylint
    - travis_retry pip install -r requirements.txt
script: 
    - pyflakes api/source/main/python/datacube

    # Check all agdc files other than 'compat.py'.
    #   -> compat.py contains both Python 2 and 3 syntax, so will fail lint checks.
    - export py_files=$( find agdc -iname '*.py' -not -iname 'compat.py' )
    - pyflakes ${py_files}

    # Check for basic Python 3 incompatiblities.
    - pylint --py3k --reports no ${py_files}

    - py.test agdc
cache: apt

language: python
python:
    - "2.7"
before_install:
    - travis_retry 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
    - travis_retry conda update --yes conda
install:
    - travis_retry conda install --yes python=$TRAVIS_PYTHON_VERSION atlas numpy pytest pylint pyflakes scipy matplotlib dateutil gdal
    - travis_retry pip install -r requirements.txt
script: 
    - pyflakes api/source/main/python/datacube

    # Check all agdc files other than 'compat.py'.
    #   -> compat.py contains both Python 2 and 3 syntax, so will fail lint checks.
    - export py_files=$( find agdc -iname '*.py' -not -iname 'compat.py' )
    - pyflakes ${py_files}

    # Check for basic Python 3 incompatiblities.
    - pylint --py3k --reports no ${py_files}

    - py.test agdc

Switch to miniconda for faster scipy install.
Switch to miniconda for faster scipy install.
