CI: Basics with Travis

For some time I wanted to learn a bit about CI/CD. Today I have given a go to Travis.

All this is based on Kirk Byers python course and his git repo.

So I just created an empty repo and started working on it:

$ git clone

$ cd test-ci
$ pyenv local 3.7.3
$ python -m venv virt_env
$ source virt_env/bin/active

$ python -m pip install pylama
$ python -m pip install black
$ python -m pip install pytest
$ python -m pip install tox

$ mkdir tests

$ vim tests/
def increment(x):
return x + 1

def test_answer():
assert increment(4) == 5

$ vim requirements.txt

$ vim .travis.yml
language: python
# command to install dependencies
pip install -r requirements.txt
# command to run tests
pylama .
black --check .
py.test -s -v tests/

Then you create an account with that is “free” and you link up to your repo. As soon as you commit, you will how the tests run and if they are successful.

As I have now a basic setup, I hope I carry on using it to any new python stuff I try.