-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
119 lines (83 loc) · 2.32 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
SUCCESS=@echo "-----------------------\nSUCCESS\n"
DEFAULT: run
.check-venv:
@echo "-----------------------"
@echo "--- Checking virtual environment is activated"
@{ \
if [ -z ${CI} ]; then \
which python | grep "\.venv"; \
fi; \
}
$(SUCCESS)
req-main: .check-venv
@echo "-----------------------"
@echo "--- Compiling main requirements to requirements/main.txt"
pip-compile requirements/main.in > requirements/main.txt
$(SUCCESS)
req-dev: .check-venv
@echo "-----------------------"
@echo "--- Compiling development requirements to requirements/dev.txt"
pip-compile requirements/dev.in > requirements/dev.txt
$(SUCCESS)
requirements: req-main req-dev
sync: .check-venv
@echo "-----------------------"
@echo "--- Installing dependencies"
pip-sync requirements/main.txt
$(SUCCESS)
sync-all: .check-venv
@echo "-----------------------"
@echo "--- Installing dependencies"
pip-sync requirements/main.txt requirements/dev.txt
$(SUCCESS)
migrate: .check-venv
@echo "-----------------------"
@echo "--- Applying DB migrations"
alembic upgrade head
$(SUCCESS)
run: .check-venv
@echo "-----------------------"
@echo "--- Starting up"
python -m colorific
format: .check-venv
@echo "-----------------------"
@echo "--- Reformatting with black, isort"
isort --recursive colorific tests
black colorific tests
$(SUCCESS)
.black-check: .check-venv
@echo "-----------------------"
@echo "--- Running black checks"
black --check colorific tests
$(SUCCESS)
.isort-check: .check-venv
@echo "-----------------------"
@echo "--- Running black checks"
isort --check-only --recursive colorific tests
$(SUCCESS)
.flake: .check-venv
@echo "-----------------------"
@echo "--- Running flake8 checks"
flake8 colorific tests
$(SUCCESS)
.mypy: .check-venv
@echo "-----------------------"
@echo "--- Running mypy checks"
mypy colorific tests
$(SUCCESS)
lint: .isort-check .black-check .mypy .flake
test: .check-venv
@echo "-----------------------"
@echo "--- Running tests"
pytest -x
$(SUCCESS)
docker-up:
@echo "-----------------------"
@echo "--- Starting Docker development services"
docker-compose -f ./docker-compose-dev.yaml up -d
$(SUCCESS)
docker-down:
@echo "-----------------------"
@echo "--- Stopping Docker development services"
docker-compose -f ./docker-compose-dev.yaml down
$(SUCCESS)