[project]
name = "<<package_name>>"
version = "<<project_version>>"
description = "<<project_description>>"
readme = "README.md"
requires-python = ">=3.12"
dependencies = [
<%if mcp_backend_is_official%>    "mcp[cli]>=1.2,<2",
<%else%>    "fastmcp>=2,<3",
<%endif%>    "uvicorn[standard]>=0.32.0",
    "pydantic>=2.9.0",
    "pydantic-settings>=2.6.0",
    "structlog>=24.4.0",
    "rich>=13.9.0",
    "starlette>=0.40.0",
<%if mcp_backend_is_official%><%if auth_enabled%>    "pyjwt[crypto]>=2.9.0,<3",
<%endif%><%endif%>]

[dependency-groups]
dev = [
    "ruff>=0.7.0",
    "httpx>=0.27.0",
    "pytest>=8.3.0",
    "pytest-asyncio>=0.24.0",
]

[tool.ruff]
line-length = 100
target-version = "py312"

[tool.ruff.lint]
select = ["E", "F", "I", "UP", "B", "SIM"]

# 这两个测试文件的模块级 import 故意排在顶部的 authlib 告警静音块之后：必须先
# filterwarnings 再 `import app.server`（它触发 `import fastmcp` → `from authlib.jose`），
# 否则 authlib 的一次性 simplefilter("always", ...) 会抢先让告警照常打印。此处的延迟
# import 是该静音契约的一部分，E402 属误报，用 per-file-ignores 精确豁免（不放宽全局规则）。
# These two test files intentionally import after the top-of-file authlib warning-silencing
# block: filterwarnings MUST run before `import app.server`, so E402 is a false positive here.
[tool.ruff.lint.per-file-ignores]
"tests/conftest.py" = ["E402"]
"tests/test_auth.py" = ["E402"]

[tool.ruff.format]
quote-style = "double"

[tool.pytest.ini_options]
asyncio_mode = "auto"
pythonpath = ["."]
testpaths = ["tests"]
# 精确忽略第三方 fastmcp 内部触发的 authlib.jose 弃用告警（非项目代码）；
# pytest 不经过 main.py 的运行时静音，故在此单独过滤。不要用宽泛的
# ignore::DeprecationWarning——那会掩盖项目自身的告警。official backend 无 authlib，匹配不到即不生效。
# Narrowly ignore the authlib.jose deprecation warning fired inside third-party fastmcp
# (not our code); pytest bypasses main.py's runtime silencing so filter it here. Do NOT use a
# blanket ignore::DeprecationWarning — that would hide the app's own warnings. No-op on official.
filterwarnings = [
    "ignore:.*authlib\\.jose.*:DeprecationWarning",
]
