From e43ff8382f9ab40a2928abac82a34de54e1bccc2 Mon Sep 17 00:00:00 2001 From: Kian Jones <11655409+kianjones9@users.noreply.github.com> Date: Tue, 26 Aug 2025 20:32:27 -0700 Subject: [PATCH] feat: finish uv migration (oss + desktop) (#4228) * migrate desktop and add sqlite as a hard dependency in desktop * migrate oss dockerfile as well --- Dockerfile | 9 ++++----- pyproject.toml | 1 + uv.lock | 2 ++ 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4e11f42e..2a25e0fd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,7 +5,6 @@ FROM ankane/pgvector:v0.5.1 AS builder RUN apt-get update && apt-get install -y \ python3 \ python3-venv \ - python3-pip \ python3-full \ build-essential \ libpq-dev \ @@ -15,7 +14,7 @@ RUN apt-get update && apt-get install -y \ ARG LETTA_ENVIRONMENT=DEV ENV LETTA_ENVIRONMENT=${LETTA_ENVIRONMENT} \ UV_NO_PROGRESS=1 \ - UV_PYTHON_PREFERENCE=only-managed \ + UV_PYTHON_PREFERENCE=system \ UV_CACHE_DIR=/tmp/uv_cache # Set for other builds @@ -28,8 +27,8 @@ WORKDIR /app RUN python3 -m venv /opt/venv ENV PATH="/opt/venv/bin:$PATH" -# Now install uv in the virtual environment -COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv +# Now install uv and uvx in the virtual environment +COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /usr/local/bin/ # Copy dependency files first @@ -37,7 +36,7 @@ COPY apps/core/pyproject.toml apps/core/uv.lock ./ # Then copy the rest of the application code COPY . . -RUN uv sync --frozen --no-dev --no-install-project --all-extras +RUN uv sync --frozen --no-dev --no-install-project --all-extras --python 3.11 # Runtime stage FROM ankane/pgvector:v0.5.1 AS runtime diff --git a/pyproject.toml b/pyproject.toml index 4ace304c..3162843a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -137,6 +137,7 @@ desktop = [ "wikipedia>=1.4.0", "langchain-community>=0.3.7", "locust>=2.31.5", + "aiosqlite>=0.21.0", "sqlite-vec>=0.1.7a2", "pgvector>=0.2.3", ] diff --git a/uv.lock b/uv.lock index c7afb890..3afd97ff 100644 --- a/uv.lock +++ b/uv.lock @@ -2403,6 +2403,7 @@ cloud-tool-sandbox = [ { name = "e2b-code-interpreter" }, ] desktop = [ + { name = "aiosqlite" }, { name = "docker" }, { name = "fastapi" }, { name = "langchain" }, @@ -2475,6 +2476,7 @@ sqlite = [ requires-dist = [ { name = "aioboto3", marker = "extra == 'bedrock'", specifier = ">=14.3.0" }, { name = "aiomultiprocess", specifier = ">=0.9.1" }, + { name = "aiosqlite", marker = "extra == 'desktop'", specifier = ">=0.21.0" }, { name = "aiosqlite", marker = "extra == 'sqlite'", specifier = ">=0.21.0" }, { name = "alembic", specifier = ">=1.13.3" }, { name = "anthropic", specifier = ">=0.49.0" },