Files
template-backend-service/Makefile
2024-12-16 10:26:11 +03:00

38 lines
938 B
Makefile

SERVICE_DIR := src
TXT_BOLD := \e[1m
TXT_MAGENTA := \e[35m
TXT_RESET := \e[0m
setup:
@poetry install --sync
setup-pre-commit:
@poetry run pre-commit install
lint:
@printf "${TXT_BOLD}${TXT_MAGENTA}=========================== RUFF ==============================${TXT_RESET}\n"
@poetry run ruff check --fix --show-fixes --exit-non-zero-on-fix .
@printf "${TXT_BOLD}${TXT_MAGENTA}=========================== MYPY ==============================${TXT_RESET}\n"
@poetry run mypy $(SERVICE_DIR)/
format:
@poetry run ruff format $(SERVICE_DIR)/ tests/ migrations/
start:
@poetry run python -m $(SERVICE_DIR).api_app
create-migrations:
@poetry run alembic revision --autogenerate -m "${COMMENT}"
apply-migrations:
@poetry run alembic upgrade head
revert-migrations:
@poetry run alembic downgrade $(REVISION)
revert-last-migration:
@poetry run alembic downgrade head-1
test:
@poetry run pytest tests --cov $(SERVICE_DIR) -vv