-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
73 lines (60 loc) · 1.37 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
68
69
70
71
72
73
DIRS_PYTHON := dotty stubs tests
.PHONY: help
help:
@echo "Usage: make <target>"
@echo
@echo "Targets:"
@echo " help This help (default target)"
@echo " deps Install all dependencies"
@echo " format Format source code"
@echo " lint Run lint checks"
@echo " test Run tests"
@echo " ci Install dependencies, run lints and tests"
@echo " serve Run the (development) server"
.PHONY: deps
deps:
pipenv install --dev
.PHONY: format
format: \
format-isort \
format-black
.PHONY: format-isort
format-isort:
pipenv run isort --profile=black $(DIRS_PYTHON)
.PHONY: format-black
format-black:
pipenv run black --line-length 100 $(DIRS_PYTHON)
.PHONY: lint
lint: \
lint-isort \
lint-black \
lint-flake8 \
lint-mypy
.PHONY: lint-isort
lint-isort:
pipenv run isort --profile=black --check-only --diff $(DIRS_PYTHON)
.PHONY: lint-black
lint-black:
pipenv run black --check --line-length 100 --diff $(DIRS_PYTHON)
.PHONY: lint-flake8
flake8:
pipenv run flake8 --max-line-length 100 $(DIRS_PYTHON)
.PHONY: lint-mypy
lint-mypy:
MYPYPATH=$(PWD)/stubs pipenv run mypy $(DIRS_PYTHON)
.PHONY: test
test:
pipenv run pytest \
--cov-report term-missing \
--cov-report lcov \
--cov=dotty \
tests/
.PHONY: ci
ci: \
deps \
lint \
test
.PHONY: serve
serve:
DATA_DIR=$(PWD)/tests/data \
pipenv run uvicorn dotty.main:app --host 0.0.0.0 --port 8080 --reload