Continuous Integration for Python

The great article about Bitrise Pipelines and Tox for Python CI unfortunately does no longer exist. But I found this great article.

Basically you need a simple script like this, called bitbucket-pipelines.yml in your repo.

# This is a sample build configuration for Python.
# Check our guides at for more examples.
# Only use spaces to indent your .yml configuration.
# -----
image: python:3.5.1

    - step:
        script: # Modify the commands below to build your repository.
          - pip install -U tox
          - pip --version
          - tox --version
          # Actually run tox (build, setup and run tests, as specified in tox.ini)
          - tox

The rest of the setup is quite straight-forward if you are used to work with tox.

I’ve create a file called tox.ini that makes sure that the requirements are installed and the tests are run with nosetests:

envlist = py35
skipsdist = true
deps = -r{toxinidir}/requirements.txt
commands = nosetests -w UnitTests/