language: python
sudo: false

stages:
  - name: test
  - name: deploy to pypi
    if: type = push AND tag =~ ^\d+\.\d+\.\d+

jobs:
  fast_finish: true
  include:
    - env: TOXENV=flake8

    - env: TOXENV=py27-sqla08
      after_success: &after_success
        - pip install coveralls
        - coveralls

    - env: TOXENV=py27-sqla09
      after_success: *after_success

    - env: TOXENV=py27-sqla10
      after_success: *after_success

    - env: TOXENV=py27-sqla11
      after_success: *after_success

    - env: TOXENV=py27-sqla12
      after_success: *after_success

    - env: TOXENV=py34
      python: "3.4"
      after_success: *after_success

    - env: TOXENV=py35
      python: "3.5"
      after_success: *after_success

    - env: TOXENV=py36
      python: "3.6"
      after_success: *after_success

    - stage: deploy to pypi
      install: pip install "setuptools >= 36.2.7"
      script: skip
      deploy:
        provider: pypi
        user: agronholm
        password:
          secure: dKgCsrEdqjXPLZMXG9GaPNR3GTEMUgzPPUYZo7T4TW08E+pcVwymz4DPa+9jdFYm10dDqofnrVoyPvsN2Bh4vZeoFtGJg+CKV5kIT7TJjmhdjheVSZnQI9tTmDXbQU5IbZQiqDtdCYGfg45AveXKbcBNcZBLD9FpNSC6zp+RKG5s7p5fLTsBFrhbrpRyomDhg+sKC3A6lfBSAb5cTn2aB1c3eZDLsNAuU5qor7RA0diMneqRIRgGY04RnEHUop599QbqdJH4/rVwcxbnXiguKOY1XU+Uys5ut9BGO6vZob1JUuh3IZ5I+qivxjtxhO9f7HGkl/q2BFco1V0KzFbipA/UY04oqBEIPRn7rLUqHHzbtafsg6vt8oDAlM8KN6ZQ9UGrzBYttQNU1ZUG996Ud7w9mbeTiANM9BXlof0J598PhmqCtWHAV2ssATtFFUamnATa7s4hrcGMx7yYrxH7+qzbcUHj89a43Xwxp73PqnjqHhXrMN96DLjL6KXW/AWiQdmw6n49JsR33ouAlS+3mA2V9rPazS6lsfX1XpAtOUdhiL6zhnwFHHDabxEyrQWUR8EDfsnqssyn1R2+qqSg1jwTqlSpgo2kP4btQ/92WaPcHTpaylWVChhfNNLO0Tkr2dwuAWxbWNEzYx7QslMzpwCZfKsistcKQ5nb3D+0QUc=
        distributions: sdist bdist_wheel
        on:
          tags: true

install:
  - pip install "setuptools >= 36.2.7"
  - pip install tox

script: tox
