forked from pmareke/python-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
51 lines (39 loc) · 1.61 KB
/
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
.DEFAULT_GOAL := help
.PHONY: help
help: ## Show this help.
@grep -E '^\S+:.*?## .*$$' $(firstword $(MAKEFILE_LIST)) | \
awk 'BEGIN {FS = ":.*?## "}; {printf "%-30s %s\n", $$1, $$2}'
.PHONY: local-setup
local-setup: ## Sets up the local environment (e.g. install git hooks)
scripts/local-setup.sh
.PHONY: build
build: ## Builds the app
docker build .
.PHONY: update
update: ## Updates the app packages
docker-compose run --rm --no-deps python-boilerplate poetry update
.PHONY: install
install: ## Installs a new package in the app. ex: make install package=XXX
docker-compose run --rm --no-deps python-boilerplate poetry add $(package)
docker build .
.PHONY: run
run: ## Runs the app
docker-compose run --rm --no-deps python-boilerplate
.PHONY: check-typing
check-typing: ## Run a static analyzer over the code to find issues
docker-compose run --rm --no-deps python-boilerplate poetry run mypy .
.PHONY: check-format
check-format: ## Checks the code format
docker-compose run --rm --no-deps python-boilerplate poetry run yapf --diff --recursive **/*.py
.PHONY: check-style
check-style: ## Checks the code style
docker-compose run --rm --no-deps python-boilerplate poetry run flake8 .
docker-compose run --rm --no-deps python-boilerplate poetry run pylint ./**/*.py
.PHONY: reformat
reformat: ## Format python code
docker-compose run --rm --no-deps python-boilerplate poetry run yapf --parallel --recursive -ir .
.PHONY: test
test: ## Run all the tests
docker-compose run --rm --no-deps python-boilerplate poetry run pytest -n auto tests -ra
.PHONY: pre-commit
pre-commit: check-format check-typing check-style test