From 7495eb32e7b98070335b59602da648d53844c1a5 Mon Sep 17 00:00:00 2001 From: programmingAthlete Date: Fri, 5 Jan 2024 16:01:29 +0100 Subject: [PATCH] add help target to makefile --- Makefile | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index f18cc19..7dcd716 100644 --- a/Makefile +++ b/Makefile @@ -4,27 +4,44 @@ PYTHON = python M = $(shell printf "\033[34;1m▶\033[0m") +.DEFAULT_GOAL := help + +.PHONY: help +help: + @echo "Available targets:" + @echo "$(M) help - Display this help message" + @echo "$(M) deps - Install dependencies" + @echo "$(M) deps-tests - Install dependencies for tests" + @echo "$(M) tests - Run tests" + @echo "$(M) coverage - Run coverage tests" + @echo "$(M) lint - Run flake8 for linting" + .PHONY: deps -deps: $(info $(M) installing dependencies...) +deps: + @$(info $(M) installing dependencies...) pip install -r requirements.txt .PHONY: deps-tests -deps-tests: $(info $(M) installing dependencies for tests...) +deps-tests: + @$(info $(M) installing dependencies for tests...) pip install -r requirements-tests.txt .PHONY: tests -tests: $(info $(M) testing package...) +tests: + @$(info $(M) testing package...) pip install -e . > /dev/null && pip install pytest > /dev/null python -m pytest tests .PHONY: coverage -coverage: $(info $(M) coverage testing package...) ## test coverage package +coverage: + @$(info $(M) coverage testing package...) pip install -e . > /dev/null && pip install pytest pytest-cov > /dev/null python -m pytest tests --cov=$(PROJECT_NAME) --cov-fail-under=0 .PHONY: lint -lint: $(info $(M) coverage testing package...) +lint: + @$(info $(M) coverage testing package...) pip install -e . > /dev/null && pip install flake8 > /dev/null flake8 src/$(PROJECT_NAME) \ No newline at end of file