language: python
dist: xenial
sudo: required

cache:
  directories:
    - $HOME/.cache/pip
    - $HOME/.pip-accel

os:
  - linux

python:
  - "3.5"
  - "3.6"
  - "3.7"
  - "nightly"

matrix:
  allow_failures:
    - python: "nightly"

install:
  - python -m pip install -U pip pytest black
  - pip install -e .

script:
  - python -m pytest
  - black --check --diff rpi_backlight tests

skip_join: false

language: python
dist: xenial
sudo: required

cache:
  directories:
    - $HOME/.cache/pip
    - $HOME/.pip-accel

os:
  - linux

python:
  - "3.5"
  - "3.6"
  - "3.7"
  - "nightly"

matrix:
  allow_failures:
    - python: "nightly"

install:
  - python -m pip install -U pip pytest
  - python setup.py install
  # black needs Python 3.6+
  - if [[ $TRAVIS_PYTHON_VERSION != '3.5' ]]; then travis_retry pip install black; fi

script:
  - python -m pytest
  - if [[ $TRAVIS_PYTHON_VERSION != '3.5' ]]; then black --check --diff rpi_backlight tests; fi

skip_join: false

Remove black from Travis CI Python 3.5 stage
Remove black from Travis CI Python 3.5 stage
