65 lines
1.7 KiB
Makefile
65 lines
1.7 KiB
Makefile
.PHONY: install dev build run worker clean lint format pre-commit-install pre-commit-run
|
|
|
|
# Default target
|
|
help:
|
|
@echo "Available commands:"
|
|
@echo " install Install dependencies using uv"
|
|
@echo " dev Run FastAPI in development mode"
|
|
@echo " run Run FastAPI server"
|
|
@echo " worker Run Celery worker"
|
|
@echo " build Build Docker images"
|
|
@echo " up Start all services with Docker Compose"
|
|
@echo " down Stop all services"
|
|
@echo " clean Remove build artifacts"
|
|
@echo " lint Run ruff linting"
|
|
@echo " format Format code with ruff"
|
|
@echo " pre-commit-install Install pre-commit hooks"
|
|
@echo " pre-commit-run Run pre-commit on all files"
|
|
|
|
# Install dependencies
|
|
install:
|
|
uv sync
|
|
|
|
# Development server
|
|
dev:
|
|
uv run uvicorn main:app --reload --host 0.0.0.0 --port 8000
|
|
|
|
# Production server
|
|
run:
|
|
uv run uvicorn main:app --host 0.0.0.0 --port 8000
|
|
|
|
# Celery worker
|
|
worker:
|
|
uv run celery -A app.core.celery_app worker --loglevel=info
|
|
|
|
# Docker commands
|
|
build:
|
|
docker-compose build
|
|
|
|
up:
|
|
docker-compose up -d
|
|
|
|
down:
|
|
docker-compose down
|
|
|
|
# Clean artifacts
|
|
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 f -name "*.pyo" -delete 2>/dev/null || true
|
|
find . -type d -name "*.egg-info" -exec rm -rf {} + 2>/dev/null || true
|
|
rm -rf .venv dist build 2>/dev/null || true
|
|
|
|
# Code quality
|
|
lint:
|
|
uv run ruff check .
|
|
|
|
format:
|
|
uv run ruff format .
|
|
|
|
# Pre-commit
|
|
pre-commit-install:
|
|
uv run pre-commit install
|
|
|
|
pre-commit-run:
|
|
uv run pre-commit run --all-files
|