sudo: false
# dist: trusty

language: python

python:
  - 2.7
  - 3.5
  - 3.6

branches:
  only:
    - master

before_install:
  - if [ ${TRAVIS_PYTHON_VERSION:0:1} == "2" ]; then wget http://repo.continuum.io/miniconda/Miniconda-3.5.5-Linux-x86_64.sh -O miniconda.sh; else wget http://repo.continuum.io/miniconda/Miniconda3-3.5.5-Linux-x86_64.sh -O miniconda.sh; fi
  - chmod +x miniconda.sh
  - ./miniconda.sh -b -p /home/travis/mc
  - export PATH=/home/travis/mc/bin:$PATH
  
install:
  - conda config --set always_yes true
  - conda update conda
  - conda create -n testenv pip nose python=$TRAVIS_PYTHON_VERSION numpy astropy pathlib pillow scipy matplotlib
#  - conda install --yes --file requirements.conda
  - source activate testenv
  - pip install -U pytest
  - pip install pytest-cov
  - pip install pathlib
  - python setup.py install

script:
  - pytest -v --cov=tests/

after_success:
  - codecov
  
notifications:
  email:
    on_success: change
    on_failure: always
  webhooks:
    urls:
      - https://webhooks.gitter.im/e/6b9d6dacd08d3e45e1b3
    on_success: change  # options: [always|never|change] default: always
    on_failure: always  # options: [always|never|change] default: always
    on_start: never     # options: [always|never|change] default: always
