Skip to content

Commit

Permalink
add help target to makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
programmingAthlete committed Jan 5, 2024
1 parent a0c2877 commit 7495eb3
Showing 1 changed file with 22 additions and 5 deletions.
27 changes: 22 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit 7495eb3

Please sign in to comment.