From 43a8e5d946daa162b3c122b3779e1d1dc9dc001a Mon Sep 17 00:00:00 2001 From: Theodore Aptekarev Date: Thu, 12 Mar 2026 14:38:50 +0300 Subject: [PATCH 1/4] Update Dockerfile to use Python 3.13 --- Dockerfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 3768d80..f0c3977 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ # Multi-stage Dockerfile for allocator-bot # Build stage -FROM ghcr.io/astral-sh/uv:python3.12-bookworm-slim AS builder +FROM ghcr.io/astral-sh/uv:python3.13-bookworm-slim AS builder ENV UV_COMPILE_BYTECODE=1 UV_LINK_MODE=copy ENV UV_PYTHON_DOWNLOADS=0 @@ -11,7 +11,8 @@ COPY . /app RUN uv sync --locked --no-dev # Runtime stage -FROM python:3.12-slim-bookworm +FROM python:3.13-slim-bookworm + WORKDIR /app # Create non-root user From efced3ab60b23420fcc7d00e69afcda90e735094 Mon Sep 17 00:00:00 2001 From: Theodore Aptekarev Date: Thu, 12 Mar 2026 14:55:04 +0300 Subject: [PATCH 2/4] Fix production deployment: update to Python 3.13 and add missing packaging dependency --- pyproject.toml | 1 + uv.lock | 2 ++ 2 files changed, 3 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 6c702d8..6b357b7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -26,6 +26,7 @@ dependencies = [ "openbb-core>=1.4.8", "openbb-fmp>=1.3.5", "openbb-platform-api>=1.1.13", + "packaging>=26.0", "pandas>=2.2.3", "pyportfolioopt>=1.5.6", "sse-starlette>=2.1.3", diff --git a/uv.lock b/uv.lock index 22d6e73..e6f0a2f 100644 --- a/uv.lock +++ b/uv.lock @@ -128,6 +128,7 @@ dependencies = [ { name = "openbb-core" }, { name = "openbb-fmp" }, { name = "openbb-platform-api" }, + { name = "packaging" }, { name = "pandas", version = "2.3.3", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.11'" }, { name = "pandas", version = "3.0.1", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.11'" }, { name = "pyportfolioopt" }, @@ -161,6 +162,7 @@ requires-dist = [ { name = "openbb-core", specifier = ">=1.4.8" }, { name = "openbb-fmp", specifier = ">=1.3.5" }, { name = "openbb-platform-api", specifier = ">=1.1.13" }, + { name = "packaging", specifier = ">=26.0" }, { name = "pandas", specifier = ">=2.2.3" }, { name = "pandas-stubs", marker = "extra == 'dev'", specifier = ">=2.2.3.250527" }, { name = "pyportfolioopt", specifier = ">=1.5.6" }, From 7486ec5236266e18b3e628bbd92055057d4c945d Mon Sep 17 00:00:00 2001 From: Theodore Aptekarev Date: Thu, 12 Mar 2026 19:26:25 +0300 Subject: [PATCH 3/4] Fix StopAsyncIteration runtime error in Python 3.13 --- allocator_bot/api.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/allocator_bot/api.py b/allocator_bot/api.py index 01e415a..d397ab3 100644 --- a/allocator_bot/api.py +++ b/allocator_bot/api.py @@ -416,6 +416,9 @@ async def query( request: QueryRequest, token: str = Depends(get_current_user) ) -> EventSourceResponse: """Query the Allocator Bot.""" - return EventSourceResponse( - (event.model_dump() async for event in execution_loop(request)) - ) + + async def event_generator(): + async for event in execution_loop(request): + yield event.model_dump() + + return EventSourceResponse(event_generator()) From 9141e811f45dca253507839db7a58fbd2f6a2558 Mon Sep 17 00:00:00 2001 From: Theodore Aptekarev Date: Thu, 12 Mar 2026 20:43:55 +0300 Subject: [PATCH 4/4] Bump version --- pyproject.toml | 2 +- uv.lock | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 6b357b7..7279fb4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "allocator-bot" -version = "0.3.0" +version = "0.3.1" description = "An asset allocation bot for OpenBB that uses PyPortfolioOpt to generate efficient frontier allocations." readme = "README.md" requires-python = ">=3.10,<3.14" diff --git a/uv.lock b/uv.lock index e6f0a2f..db67117 100644 --- a/uv.lock +++ b/uv.lock @@ -118,7 +118,7 @@ wheels = [ [[package]] name = "allocator-bot" -version = "0.3.0" +version = "0.3.1" source = { editable = "." } dependencies = [ { name = "aiohttp" },