language: python

dist: xenial

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

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

install:
  - pip install .

script:
  - sudo apt-get update && sudo apt-get install -y pigz
  - python setup.py --version  # Detect encoding problems
  - python -m pytest

env:
  global:
    - TWINE_USERNAME=marcelm

jobs:
  include:
    - stage: deploy
      services:
        - docker
      python: "3.6"
      install: python3 -m pip install twine
      if: tag IS present
      script:
        - |
          python3 setup.py sdist
          ls -l dist/
          python3 -m twine upload dist/*

  allowed_failures:
    - python: "3.8-dev"
language: python

dist: xenial

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

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

install:
  - pip install .

script:
  - sudo apt-get update && sudo apt-get install -y pigz
  - python setup.py --version  # Detect encoding problems
  - python -m pytest

env:
  global:
    - TWINE_USERNAME=marcelm

jobs:
  include:
    - stage: deploy
      services:
        - docker
      python: "3.6"
      install: python3 -m pip install twine
      if: tag IS present
      script:
        - |
          python3 setup.py sdist
          python3 -m pip wheel -w dist/ .
          ls -l dist/
          python3 -m twine upload dist/*

  allowed_failures:
    - python: "3.8-dev"

Create and upload a wheel during release
Create and upload a wheel during release
