forked from ArthurBook/py-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
31 lines (24 loc) · 1008 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
.PHONY: all
.PHONY: help
help: # Show help for each of the Makefile recipes.
@grep -E '^[a-zA-Z0-9 -]+:.*#' Makefile | sort| while read -r l; do printf "\033[1;32m$$(echo $$l | cut -f 1 -d':')\033[00m:$$(echo $$l | cut -f 2- -d'#')\n"; done
.PHONY: setup
setup: # Installs project dependencies including all extras with Poetry.
poetry install --all-extras
.PHONY: fmt
fmt: # Formats the code in the src/ and tests/ directories using black.
poetry run isort src/ tests/
poetry run black src/ tests/
.PHONY: lint
lint: # Lints the code in the src/ and tests/ directories using pylint.
poetry run pylint src/ tests/
.PHONY: typecheck
typecheck: # Performs type checking in the src/ and tests/ directories using mypy.
poetry run mypy src/ tests/
.PHONY: test
test: # Runs automated tests using pytest.
export PYTHONPATH=./src/:$PYTHONPATH
poetry run pytest
.PHONY: linecount
linecount: # Counts the number of lines of Python code in the src/ directory.
find src/ -name '*.py' -exec wc -l {} +