47 lines
1.1 KiB
TOML
47 lines
1.1 KiB
TOML
[project]
|
||
name = "fastapi-template"
|
||
version = "0.1.0"
|
||
description = "FastAPI 模板(MySQL + SQLAlchemy 2.0 async 单后端分支)"
|
||
requires-python = ">=3.11"
|
||
dependencies = [
|
||
"fastapi>=0.115",
|
||
"uvicorn[standard]>=0.30",
|
||
"pydantic>=2.7",
|
||
"pydantic-settings>=2.4",
|
||
"sqlalchemy[asyncio]>=2.0",
|
||
"aiomysql>=0.2.0",
|
||
"alembic>=1.13",
|
||
"cryptography>=43", # aiomysql 连 MySQL8 认证需要
|
||
]
|
||
|
||
[dependency-groups]
|
||
dev = [
|
||
"pytest>=8.0",
|
||
"pytest-asyncio>=0.23",
|
||
"httpx>=0.27",
|
||
"ruff>=0.6",
|
||
]
|
||
|
||
[tool.ruff]
|
||
line-length = 100
|
||
target-version = "py311"
|
||
|
||
[tool.ruff.lint]
|
||
select = ["E", "F", "I", "UP", "B", "ASYNC", "RUF"]
|
||
ignore = [
|
||
"RUF001", "RUF002", "RUF003", # 中文文档字符串里的全角标点是有意的
|
||
]
|
||
|
||
[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]
|
||
asyncio_mode = "auto"
|
||
testpaths = ["tests"]
|
||
pythonpath = ["."]
|
||
|
||
[tool.uv]
|
||
package = false
|