language: python
env:
    global:
        # Set defaults to avoid repeating in most cases
        - PYTHON_VERSION=$TRAVIS_PYTHON_VERSION
        - NUMPY_VERSION=stable
        - MAIN_CMD='python setup.py'
        - CONDA_DEPENDENCIES='xarray dask distributed toolz Cython sphinx cartopy pillow matplotlib scipy pyyaml
          pyproj pyresample coveralls coverage codecov behave netcdf4 h5py h5netcdf gdal rasterio imageio pyhdf
          mock libtiff geoviews zarr python-eccodes geoviews pytest pytest-cov fsspec pylibtiff'
        - PIP_DEPENDENCIES='trollsift trollimage pyspectral pyorbital'
        - SETUP_XVFB=False
        - EVENT_TYPE='push pull_request'
        - SETUP_CMD='test'
        - CONDA_CHANNELS='conda-forge'
        - CONDA_CHANNEL_PRIORITY='strict'
        - MAMBA=True
        - UNSTABLE_DEPS=False
matrix:
  include:
  - env: PYTHON_VERSION=3.8
    os: linux
  - env: PYTHON_VERSION=3.8
    os: osx
    language: generic
  - env: PYTHON_VERSION=3.8
    os: windows
    language: bash
  - env: PYTHON_VERSION=3.7
    os: linux
  - env: PYTHON_VERSION=3.7
    os: osx
    language: generic
  # allowed to fail:
  - os: linux
    env:
      - PYTHON_VERSION=3.8
      - UNSTABLE_DEPS=True

  allow_failures:
  - os: linux
    env:
      - PYTHON_VERSION=3.8
      - UNSTABLE_DEPS=True
install:
    - git clone --depth 1 git://github.com/astropy/ci-helpers.git
    - source ci-helpers/travis/setup_conda.sh
    # See https://github.com/travis-ci/travis-ci/issues/8920
    - if [ $TRAVIS_OS_NAME != "windows" ]; then
        python -c "import fcntl; fcntl.fcntl(1, fcntl.F_SETFL, 0)";
      fi
    - if [ "$UNSTABLE_DEPS" == "True" ]; then
        python -m pip install
        -f https://7933911d6844c6c53a7d-47bd50c35cd79bd838daf386af554a83.ssl.cf2.rackcdn.com
        --no-deps --pre --upgrade
        matplotlib
        numpy
        pandas
        scipy;
        python -m pip install
        --no-deps --upgrade
        git+https://github.com/dask/dask
        git+https://github.com/dask/distributed
        git+https://github.com/zarr-developers/zarr
        git+https://github.com/Unidata/cftime
        git+https://github.com/mapbox/rasterio
        git+https://github.com/pydata/bottleneck
        git+https://github.com/pydata/xarray;
      fi
    - pip install --no-deps -e .
script:
- pytest --cov=satpy satpy/tests
- coverage run -a --source=satpy -m behave satpy/tests/features --tags=-download
- if [ "$TRAVIS_EVENT_TYPE" == "cron" ]; then coverage run -a --source=satpy -m behave satpy/tests/features; fi
#after_success:
#- if [[ $PYTHON_VERSION == 3.8 ]]; then coveralls; codecov; fi
#deploy:
#  - provider: pypi
#    user: dhoese
#    password:
#      secure: frK+0k1STeTM7SizRseP0qdTfOVz9ZMIra+3qEytPdxCLceXAH8LxPU16zj5rdNQxasF1hZ6rAd952fly+ypw2TEf5r2WnStrt7G5QlyE7VB6XGSDpIUxKF1FYccLvYs0/R6Y35MTEPqdM51PM5yEBjoY5b4tA3RF3fDq11cqc/SiWr6DgSLB1WJZULOdtCzBbfGbm5LyJ7yeNbISASSAwVvZTGWw7kJDgi0W5zxwEX82N5tBGbfKIu59qmxyj8FxmcrUwKZ4P3rQNg1kN1utzAB+PSf3GAVvbZfWJQuAKwMqpZgaV9lX0V7eUd/AxPobzEk9WyoNBMIdrSPej5BKWTDiYvaeRTOsggoUCSQJJA/SITEvkJgLWXoKKX2OWrM8RBUO4MoZJpPGXN42PRtMJkV2sx6ZigkpJlHdn39SsIRZX31zsfv8bBhclb70bt1Ts0fDd0rVdZAI6gMI+sgUePwEUn+XbWrvI0sMfDX3QsXDMV393RHgaIPxd+lRqUlYsNOxjsWpsbsvX55ePLxYHsNrv11KKyL/iGjGotVeVUO5D78qvfd4JrsUnMalQyZfW8NTEKa5Ebcs7gYJTwYEOTCQU12BkHOv1zFkjZG5RdGwkEvG3pykLhx+qDyYEd7pKB3TvhzLPqZPSrPxirwcoc0UzCc6ocYdzpqVuViFuk=
#    distributions: sdist
#    skip_existing: true
#    on:
#      tags: true
#      repo: pytroll/satpy
#notifications:
#  slack:
#    rooms:
#    - pytroll:96mNSYSI1dBjGyzVXkBT6qFt#github
