-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
80 lines (57 loc) · 1.26 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
74
75
76
77
78
79
80
NAME=tedmiston/wtf-covid-19-ohio
TAG=latest
IMAGE=$(NAME):$(TAG)
# -- build --
.PHONY: clean
clean:
rm -rf .mypy_cache/ .pytest_cache/ **/__pycache__/ .coverage htmlcov/
.PHONY: build
build:
docker build --target=prod --tag=$(IMAGE) .
.PHONY: build-test
build-test:
docker build --target=test --tag=$(IMAGE)-test .
# -- run --
.PHONY: run-local
run-local:
poetry run python -m app
.PHONY: run-docker
run-docker:
docker run --rm $(IMAGE)
.PHONY: debug-docker
debug-docker:
docker run --rm -it --entrypoint=bash $(IMAGE)
# -- test --
.PHONY: test
test:
poetry run pytest --cov=app
.PHONY: test-docker
test-docker: build-test
docker run --rm $(IMAGE)-test
# -- mypy --
.PHONY: mypy
mypy:
poetry run mypy --strict --ignore-missing-imports .
# -- coverage --
.PHONY: coverage-html
coverage-html:
poetry run coverage html
.PHONY: coverage-html-show
coverage-html-show: coverage-html
cd htmlcov/ && open http://localhost:8000 && poetry run python -m http.server
# -- format --
.PHONY: format-check
format-check:
poetry run black --check .
.PHONY: format-dry-run
format-dry-run:
poetry run black --diff .
.PHONY: format
format:
poetry run black .
# -- misc --
.PHONY: push
push:
./ci/push.sh $(IMAGE)
cache-clear:
rm "${HOME}/.wtf-coronavirus-ohio/cache.sqlite"