55 lines
832 B
Makefile
55 lines
832 B
Makefile
.PHONY: install dev test test-unit test-integration lint format migrate seed health build up down
|
|
|
|
# 安装依赖
|
|
install:
|
|
poetry install
|
|
|
|
# 开发运行
|
|
dev:
|
|
poetry run python app.py
|
|
|
|
# 运行全部测试
|
|
test:
|
|
poetry run pytest
|
|
|
|
# 单元测试
|
|
test-unit:
|
|
poetry run pytest tests/unit
|
|
|
|
# 集成测试
|
|
test-integration:
|
|
poetry run pytest tests/integration
|
|
|
|
# 代码规范检查
|
|
lint:
|
|
poetry run flake8 src tests
|
|
poetry run mypy src
|
|
|
|
# 代码自动格式化
|
|
format:
|
|
poetry run ruff check --fix src tests
|
|
|
|
# 数据库迁移
|
|
migrate:
|
|
poetry run alembic upgrade head
|
|
|
|
# 填充测试数据
|
|
seed:
|
|
poetry run python scripts/seed.py
|
|
|
|
# 健康检查
|
|
health:
|
|
poetry run python scripts/health_check.py
|
|
|
|
# Docker 构建
|
|
build:
|
|
docker compose build
|
|
|
|
# Docker 启动
|
|
up:
|
|
docker compose up
|
|
|
|
# Docker 停止
|
|
down:
|
|
docker compose down
|