让运营能按订单号查到订单,作为后续资料收集(P2)与皮肤准入(P3/P4)的输入。 order_site 零改动:只读直连、独立极小连接池、可一键降级。 上机核实推翻了规划两处假设(详见 §6.5.1): - orders 表没有 order_no 列,只有 id 与 platform_order_id → 查询入口用后者; - platform_order_id 非唯一:541 组重复,形态固定为「91kaquan 内部行(已发货) + 真实店铺行(无人管)」。按规划原文的单行判据,这 540 个已发货订单会被误判 成「没人管」而放行重复履约。改为**订单号维度聚合**:任一行已发货即 auto_fulfilled。 真机验证(只读账号 livehub_ro):三桶判定全对,重复组正确拦下并回显真实 店铺行的中文名(狂沙舞者,而非内部码 suit_sand_dancer),单次查询 3.3ms。 顺带修一个只在真机才暴露的 bug:_get_engine 先置 _INITIALIZED 再读 URL, 一次落空就把模块永久毒化成不可用,之后补上连接串也救不回来。
56 lines
1.4 KiB
TOML
56 lines
1.4 KiB
TOML
[project]
|
|
name = "live-hub-py"
|
|
version = "0.3.0"
|
|
description = "直播账号运营 Web 后台"
|
|
readme = "README.md"
|
|
requires-python = ">=3.12,<3.13"
|
|
dependencies = [
|
|
"requests[socks]>=2.31.0",
|
|
"pycryptodome>=3.19.0",
|
|
"numpy>=1.24.0",
|
|
"opencv-python-headless>=4.8.0",
|
|
"Pillow>=10.0.0",
|
|
"loguru>=0.7.0",
|
|
"fastapi>=0.110.0",
|
|
"uvicorn[standard]>=0.27.0",
|
|
"sqlalchemy>=2.0.0",
|
|
"python-jose[cryptography]>=3.3.0",
|
|
"bcrypt>=4.0.0",
|
|
"pydantic>=2.0.0",
|
|
"python-multipart>=0.0.9",
|
|
"alembic>=1.18.4",
|
|
"websockets>=16.0",
|
|
"onnxruntime>=1.18.0",
|
|
"scipy>=1.13.0",
|
|
"pyexecjs>=1.5.1",
|
|
"pymysql>=1.1,<2",
|
|
# P0 订单读取适配层:连 order_site 的 PostgreSQL 只读库(规划 §6.5)。
|
|
# 全项目只有 external_order_source.py 一处跨库;URL 用 postgresql+psycopg://
|
|
"psycopg[binary]>=3.2,<4",
|
|
"curl-cffi>=0.13",
|
|
"segno>=1.6",
|
|
]
|
|
|
|
[build-system]
|
|
requires = ["hatchling"]
|
|
build-backend = "hatchling.build"
|
|
|
|
[tool.hatch.build.targets.wheel]
|
|
packages = ["core", "utils", "web"]
|
|
|
|
[tool.pytest.ini_options]
|
|
testpaths = ["tests"]
|
|
|
|
[tool.ruff.lint.per-file-ignores]
|
|
# FastAPI evaluates dependency metadata in route parameter defaults by design.
|
|
"web/backend/**/*.py" = ["B008"]
|
|
# 虎牙路由共享层集中 re-export 依赖。
|
|
"web/backend/routers/huya/_common.py" = ["F401"]
|
|
|
|
[dependency-groups]
|
|
dev = [
|
|
"pyright>=1.1.411",
|
|
"pytest>=9.1.1",
|
|
"ruff>=0.12.0",
|
|
]
|