From 3ad4a852bd04266335d25641265aa082dc82d1b1 Mon Sep 17 00:00:00 2001 From: Danilo Bardusco Date: Fri, 21 Mar 2025 17:22:52 -0300 Subject: [PATCH] fix: Update Python dependency installation with uv and system package setup --- src/code-sandbox-mcp/tools/run_project.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/code-sandbox-mcp/tools/run_project.go b/src/code-sandbox-mcp/tools/run_project.go index ee28837..06be8a5 100644 --- a/src/code-sandbox-mcp/tools/run_project.go +++ b/src/code-sandbox-mcp/tools/run_project.go @@ -101,11 +101,11 @@ func runProjectInDocker(ctx context.Context, progressToken mcp.ProgressToken, cm case deps.Python: if depFile == "requirements.txt" { containerConfig.Cmd = []string{ - fmt.Sprintf("pip install -r %s && %s", depFile, strings.Join(cmd, " ")), + "/bin/sh", "-c", fmt.Sprintf(" export DEBIAN_FRONTEND=noninteractive && set -e && apt-get update && apt-get install -y apt-utils && apt-get install -y build-essential && uv venv && . .venv/bin/activate && uv pip install -r %s && %s", depFile, strings.Join(cmd, " ")), } } else if depFile == "pyproject.toml" || depFile == "setup.py" { containerConfig.Cmd = []string{ - fmt.Sprintf("pip install . && %s", strings.Join(cmd, " ")), + "/bin/sh", "-c", fmt.Sprintf("export DEBIAN_FRONTEND=noninteractive && set -e && apt-get update && apt-get install -y apt-utils &&apt-get install -y build-essential && uv venv && . .venv/bin/activate && uv pip install . && %s", strings.Join(cmd, " ")), } } case deps.Go: