Files
meijiaka-zy/python-api/pyproject.toml
T
小鱼开发 c6eba97b43 feat(points): 积分消耗系统全链路集成
后端:
- 简化积分服务: 删除 freeze/settle/refund, 保留 consume/recharge/expire
- 计费配置化: config/points-config.yaml 驱动 fixed/duration/free 三种模式
- TTS 时长探测: app/utils/audio_utils.py (httpx + mutagen 纯 Python)
- Python 层扣费: script(5)/polish(1)/title(1)/voice_clone(200)/tts(按秒)/video(按秒)
- 字幕 free_services: caption/auto_align 不扣费
- 新增 POST /points/consume 端点(402余额预检)
- 新增 check_balance + /points/cost 返回 sufficient/balance/required
- 新增 expire_batches 定时回收, 接入 scheduler main(每5分钟)
- 删除废弃 tts_handler.py
- Alembic 迁移: 删除 frozen/total_refunded 字段
- 同步 requirements.lock 添加 mutagen

前端:
- Rust/IPC 层扣费: compose(5)/subtitle_burn(2)/cover_design(2)
- 字幕打轴改异步: 走 scheduler subtitle handler
- 对口型传 duration: VideoGeneration 传 actualDuration
- 创建 pointStore: 全局余额 + fetchBalance + 充值弹窗控制
- 402 欠费弹 RechargeModal: VideoGeneration/SubtitleBurning/CoverDesign
- 修复 VoiceDubbing.tsx 类型错误 (alignResult never)
- 同步 PointBalance 类型(删除 frozen/available/totalRefunded)

Refs: 积分消耗集成收尾
2026-05-09 15:42:54 +08:00

135 lines
3.2 KiB
TOML

[project]
name = "meijiaka-ai-api"
version = "0.1.0"
description = "美家卡智影 - AI 视频创作后端 API"
authors = [{ name = "Meijiaka Team" }]
readme = "README.md"
requires-python = ">=3.13"
license = { text = "MIT" }
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.13",
]
dependencies = [
# Web 框架 (FastAPI 0.116+ 修复 Starlette 安全漏洞)
"fastapi>=0.136.1",
"uvicorn[standard]~=0.32.0",
"python-multipart~=0.0.20",
# 认证 & 安全
"passlib[bcrypt]~=1.7.4",
"bcrypt~=4.2.0",
# 数据库
"sqlalchemy[asyncio]~=2.0.36",
"asyncpg~=0.30.0",
"psycopg2-binary~=2.9.10",
"alembic~=1.14.0",
# 缓存 & 任务队列
"redis~=5.2.0",
# 配置 & 验证
"pydantic~=2.9.0",
"pydantic-settings~=2.6.0",
# AI / LLM
"openai~=1.58.0",
# 重试 & 容错
"tenacity~=9.0.0",
# 火山方舟官方 SDK(可选,如不需要可注释掉)
"volcengine-python-sdk[ark]~=5.0.0",
# HTTP 客户端
"httpx~=0.28.0",
"aiohttp>=3.13.4", # 安全修复:修复 CVE-2025-XXXX 系列漏洞
# 对象存储
"qiniu~=7.13.0",
# 工具
"python-jose[cryptography]~=3.4.0",
"pyyaml~=6.0.2",
"orjson>=3.11.0", # 安全修复:修复 CVE-2025-XXXX
# 音频时长探测(TTS 扣费用)
"mutagen~=1.47.0",
]
[project.optional-dependencies]
dev = [
"pytest~=8.3.0",
"pytest-asyncio~=0.24.0",
"pytest-cov~=6.0.0",
"ruff~=0.8.0",
"black~=24.10.0",
"mypy~=1.14.0",
"bandit[toml]~=1.8.0", # 安全扫描
"pip-audit~=2.7.0", # 漏洞检测
"pre-commit~=4.0.0", # Git 钩子
]
[project.scripts]
meijiaka-api = "app.main:main"
[tool.setuptools]
packages = ["app"]
[tool.black]
line-length = 100
target-version = ["py313"]
[tool.ruff]
line-length = 100
target-version = "py313"
[tool.ruff.lint]
select = ["E", "F", "I", "N", "W", "UP", "B", "C4", "SIM"]
ignore = ["E501", "E402", "N802", "N803", "N806", "N815", "B008", "B904"]
[tool.mypy]
python_version = "3.13"
strict = false
warn_return_any = false
warn_unused_configs = true
ignore_missing_imports = true
# 逐步修复历史遗留问题
warn_no_return = false
check_untyped_defs = false
disallow_untyped_defs = false
disallow_incomplete_defs = false
# ========== 重构防护网:新代码严格模式 ==========
[[tool.mypy.overrides]]
module = ["app.schemas.*", "app.crud.*", "app.scheduler.handlers.*"]
strict = true
warn_return_any = true
check_untyped_defs = true
disallow_untyped_defs = true
disallow_incomplete_defs = true
# Redis 客户端 typing 问题(Awaitable[T] | T),暂不严格检查
[[tool.mypy.overrides]]
module = ["app.scheduler.registry", "app.scheduler.slot_manager"]
strict = false
check_untyped_defs = false
disallow_untyped_defs = false
[tool.pytest.ini_options]
asyncio_mode = "auto"
[tool.bandit]
exclude_dirs = ["tests", "scripts"]
skips = ["B101", "B104", "B105", "B106", "B107", "B301", "B403", "B404", "B603", "B607"]
testpaths = ["tests"]
python_files = ["test_*.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]