logo


makefiles


<p>If you repeat lots of bash commands while developing then makefiles can help you out.</p>


1 - The Problem
2 - Chains
3 - Phony Folders
4 - Projects
5 - Quick Notes
6 - Help Commands

You may need to install some dependencies, this is done via;

pip install pytest flake8

There's a few files we use. They are shown below.

Makefile

test:
    pytest tests.py

clean:
    rm -rf __pycache__ .pytest_cache

Note when you copy the above file; the indentation must be a tab in a Makefile. What you copy may contain spaces instead.

common.py

def add(n1, n2):
  return n1 + n2

tests.py

from common import add

def test_add():
    assert add(1, 1) == 2