language: python
dist: xenial
python:
  - '2.7'
  - '3.4'
  - '3.5'
  - '3.6'
  - '3.7'
  - 'pypy'
  - 'pypy3'
  - '3.8-dev'
install:
  - pip install --upgrade pip
  - pip install tox-travis
script:
  - tox
jobs:
  include:
    - stage: test
    # python envs above are already included into this stage

    - stage: deploy
      python: '3.6'
      env:
      install: pip install -U setuptools setuptools_scm
      script: skip
      deploy:
        provider: pypi
        user: nicoddemus
        distributions: sdist bdist_wheel  
        skip_upload_docs: true
        password:
          secure: QK8ibmCJZeyO9Homs0BljGKNXVQFicw9YhOBozofYZRxexVjUqCGr78BfXPvLcBuAnHcM0XCuzQOMaBIS1T5gi5jiF/hZXxtLfIdzZoxxBTyHyVV6quhzjXJsWC9ILT3GXmhhGiY/eJLCJbPn//uFeEAPYxKST2ANBoxieAfuko=
        on:
          tags: true
          repo: pytest-dev/pytest-faulthandler
  

language: python
dist: xenial
python:
  - '2.7'
  - '3.4'
  - '3.5'
  - '3.6'
  - '3.7'
  - 'pypy'
  - 'pypy3'
  - '3.8-dev'
install:
  - pip install --upgrade pip
  - pip install tox-travis
script:
  - tox

stages:
- name: test
  if: repo = pytest-dev/pytest-faulthandler AND tag IS NOT present
- name: deploy
  if: repo = pytest-dev/pytest-faulthandler AND tag IS present

jobs:
  include:
    - stage: test
    # python envs above are already included into this stage

    - stage: deploy
      python: '3.6'
      env:
      install: pip install -U setuptools setuptools_scm
      script: skip
      deploy:
        provider: pypi
        user: nicoddemus
        distributions: sdist bdist_wheel  
        skip_upload_docs: true
        password:
          secure: QK8ibmCJZeyO9Homs0BljGKNXVQFicw9YhOBozofYZRxexVjUqCGr78BfXPvLcBuAnHcM0XCuzQOMaBIS1T5gi5jiF/hZXxtLfIdzZoxxBTyHyVV6quhzjXJsWC9ILT3GXmhhGiY/eJLCJbPn//uFeEAPYxKST2ANBoxieAfuko=
        on:
          tags: true
          repo: pytest-dev/pytest-faulthandler
  

Use stages to hide/show deploy according to tags
Use stages to hide/show deploy according to tags
