forked from Arutemu64/fanfan-bot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
59 lines (47 loc) · 1.21 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
.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 fanfan/
.PHONY: mypy
mypy:
poetry run mypy --strict --pretty --explicit-package-bases --install-types fanfan/
.PHONY: ruff
ruff:
poetry run ruff check fanfan/ --fix --respect-gitignore
.PHONY: lint
lint: black ruff
.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:
poetry run alembic revision --m="$(NAME)" --autogenerate
.PHONY: migrate
migrate:
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}