generated from MassonNN/masson-aiogram-template
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
61 lines (49 loc) · 1.17 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
.PHONY: help
help:
@echo "USAGE"
@echo " make <commands>"
@echo ""
@echo "AVAILABLE COMMANDS"
@echo " run Start the bot (for docker-compose usage)"
@echo " project-start Start with docker-compose"
@echo " project-stop Stop docker-compose"
@echo " lint Reformat code"
@echo " requirements Export poetry.lock to requirements.txt"
.PHONY: black
black:
poetry run black src/ tests/
.PHONY: isort
isort:
poetry run isort src/ tests/
.PHONY: flake
flake:
poetry run flake8 src/ tests/
.PHONY: lint
lint: black isort flake
.PHONY: run
run:
migrate
poetry run python -m src.bot
# Poetry and environments utils
REQUIREMENTS_FILE := requirements.txt
.PHONY: requirements
requirements:
# Export poetry.lock to requirements.txt if needed
poetry check
poetry export -o ${REQUIREMENTS_FILE} --without-hashes
# Alembic utils
.PHONY: generate
generate:
source .env
poetry run alembic revision --m="$(NAME)" --autogenerate
.PHONY: migrate
migrate:
source .env
poetry run alembic upgrade head
# Docker utils
.PHONY: project-start
project-start:
docker-compose up --force-recreate ${MODE}
.PHONY: project-stop
project-stop:
docker-compose down --remove-orphans ${MODE}