forked from finmars-platform/finmars-core
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
63 lines (48 loc) · 1.29 KB
/
Copy pathMakefile
File metadata and controls
63 lines (48 loc) · 1.29 KB
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
VENV_NAME = venv
PYTHON = $(VENV_NAME)/bin/python
PIP = $(VENV_NAME)/bin/pip
COMPOSE = docker compose
SERVICE = web
.PHONY: env help venv test lint manage
help:
@echo "Makefile commands:"
@echo " make env - Create env file from template"
@echo " make venv - Create virtual environment"
@echo " make install - Install dependencies"
@echo " make freeze - Freeze dependencies"
@echo " make tests - Run tests"
@echo " make linters - Run ruff formatter and linter"
@echo " make up - Run project"
@echo " make down - Stop project"
@echo " make manage - Run manage.py command"
@echo " make manage-help - Show available manage.py commands"
generate-env:
./generate_env.sh
venv:
python3 -m venv $(VENV_NAME)
install: venv
$(PIP) install -r requirements.txt
freeze: venv
$(PIP) freeze > requirements.txt
tests:
$(COMPOSE) exec -i $(SERVICE) python manage.py test --keepdb $(TEST)
linters:
ruff format; \
ruff check --fix; \
# mypy
migrate:
./migrate.sh
import-sql:
./import-sql.sh
up:
$(COMPOSE) up --build \
--remove-orphans \
--scale migration=0 \
down:
$(COMPOSE) down
manage-help:
$(COMPOSE) exec -T $(SERVICE) python manage.py help
manage:
$(COMPOSE) exec -i $(SERVICE) python manage.py $(filter-out $@,$(MAKECMDGOALS))
%:
@: