-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
50 lines (35 loc) · 1.21 KB
/
Copy pathMakefile
File metadata and controls
50 lines (35 loc) · 1.21 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
.PHONY: help install dev run lint fmt typecheck test cov clean docker-build docker-up docker-down
PYTHON ?= python3
VENV ?= .venv
BIN = $(VENV)/bin
help:
@awk 'BEGIN {FS = ":.*##"} /^[a-zA-Z_-]+:.*##/ {printf " \033[36m%-16s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
$(VENV):
$(PYTHON) -m venv $(VENV)
$(BIN)/pip install --upgrade pip
install: $(VENV) ## Install runtime deps
$(BIN)/pip install -e .
dev: $(VENV) ## Install runtime + dev deps
$(BIN)/pip install -e ".[dev]"
run: ## Run the bot locally (reads .env)
$(BIN)/python -m bot
lint: ## Ruff lint
$(BIN)/ruff check src tests
fmt: ## Ruff format + auto-fix
$(BIN)/ruff format src tests
$(BIN)/ruff check --fix src tests
typecheck: ## Mypy type checking
$(BIN)/mypy src
test: ## Run tests
$(BIN)/pytest
cov: ## Tests with HTML coverage
$(BIN)/pytest --cov=bot --cov-report=html
clean: ## Clean caches
rm -rf build dist *.egg-info .pytest_cache .mypy_cache .ruff_cache htmlcov .coverage
find . -type d -name __pycache__ -exec rm -rf {} +
docker-build: ## Build docker image
docker build -t tg-bot-todo:latest .
docker-up: ## Start via docker compose
docker compose up -d --build
docker-down: ## Stop docker compose
docker compose down