-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMakefile
68 lines (56 loc) · 1.42 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
default: | help
POETRY_RUN := poetry run
PYTHON := $(POETRY_RUN) python
# -------------------------
# install
# -------------------------
.PHONY: install
install: ## install this project
pip install poetry
poetry install --no-dev
.PHONY: develop
develop: ## setup project for development
pip install poetry
poetry install
# -------------------------
# test
# -------------------------
.PHONY: unittest
unittest: ## run unit test for api with coverage
$(PYTHON) -m pytest -v --durations=0 --cov-report=term-missing --cov=prts tests
.PHONY: test
test: ## run all test
make unittest
# -------------------------
# coding style
# -------------------------
.PHONY: lint
lint: ## type check
$(PYTHON) -m flake8 prts
#typecheck: ## typing check
# $(PYTHON) -m mypy \
# --allow-redefinition \
# --ignore-missing-imports \
# --disallow-untyped-defs \
# --warn-redundant-casts \
# --no-implicit-optional \
# --html-report ./mypyreport \
# prts
.PHONY: format
format: ## auto format
$(PYTHON) -m autoflake \
--in-place \
--remove-all-unused-imports \
--remove-unused-variables \
--recursive prts
$(PYTHON) -m isort prts
$(PYTHON) -m black \
--line-length=119 \
prts
.PHONY: pre-push
pre-push: ## run before `git push`
make test
make format
make lint
help: ## Show all of tasks
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'