language: python
sudo: required
dist: xenial

python:
  - "2.7"
  - "3.4"
  - "3.5"
  - "3.6"
  - "3.7"

# command to install dependencies
install:
  - "pip install ."
  - "pip install -r testing-requirements.txt"
  - "pip list"
# command to run tests
script:
  - tests/run_tests.sh

jobs:
  include:
  - stage: format-check
    python:
    - "3.6"
    install:
    - pip install black
    script:
    - black --check -S src

  # Deploy to pypi on tagged commit
  - stage: deploy
    if: tag IS present
    python: "3.6"
    install: skip
    script: skip
    deploy:
    - provider: pypi
      user: $PYPI_USERNAME
      password: $PYPI_PASSWORD
      distributions: sdist
      on:
        tags: true
