Files
MusicServer/pyproject.toml
T
snowy-yang 0cae770ace feat(server): 支持 Granian 与 rloop/uvloop/winloop 事件循环
- 新增 scripts/serve.py 启动器:server auto/uvicorn/granian,循环可用性与平台校验(显式不可用直接报错)
- pyproject 增加 granian 可选 extra(granian[reload,rloop,uvloop,winloop],平台 marker 由 granian 维护)
- tests/test_serve.py 覆盖服务器/循环选择与命令拼装;README 补充启动方式、循环矩阵与多 worker 限制
2026-10-23 22:12:08 +08:00

75 lines
1.9 KiB
TOML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
[project]
name = "music-server"
version = "2.0.0"
description = "多平台音乐聚合服务器"
requires-python = ">=3.12,<3.13"
dependencies = [
"fastapi>=0.115",
"uvicorn[standard]>=0.30",
"aiohttp>=3.10",
"brotli>=1.1",
"cryptography>=43",
"qrcode>=8",
"pillow>=10",
]
# 可选:Granian 服务器(Rust HTTP 实现)与高性能事件循环
# rloop —— Granian 内置的 Rust 事件循环,跨平台
# uvloop —— POSIX 上的 libuv 循环
# winloop —— Windows 上的 libuv 循环(uvloop 的 Windows 对应实现)
# 安装:uv sync --extra granian
[project.optional-dependencies]
granian = [
# granian 自带的 extras 已按平台配好 marker:
# rloop(Unix)、uvloop(Unix)、winloop(Windows)、reload(watchfiles)
"granian[reload,rloop,uvloop,winloop]>=2.0",
]
[dependency-groups]
dev = [
"pytest>=8",
"pytest-asyncio>=0.24",
"ruff>=0.6",
"pyright>=1.1.380",
"httpx>=0.27",
]
[tool.ruff]
line-length = 120
target-version = "py312"
src = ["app", "tests", "scripts"]
[tool.ruff.lint]
select = ["E", "F", "W", "I", "UP", "B", "BLE", "ASYNC", "RUF"]
ignore = [
"RUF001", # 中文全角标点在文案里是刻意用法
"RUF002",
"RUF003",
"E501", # 行宽由 formatter 决定,长 URL/中文注释不强拆
]
[tool.ruff.lint.per-file-ignores]
"tests/**" = ["B011"]
[tool.ruff.format]
quote-style = "double"
[tool.pyright]
include = ["app", "tests", "scripts"]
exclude = [".venv", "tmp"]
pythonVersion = "3.12"
typeCheckingMode = "basic"
reportMissingTypeStubs = false
reportUnknownMemberType = false
reportUnknownVariableType = false
reportUnknownArgumentType = false
reportUnknownParameterType = false
reportMissingParameterType = false
reportUntypedFunctionDecorator = false
reportUnnecessaryIsInstance = false
[tool.pytest.ini_options]
asyncio_mode = "auto"
testpaths = ["tests"]
filterwarnings = ["ignore::DeprecationWarning"]