test-py27:
  stage: test
  image: python:2.7
  script:
    - pip install tox
    - tox -e py27

test-py35:
  stage: test
  image: python:3.5
  script:
     - pip install tox
     - tox -e py35

test-py36:
  stage: test
  image: python:3.6
  script:
    - pip install tox
    - tox -e py36

test-py37:
  stage: test
  image: python:3.7
  script:
    - pip install tox
    - tox -e py37

# only tagged releases
publish:
  stage: deploy
  only:
    - /^v\d+\.\d+\.\d+$/  # eg. "v1.2.3", "v1.0.12" etc.
  except:
    - branches
  environment:
    name: pypi
  script:
    - pip install twine
    - python setup.py sdist bdist_wheel
    - twine upload dist/*

test-py27:
  stage: test
  image: python:2.7
  script:
    - python setup.py test

test-py35:
  stage: test
  image: python:3.5
  script:
     - python setup.py test

test-py36:
  stage: test
  image: python:3.6
  script:
    - python setup.py test

test-py37:
  stage: test
  image: python:3.7
  script:
    - python setup.py test

# only tagged releases
publish:
  stage: deploy
  only:
    - /^v\d+\.\d+\.\d+$/  # eg. "v1.2.3", "v1.0.12" etc.
  except:
    - branches
  environment:
    name: pypi
  script:
    - pip install twine
    - python setup.py sdist bdist_wheel
    - twine upload dist/*

Stop using tox in pipelines
Stop using tox in pipelines
