# ============================================================ # APS 智能体 · Python 后端工程定义(moduleId: root-pyproject, 可重生 ✅) # 全栈 Python 已决策(plan.md §11.1):Gateway + Agent Core 同栈 # ============================================================ [project] # 项目名:与仓库同名,便于识别 name = "aps-agent-server" # 版本:语义化版本,M1 里程碑为 0.1.x version = "0.1.0" # 描述:一句话说明后端职责 description = "APS 计划排产智能体后端:FastAPI Gateway + Agent Core + 规则排产引擎" # Python 版本要求:3.11+(本机 3.13 已验证) requires-python = ">=3.11" # 运行时依赖:全部为 M0+M1 必需,不引入未用包 dependencies = [ "fastapi>=0.115", # Web 框架:HTTP API + SSE 会话流 "uvicorn[standard]>=0.30", # ASGI 服务器:开发与生产运行入口 "httpx>=0.27", # 异步 HTTP 客户端:调用 DeepSeek/KIMI OpenAI 兼容接口 "pydantic>=2.7", # 数据契约:意图/UI块/命令的强校验(shared/ Schema 的运行时形态) "python-dotenv>=1.0", # .env 加载:LLM 密钥等环境配置(密钥不入库) "ortools>=9.10", # SC-03:OR-Tools CP-SAT "scipy>=1.14", # SC-06:Sobol 低差异采样与全局敏感性估计 "openpyxl>=3.1", # Excel 导入 / 报告 "python-multipart>=0.0.9", # UploadFile "pdfplumber>=0.11", # RAG:PDF "python-docx>=1.1", # RAG:docx "sqlalchemy>=2.0", # 租户化业务数据持久层(SQLite / MySQL) "alembic>=1.13", # 数据库版本迁移 "pymysql>=1.1", # jms_mes MySQL 驱动 "cryptography>=42", # 密码学原语:audit_ledger AESGCM 归档加解密(round-43 实际使用,.venv 已装 v49) ] [project.optional-dependencies] # 开发依赖:测试与质量工具 dev = [ "pytest>=8.0", # 黄金测试运行器(tests/golden) "pytest-asyncio>=0.23", # 异步用例支持(意图管线测试) ] desktop = [ "pyinstaller==6.21.0", ] # 可选本地向量嵌入(未装则 hybrid 检索降级 bigram) embedding = [ "sentence-transformers>=3.0", ] [tool.pytest.ini_options] # 测试根目录:仅收集 tests/ 下用例 testpaths = ["tests"] # 让 pytest 能以仓库根为工作目录导入 server 包 pythonpath = ["."] # 异步用例默认事件循环策略 asyncio_mode = "auto"