chore: upgrade backend Python to 3.11 (#1142)

Co-authored-by: Wendong-Fan <w3ndong.fan@gmail.com>
Co-authored-by: Wendong-Fan <133094783+Wendong-Fan@users.noreply.github.com>
This commit is contained in:
Dream 2026-02-04 16:24:52 -05:00 committed by GitHub
parent 975648c1d2
commit ce782762e8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 390 additions and 409 deletions

View file

@ -21,7 +21,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
python-version: "3.11"
- name: Install uv
uses: astral-sh/setup-uv@v4

View file

@ -26,7 +26,7 @@ jobs:
enable-cache: true
- name: Set up Python
run: uv python install 3.10
run: uv python install 3.11
- name: Install dependencies
run: |

View file

@ -1 +1 @@
3.10.15
3.11.11

View file

@ -124,7 +124,7 @@ async def timeout_stream_wrapper(
)
last_data_time = time.time()
yield data
except asyncio.TimeoutError:
except TimeoutError:
chat_logger.warning(
"SSE timeout: No data received, closing connection",
extra={"timeout_seconds": timeout_seconds},

View file

@ -755,7 +755,7 @@ async def step_solve(options: Chat, request: Request, task_lock: TaskLock):
timeout=10,
)
task_lock.summary_generated = True
except asyncio.TimeoutError:
except TimeoutError:
logger.warning(
"summary_task timeout",
extra={
@ -1411,7 +1411,7 @@ async def step_solve(options: Chat, request: Request, task_lock: TaskLock):
"Generated LLM summary for multi-turn task",
extra={"project_id": options.project_id},
)
except asyncio.TimeoutError:
except TimeoutError:
logger.warning(
"Multi-turn summary_task timeout",
extra={

View file

@ -19,11 +19,11 @@ from contextlib import contextmanager
from contextvars import ContextVar
from datetime import datetime, timedelta
from enum import Enum
from typing import Literal
from typing import Any, Literal
from camel.tasks import Task
from pydantic import BaseModel
from typing_extensions import Any, TypedDict
from typing_extensions import TypedDict
from app.exception.exception import ProgramException
from app.model.chat import (

View file

@ -31,10 +31,8 @@ class McpSearchToolkit(BaseToolkit, AbstractToolkit):
self.api_task_id = api_task_id
@listen_toolkit(
inputs=lambda _,
keyword,
size,
page: f"keyword: {keyword}, size: {size}, page: {page}",
inputs=lambda _, keyword, size, page:
f"keyword: {keyword}, size: {size}, page: {page}",
return_msg=lambda res: f"Search {len(res)} results: ",
)
async def search_mcp_from_url(

View file

@ -836,7 +836,7 @@ class Workforce(BaseWorkforce):
self._channel.get_returned_task_by_publisher(self.node_id),
timeout=self.task_timeout_seconds,
)
except asyncio.TimeoutError:
except TimeoutError:
# Send timeout notification to frontend before re-raising
logger.warning(
f"⏰ [WF-TIMEOUT] Task timeout in workforce {self.node_id}. "

View file

@ -3,7 +3,7 @@ name = "backend"
version = "0.1.0"
description = "Add your description here"
readme = "README.md"
requires-python = ">=3.10,<3.11"
requires-python = ">=3.11,<3.12"
dependencies = [
"pip>=23.0",
"camel-ai[eigent]==0.2.85a0",
@ -36,7 +36,7 @@ dev = [
[tool.ruff]
line-length = 79
target-version = "py310"
target-version = "py311"
[tool.ruff.lint]
select = [
@ -54,7 +54,7 @@ ignore = [
"B904", # raise from - too many existing violations
"B023", # closure captures loop variable - existing pattern
"B017", # blind except in tests - acceptable
"B905", # zip strict - not needed for Python 3.10
"B905", # zip strict - existing code doesn't use strict parameter
]
[tool.ruff.lint.isort]

759
backend/uv.lock generated

File diff suppressed because it is too large Load diff

View file

@ -425,7 +425,7 @@ export async function startBackend(
// Step 1: Ensure Python is installed (fixes corrupted/missing Python)
log.info('Step 1: Ensuring Python is installed...');
await execAsync(`${uv_path} python install 3.10`, {
await execAsync(`${uv_path} python install 3.11`, {
cwd: backendPath,
env: env,
});

View file

@ -535,7 +535,7 @@ const runInstall = (extraArgs: string[], version: string) => {
/**
* Find Python executable in prebuilt Python directory
* UV stores Python installations in directories like: cpython-3.10.19+.../install/bin/python
* UV stores Python installations in directories like: cpython-3.11.x+.../install/bin/python
*/
function findPrebuiltPythonExecutable(): string | null {
const prebuiltPythonDir = getPrebuiltPythonDir();
@ -544,7 +544,7 @@ function findPrebuiltPythonExecutable(): string | null {
}
// Look for Python executable in the prebuilt directory
// UV stores Python in subdirectories like: cpython-3.10.19+.../install/bin/python
// UV stores Python in subdirectories like: cpython-3.11.x+.../install/bin/python
const possiblePaths: string[] = [];
// First, try common direct paths
@ -643,7 +643,7 @@ async function installTerminalBaseVenv(
const prebuiltPython = findPrebuiltPythonExecutable();
const venvArgs = prebuiltPython
? ['venv', '--python', prebuiltPython, terminalVenvPath]
: ['venv', '--python', '3.10', terminalVenvPath];
: ['venv', '--python', '3.11', terminalVenvPath];
await new Promise<void>((resolve, reject) => {
const createVenv = spawn(uv_path, venvArgs, {

View file

@ -193,7 +193,7 @@ function findPythonForTerminalVenv(): string | null {
}
// Look for Python executable in the prebuilt directory
// UV stores Python in subdirectories like: cpython-3.10.19+.../install/bin/python
// UV stores Python in subdirectories like: cpython-3.11.x+.../install/bin/python
const possiblePaths: string[] = [];
// First, try common direct paths