-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
76 lines (50 loc) · 1.37 KB
/
Makefile
File metadata and controls
76 lines (50 loc) · 1.37 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
64
65
66
67
68
69
70
71
72
73
74
75
76
.PHONY: isort isort-fix flake8 lint export-req migrate migration migration-downgrade black black-fix ruff ruff-fix lint-fix
PYTHON := $(shell which python)
RUN := $(PYTHON) -m
ifneq (,$(wildcard ./.env))
include .env
export
endif
isort:
$(RUN) isort --check-only app --profile black
black:
$(RUN) black --check app
black-fix:
$(RUN) black app
isort-fix:
$(RUN) isort app
ruff:
$(RUN) ruff check app
ruff-fix:
$(RUN) ruff check app --fix
flake8:
$(RUN) flake8 app --max-line-length=88
lint: isort flake8 ruff
lint-fix: isort-fix ruff-fix
migrate:
$(RUN) alembic upgrade head
migration:
$(RUN) alembic revision --autogenerate -m "$(M)"
migration-downgrade:
$(RUN) alembic downgrade -1
export-req: ## Export requirements.txt
poetry export -f requirements.txt --with dev --without-hashes -o requirements.txt
DC := docker-compose -f docker/docker-compose.yml
.PHONY: docker-up docker-down docker-build docker-restart docker-logs docker-rebuild
docker-up:
$(DC) up -d
docker-down:
$(DC) down
docker-build:
$(DC) build
docker-restart:
$(DC) down && $(DC) up -d --build
docker-rebuild:
$(DC) down && $(DC) build --no-cache && $(DC) up -d
docker-logs:
$(DC) logs -f
.PHONY: celery-beat celery-worker
celery-worker:
$(RUN) celery -A shared.celery_app:celery worker --loglevel=info
celery-beat:
$(RUN) celery -A shared.celery_app:celery beat --loglevel=info