-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
73 lines (52 loc) · 1.56 KB
/
Makefile
File metadata and controls
73 lines (52 loc) · 1.56 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
-include .env
export
export PYTHONPATH := $(shell pwd)
export PROJECT_NAME = asyncio_ddd
.PHONY: help
help:
@$(MAKE) -pRrq -f $(lastword $(MAKEFILE_LIST)) : 2>/dev/null | awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' | sort | egrep -v -e '^[^[:alnum:]]' -e '^$@$$'
install:
poetry install
install-app:
poetry install --no-dev --no-test
uninstall:
pip3 freeze | xargs pip3 uninstall -y
test:
poetry run pytest tests
format:
poetry run ruff format ${PROJECT_NAME} tests
poetry run black ${PROJECT_NAME} tests
lint:
poetry run black ${PROJECT_NAME} tests --check
poetry run mypy ${PROJECT_NAME} tests
poetry run ruff check ${PROJECT_NAME} tests || true
clean:
rm -rf .idea
rm -rf .pytest_cache
rm -f .coverage
rm -rf output
rm -rf .mypy_cache
rm -rf .ruff_cache
run:
poetry run python3 -m uvicorn asyncio_ddd.application:app --reload
coverage:
poetry run pytest --cov-report term-missing --cov=${PROJECT_NAME}
wait-postgres:
while ! curl http://localhost:5432/ 2>&1 | grep -q '52'; do sleep 1; done;
wait-rabbitmq:
while ! curl -s localhost:15672 > /dev/null; do sleep 1; done;
###############################
### DOCKER HELPERS ###
###############################
up:
docker compose ${DOCKER_COMPOSE_FILES} up --build -d
down:
docker compose ${DOCKER_COMPOSE_FILES} down
downup: down up
###############################
### DB MIGRATIONS MANAGEMENT ##
###############################
create-migration:
poetry run alembic revision --autogenerate -m "$(m)"
run-migrations:
poetry run alembic upgrade head