language: python
sudo: required
dist: xenial

env:
- PLY=ply==3.8
- PLY=ply

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

# command to install dependencies
install:
  - "pip install $PLY"
  - "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
deploy:
- provider: pypi
  user: $PYPI_USERNAME
  password: $PYPI_PASSWORD
  on:
    tags: true

language: python
sudo: required
dist: xenial

env:
- PLY=ply==3.8
- PLY=ply

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

# command to install dependencies
install:
  - "pip install $PLY"
  - "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

Move tag deploy to a stage
Move tag deploy to a stage
