-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
47 lines (35 loc) · 1.17 KB
/
Copy pathMakefile
File metadata and controls
47 lines (35 loc) · 1.17 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
.DEFAULT_GOAL := help
SHELL := bash
.PHONY : run test check format db-migrate db-upgrade help
# Запускаем проект
run:
uv run granian --interface asgi travelexhibition/main:make_app --factory
# Запускаем тесты
test:
uv run pytest
# Проверяем линтером
check:
@echo Running project linters...
uv run ruff check src
# Делаем автоформат
format:
@echo Running project linters...
uv run ruff --fix src
# Новая миграция
db-migrate:
alembic revision --autogenerate -m "New migration"
# Применить миграции
db-upgrade:
alembic upgrade head
# Список команд
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
ALEMBIC_CONFIG = travelexhibit/alembic.ini
check-alembic:
@command -v alembic >/dev/null 2>&1 || { echo "Alembic is not installed. Run 'make install'."; exit 1; }
revision: check-alembic
alembic -c $(ALEMBIC_CONFIG) revision -m '$(msg)' --autogenerate
upgrade: check-alembic
alembic -c $(ALEMBIC_CONFIG) upgrade head
downgrade: check-alembic
alembic -c $(ALEMBIC_CONFIG) downgrade -1