From 8a47b5945045db39da097c525950983727246c5a Mon Sep 17 00:00:00 2001 From: zjwu0522 Date: Wed, 10 Sep 2025 16:03:14 +0000 Subject: [PATCH 1/2] chore: use pyproject for deps in docker, remove requirement.txt --- Dockerfile | 30 +++++++----------------------- README.md | 2 +- pyproject.toml | 5 ++--- requirements.txt | 12 ------------ 4 files changed, 10 insertions(+), 39 deletions(-) delete mode 100644 requirements.txt diff --git a/Dockerfile b/Dockerfile index 0573ca2c..3b27c32f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,20 +1,4 @@ # MCPMark Docker image with optimized layer caching -# Stage 1: Builder for Python dependencies only -FROM python:3.12-slim AS builder - -RUN apt-get update && apt-get install -y --no-install-recommends \ - gcc \ - g++ \ - libpq-dev \ - && rm -rf /var/lib/apt/lists/* - -WORKDIR /build - -# Copy and install Python dependencies -COPY requirements.txt ./ -RUN pip install --no-cache-dir --user -r requirements.txt - -# Stage 2: Final image with all runtime dependencies FROM python:3.12-slim # Layer 1: Core system dependencies (very stable, rarely changes) @@ -67,13 +51,6 @@ RUN apt-get update && \ RUN pip install --no-cache-dir pipx && \ pipx ensurepath -# Layer 7: Copy Python packages from builder (changes with dependencies) -COPY --from=builder /root/.local /root/.local - -# Layer 8: Playwright browsers (changes with browser versions) -RUN python3 -m playwright install chromium && \ - npx -y playwright install chromium - # Layer 9: Install PostgreSQL MCP server (Python, used via `pipx run postgres-mcp`) RUN pipx install postgres-mcp @@ -86,6 +63,13 @@ RUN mkdir -p /app/results # Layer 10: Application code (changes frequently) COPY . . +# Install Python package and dependencies from pyproject (editable mode) +RUN pip install --no-cache-dir -e . + +# Install Playwright browsers after Playwright is available +RUN python3 -m playwright install chromium && \ + npx -y playwright install chromium + # Set environment ENV PATH="/root/.local/bin:/root/.local/pipx/venvs/*/bin:${PATH}" ENV PYTHONPATH="/app" diff --git a/README.md b/README.md index 2c04a939..731244c9 100644 --- a/README.md +++ b/README.md @@ -65,7 +65,7 @@ See `docs/introduction.md` and the service guides below for more details. Local (Recommended) ```bash -pip install -e . +pip install --no-cache-dir -e . # If you'll use browser-based tasks, install Playwright browsers first playwright install ``` diff --git a/pyproject.toml b/pyproject.toml index 75665cd2..76202002 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,8 +9,7 @@ dependencies = [ "seaborn>=0.12.0", "matplotlib>=3.7.0", "numpy>=1.23.0", - "openai-agents>=0.2.3,<0.3", - "openai==1.96.1", + "openai>1.96.1", "python-dotenv>=1.1.1,<2", "ruff>=0.12.4,<0.13", "psycopg2-binary>=2.9.10,<3", @@ -19,7 +18,7 @@ dependencies = [ "pixi", "pipx>=1.7.1,<2", "pgdumplib>=3.1.0,<4", - "litellm==1.76.0" + "litellm>=1.76.0" ] [build-system] diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 64a6aa0f..00000000 --- a/requirements.txt +++ /dev/null @@ -1,12 +0,0 @@ -openai-agents -openai -python-dotenv -notion-client>=2.4.0 -playwright>=1.43.0 -seaborn>=0.12.0 -matplotlib>=3.7.0 -numpy>=1.23.0 -psycopg2 -pyyaml -nest_asyncio -litellm==1.76.0 \ No newline at end of file From f2484e0595eca1ab4f6da689b706df1cea782446 Mon Sep 17 00:00:00 2001 From: zjwu0522 Date: Wed, 10 Sep 2025 16:03:45 +0000 Subject: [PATCH 2/2] chore: remove timeout error resume --- src/errors.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/errors.py b/src/errors.py index 8117c61a..51ef48b0 100644 --- a/src/errors.py +++ b/src/errors.py @@ -16,7 +16,6 @@ "ratelimit", # e.g., RateLimitError, too many requests "connection", # connection refused/reset/error "unavailable", # service unavailable - "execution timed out", # timeout "internal server error", # 500s "network error", # generic network issue "quota", # budget/quota exceeded