# Copyright 2016 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
################################################################################

language: generic
sudo: false

matrix:
  include:
    - os: linux
      dist: trusty
    - os: osx

before_script:
  - python --version
  - pip --version

script:
  - make test

# Copyright 2016 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

language: generic
sudo: false

matrix:
  include:
    - os: linux
      group: travis_latest
      language: python
      python: 2.7
    - os: linux
      group: travis_latest
      language: python
      python: 3.5
    - os: linux
      group: travis_latest
      language: python
      python: 3.6
    - os: osx
      language: generic
      env: PYTHON=2.7
      before_install:
        - brew update
        - brew install python
        - virtualenv env -p python2.7
        - source env/bin/activate
    - os: osx
      language: generic
      env: PYTHON=3
      # Travis CI doesn't support Python builds on OSX according to:
      # https://docs.travis-ci.com/user/languages/python/
      # You can make it work as follows thanks to this helpful comment:
      # https://github.com/travis-ci/travis-ci/issues/2312#issuecomment-289140791
      before_install:
        - brew update
        - brew install python3
        - virtualenv env -p python3
        - source env/bin/activate

before_script:
  - python --version
  - pip --version

script:
  - make test

Fix Python build on OS X.
Fix Python build on OS X.

Travis CI doesn't support Python builds on OSX according to:
https://docs.travis-ci.com/user/languages/python/

This fixes the Python build on OS X by using `language: generic` and manually
installing Python on OS X.
