Skip to content

Commit 478b4d9

Browse files
authored
Upgrade deps and python313 (#65)
* Upgrade deps and python 3.13 * fix moatless source
1 parent 517af96 commit 478b4d9

File tree

4 files changed

+2129
-1320
lines changed

4 files changed

+2129
-1320
lines changed

moatless/index/simple_faiss.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
from fsspec.implementations.local import LocalFileSystem
1515
from llama_index.core.bridge.pydantic import PrivateAttr
1616
from llama_index.core.schema import BaseNode
17-
from llama_index.core.vector_stores.simple import _build_metadata_filter_fn
17+
from llama_index.core.vector_stores.simple import build_metadata_filter_fn
1818
from llama_index.core.vector_stores.types import (
1919
DEFAULT_PERSIST_DIR,
2020
BasePydanticVectorStore,
@@ -172,7 +172,7 @@ def query(
172172
similarity_top_k (int): top k most similar nodes
173173
174174
"""
175-
query_filter_fn = _build_metadata_filter_fn(lambda node_id: self._data.metadata_dict[node_id], query.filters)
175+
query_filter_fn = build_metadata_filter_fn(lambda node_id: self._data.metadata_dict[node_id], query.filters)
176176

177177
query_embedding = cast(list[float], query.query_embedding)
178178
query_embedding_np = np.array(query_embedding, dtype="float32")[np.newaxis, :]

moatless/runner/docker_runner.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,9 @@ async def start_job(
271271
elif effective_memory_limit:
272272
# If memory limit is set but swap limit is not, default to twice the memory limit
273273
cmd.extend(["--memory-swap", effective_memory_limit])
274+
275+
# Add ulimit for file descriptors to prevent "Too many open files" errors
276+
cmd.extend(["--ulimit", "nofile=65536:65536"])
274277

275278
# Add Docker labels for easier container identification and querying
276279
job_labels = create_labels(project_id, trajectory_id)
@@ -292,6 +295,9 @@ async def start_job(
292295
if self.moatless_source_dir:
293296
logger.info(f"Mounting {self.moatless_source_dir}:/opt/moatless/moatless")
294297
cmd.extend(["-v", f"{self.moatless_source_dir}:/opt/moatless/moatless"])
298+
# Also mount the lockfile to ensure dependency compatibility
299+
cmd.extend(["-v", f"{self.moatless_source_dir}/uv.lock:/opt/moatless/uv.lock"])
300+
cmd.extend(["-v", f"{self.moatless_source_dir}/pyproject.toml:/opt/moatless/pyproject.toml"])
295301
cmd.extend(["-e", "PYTHONPATH=/opt/moatless/moatless:$PYTHONPATH"])
296302

297303
args = create_job_args(project_id, trajectory_id, job_func, node_id)
@@ -311,6 +317,10 @@ async def start_job(
311317
self.logger.info(f"Will run update-moatless.sh with branch {branch_to_use}")
312318
run_command += f"/opt/moatless/docker/update-moatless.sh --branch {branch_to_use} && "
313319

320+
# If using local source, sync dependencies first (not frozen) to use local lockfile
321+
if self.moatless_source_dir:
322+
run_command += "cd /opt/moatless && uv sync --compile-bytecode --all-extras && "
323+
314324
# Add the main job command
315325
run_command += f"date '+%Y-%m-%d %H:%M:%S' && echo 'Starting job at ' $(date '+%Y-%m-%d %H:%M:%S') && uv run - <<EOF\n{args}\nEOF"
316326

pyproject.toml

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -11,50 +11,50 @@ readme = "README.md"
1111
authors = [
1212
{name = "Albert Örwall", email = "[email protected]"},
1313
]
14-
requires-python = "<3.13,>=3.10"
14+
requires-python = "<3.14,>=3.10"
1515
dependencies = [
16-
"pydantic<3.0.0,>=2.8.2",
17-
"tiktoken<1.0.0,>=0.8.0",
18-
"networkx<4.0,>=3.3",
16+
"pydantic<3.0.0,>=2.11.7",
17+
"tiktoken<2.0.0,>=0.11.0",
18+
"networkx<4.0,>=3.4",
1919
"tree-sitter==0.24.0",
2020
"tree-sitter-python==0.23.6",
2121
"tree-sitter-java==0.23.5",
22-
"rapidfuzz<4.0.0,>=3.9.5",
23-
"gitpython<4.0.0,>=3.1.43",
22+
"rapidfuzz<4.0.0,>=3.13.0",
23+
"gitpython<4.0.0,>=3.1.45",
2424
"unidiff<1.0.0,>=0.7.5",
2525
"python-dotenv==1.0.1",
26-
"docstring-parser<1.0,>=0.16",
27-
"litellm<2.0.0,>=1.67.0",
28-
"openai<2.0.0,>=1.41.0",
29-
"anthropic<1.0.0,>=0.49.0",
30-
"llama-index<1.0.0,>=0.12.11",
31-
"llama-index-embeddings-openai<1.0.0,>=0.3.1",
32-
"llama-index-embeddings-voyageai<1.0.0,>=0.3.4",
33-
"llama-index-readers-file<1.0.0,>=0.4.3",
34-
"faiss-cpu<2.0.0.0,>=1.8.0.post1",
35-
"voyageai<1.0.0,>=0.3.2",
36-
"filelock<4.0.0,>=3.16.1",
26+
"docstring-parser<1.0,>=0.17.0",
27+
"litellm<2.0.0,>=1.75.5",
28+
"openai<2.0.0,>=1.99.9",
29+
"anthropic<1.0.0,>=0.62.0",
30+
"llama-index<2.0.0,>=0.13.1",
31+
"llama-index-embeddings-openai<1.0.0,>=0.5.0",
32+
"llama-index-embeddings-voyageai<1.0.0,>=0.4.1",
33+
"llama-index-readers-file<1.0.0,>=0.5.0",
34+
"faiss-cpu<2.0.0.0,>=1.11.0.post1",
35+
"voyageai<1.0.0,>=0.3.4",
36+
"filelock<4.0.0,>=3.18.0",
3737
"aiofiles<25.0.0,>=24.1.0",
38-
"swebench<4.0.0,>=3.0.15",
39-
"opentelemetry-sdk<2.0.0,>=1.30.0",
40-
"sqlalchemy>=2.0.41",
38+
"swebench<4.0.0,>=3.0.17",
39+
"opentelemetry-sdk<2.0.0,>=1.36.0",
40+
"sqlalchemy>=2.0.43",
4141
"psycopg2-binary>=2.9.10",
42-
"redis<6.0.0,>=5.2.1",
42+
"redis<6.0.0,>=5.3.1",
4343
"gunicorn>=23.0.0",
44-
"opentelemetry-api<2.0.0,>=1.30.0",
45-
"opentelemetry-exporter-otlp<2.0.0,>=1.30.0",
46-
"opentelemetry-instrumentation<1.0,>=0.51b0",
47-
"opentelemetry-instrumentation-fastapi<1.0,>=0.51b0",
48-
"fastapi>=0.115.12",
49-
"uvicorn>=0.34.2",
44+
"opentelemetry-api<2.0.0,>=1.36.0",
45+
"opentelemetry-exporter-otlp<2.0.0,>=1.36.0",
46+
"opentelemetry-instrumentation<1.0,>=0.57b0",
47+
"opentelemetry-instrumentation-fastapi<1.0,>=0.57b0",
48+
"fastapi>=0.116.1",
49+
"uvicorn>=0.35.0",
5050
"dotenv>=0.9.9",
51-
"botocore<2.0.0,>=1.35.54",
52-
"boto3<2.0.0,>=1.35.54",
53-
"aioboto3<15.0.0,>=14.1.0",
54-
"kubernetes<33.0.0,>=32.0.0",
55-
"kubernetes-asyncio<33.0.0,>=32.0.0",
56-
"azure-storage-blob<13.0.0,>=12.25.0",
57-
"azure-monitor-opentelemetry<2.0.0,>=1.6.5",
51+
"botocore<2.0.0,>=1.37.3",
52+
"boto3<2.0.0,>=1.37.3",
53+
"aioboto3<15.0.0,>=14.3.0",
54+
"kubernetes<33.0.0,>=32.0.1",
55+
"kubernetes-asyncio<33.0.0,>=32.3.2",
56+
"azure-storage-blob<13.0.0,>=12.26.0",
57+
"azure-monitor-opentelemetry<2.0.0,>=1.6.13",
5858
]
5959

6060
[dependency-groups]

0 commit comments

Comments
 (0)