-
Notifications
You must be signed in to change notification settings - Fork 79
/
Makefile
78 lines (45 loc) · 980 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
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
VENV := .venv
PROJECT := service
TESTS := tests
IMAGE_NAME := reco_service
CONTAINER_NAME := reco_service
# Prepare
.venv:
poetry install --no-root
poetry check
setup: .venv
# Clean
clean:
rm -rf .mypy_cache
rm -rf .pytest_cache
rm -rf $(VENV)
# Format
isort_fix: .venv
poetry run isort $(PROJECT) $(TESTS)
black_fix:
poetry run black $(PROJECT) $(TESTS)
format: isort_fix black_fix
# Lint
isort: .venv
poetry run isort --check $(PROJECT) $(TESTS)
.black:
poetry run black --check --diff $(PROJECT) $(TESTS)
flake: .venv
poetry run flake8 $(PROJECT) $(TESTS)
mypy: .venv
poetry run mypy $(PROJECT) $(TESTS)
pylint: .venv
poetry run pylint $(PROJECT) $(TESTS)
lint: isort flake mypy pylint
# Test
.pytest:
poetry run pytest $(TESTS)
test: .venv .pytest
# Docker
build:
docker build . -t $(IMAGE_NAME)
run: build
docker run -p 8080:8080 --name $(CONTAINER_NAME) $(IMAGE_NAME)
# All
all: setup format lint test run
.DEFAULT_GOAL = all