Browse Source

ci: install agentpaas package (fastapi/uvicorn) in test + imports jobs

第二次 CI run (27019315983) 在 imports job 的 "Verify package surface" 失败:
  lambdagent OK: 152 exports               ← 通
  from agentpaas.api.app import app        ← ModuleNotFoundError: 'fastapi'

原因:原 install step 是 fallback 逻辑——pip install -e lambdagent/ 成功后
就不会跑 fallback 的 fastapi 安装,结果 agentpaas 的依赖根本没装。

Fix: test job + imports job 都改为显式装两个包:
  pip install -e lambdagent/   # DSL 子包
  pip install -e .             # agentpaas + fastapi/uvicorn/pydantic 等
agentpaas/pyproject.toml 已经声明了所有运行时依赖。

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
kenny67nju 5 months ago
parent
commit
ba26d82544
1 changed files with 7 additions and 4 deletions
  1. 7 4
      .github/workflows/ci.yml

+ 7 - 4
.github/workflows/ci.yml

@@ -43,8 +43,9 @@ jobs:
           cache: pip
       - name: Install lambdagent (src-layout) + agentpaas
         run: |
-          pip install -e lambdagent/ 2>/dev/null || pip install pyyaml fastapi uvicorn pytest
-          pip install pytest pytest-asyncio pyyaml
+          pip install -e lambdagent/
+          pip install -e .   # agentpaas + 它的 fastapi/uvicorn/pydantic 等依赖
+          pip install pytest pytest-asyncio
       - name: Run tests
         run: python -m pytest tests/ -v --tb=short
       - name: Lint module loads
@@ -62,8 +63,10 @@ jobs:
         with:
           python-version: "3.12"
           cache: pip
-      - run: |
-          pip install -e lambdagent/ 2>/dev/null || pip install pyyaml fastapi uvicorn
+      - name: Install both packages
+        run: |
+          pip install -e lambdagent/
+          pip install -e .   # agentpaas needs fastapi/uvicorn/pydantic
       - name: Verify package surface
         run: |
           python -c "import lambdagent; print(f'lambdagent OK: {len(lambdagent.__all__)} exports')"