Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
69 lines (58 loc) · 1.93 KB
/
Copy pathMakefile
File metadata and controls
69 lines (58 loc) · 1.93 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
.PHONY: help init test test-unit format lint clean install-dev run docker-build docker-run
# Default target
help:
@echo "Life Scheduler Bot - Development Commands"
@echo ""
@echo "Available commands:"
@echo " init - Setup venv, install deps, configure pre-commit"
@echo " test - Run all tests"
@echo " test-unit - Unit tests only"
@echo " format - Black + isort formatting"
@echo " lint - Run flake8"
@echo " clean - Clean up build artifacts and cache"
@echo " install-dev - Install development dependencies"
@echo " run - Run the bot locally"
@echo " docker-build- Build Docker image"
@echo " docker-run - Run with docker-compose"
# Setup development environment
init:
python -m venv venv
@echo "Virtual environment created. Please activate it with:"
@echo " Windows: venv\\Scripts\\activate"
@echo " Unix/Mac: source venv/bin/activate"
@echo "Then run: make install-dev"
# Install development dependencies
install-dev:
pip install --upgrade pip
pip install -r requirements-dev.txt
pre-commit install
# Run all tests
test:
pytest tests/ -v --cov=src --cov-report=term-missing
# Run unit tests only
test-unit:
pytest tests/ -v -m "unit" --cov=src --cov-report=term-missing
# Format code
format:
black src/ tests/
isort src/ tests/
# Lint code
lint:
flake8 src/ tests/
mypy src/
# Clean up
clean:
find . -type d -name "__pycache__" -exec rm -rf {} + 2>/dev/null || true
find . -type f -name "*.pyc" -delete 2>/dev/null || true
find . -type d -name "*.egg-info" -exec rm -rf {} + 2>/dev/null || true
find . -name ".coverage" -delete 2>/dev/null || true
find . -type d -name ".pytest_cache" -exec rm -rf {} + 2>/dev/null || true
find . -type d -name ".mypy_cache" -exec rm -rf {} + 2>/dev/null || true
# Run the bot locally
run:
venv/Scripts/activate && python -m src.bot.main
# Docker commands
docker-build:
docker build -t life-schedule-bot .
docker-run:
docker-compose up -d