Skip to content

Commit 16b9f7b

Browse files
committed
build(start-mcp-python-hello-world): 添加部署前安装依赖的脚本
- 在 s.yaml 文件中添加 pre-deploy 动作 - 创建 python 目录(如果不存在) - 安装 requirements.txt 中的依赖到 python 目录 Signed-off-by: zxypro1 <[email protected]>
1 parent c1f2595 commit 16b9f7b

File tree

4 files changed

+36
-0
lines changed

4 files changed

+36
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
start-mcp-python-hello-world:
2+
default:
3+
languages:
4+
- python3.10
5+
cache:
6+
paths:
7+
- "~/.cache"
8+
steps:
9+
- run: mkdir -p python
10+
path: ./code
11+
- run: pip install -r requirements.txt -t ./python
12+
path: ./code

start-mcp-python-hello-world-stdio/src/s.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ vars:
77
resources:
88
start-mcp-python-hello-world:
99
component: fc3
10+
actions:
11+
pre-deploy:
12+
- run: python3 -c "import os; os.makedirs('python', exist_ok=True)"
13+
path: ./code
14+
- run: pip install -r requirements.txt -t ./python
15+
path: ./code
1016
props:
1117
region: ${vars.region}
1218
description: Serverless Devs Python MCP Server
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
start-mcp-python-hello-world:
2+
default:
3+
languages:
4+
- python3.10
5+
cache:
6+
paths:
7+
- "~/.cache"
8+
steps:
9+
- run: mkdir -p python
10+
path: ./code
11+
- run: pip install -r requirements.txt -t ./python
12+
path: ./code

start-mcp-python-hello-world/src/s.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ vars:
77
resources:
88
start-mcp-python-hello-world:
99
component: fc3
10+
actions:
11+
pre-deploy:
12+
- run: python3 -c "import os; os.makedirs('python', exist_ok=True)"
13+
path: ./code
14+
- run: pip install -r requirements.txt -t ./python
15+
path: ./code
1016
props:
1117
region: ${vars.region}
1218
description: Serverless Devs Python MCP Server

0 commit comments

Comments
 (0)