From ce3116bfbfed20dd88f8e2f85ac1fbd5f7a279da Mon Sep 17 00:00:00 2001 From: Andreas Zweili Date: Sun, 13 Oct 2019 10:06:46 +0100 Subject: [PATCH] improve Makefile --- Makefile | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index b2500d0..7bb3338 100644 --- a/Makefile +++ b/Makefile @@ -5,24 +5,31 @@ SHELL=/bin/bash run: venv python3 sensors -test: - pytest --cov=. --cov-report=html +test: venv/development + pytest --cov=. --cov-report=term -developement: - python3 -m venv venv +venv/development: + test -d venv || python3 -m venv venv ( \ source venv/bin/activate; \ pip3 install -e .; \ pip3 install -r requirements/development.txt; \ ) + touch venv/development venv: - python3 -m venv venv + test -d venv || python3 -m venv venv ( \ source venv/bin/activate; \ pip3 install .; \ ) +venv/bin/activate: venv + ( \ + source venv/bin/activate; \ + touch venv/bin/activate; \ + ) + clean: rm -rf venv/ find . \( -name __pycache__ -o -name "*.pyc" \) -delete