feat: mongodb 单后端精简分支 — Beanie 2.x + pymongo async,移除 MySQL/alembic

This commit is contained in:
2026-08-21 21:28:51 +08:00
parent 981bee5a46
commit c84af64ce8
18 changed files with 25 additions and 763 deletions

View File

@@ -1,21 +1,15 @@
[project]
name = "fastapi-template"
version = "0.1.0"
description = "开箱即用的 FastAPI 模板MySQL(SQLAlchemy2.0 async) / MongoDB(Beanie) 可切换"
description = "FastAPI 模板MongoDB + Beanie 单后端分支)"
requires-python = ">=3.11"
dependencies = [
"fastapi>=0.115",
"uvicorn[standard]>=0.30",
"pydantic>=2.7",
"pydantic-settings>=2.4",
# MySQL backend
"sqlalchemy[asyncio]>=2.0",
"aiomysql>=0.2.0",
"alembic>=1.13",
# MongoDB backend
"beanie>=2.0",
"pymongo>=4.9",
"cryptography>=50.0.0",
]
[dependency-groups]
@@ -37,8 +31,6 @@ ignore = [
]
[tool.ruff.lint.per-file-ignores]
"alembic/env.py" = ["E402", "F401"] # 需要先 fileConfig 再 import 应用模块
"alembic/versions/*" = ["I001"] # 迁移文件是自动生成物,不整理 import
"tests/conftest.py" = ["E402"] # 需要先设环境变量再 import app
[tool.pytest.ini_options]