Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions java_codebase_rag/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from __future__ import annotations

import os
import shutil
import subprocess
import sys
import threading
Expand All @@ -19,7 +20,13 @@ def bundle_dir() -> Path:


def cocoindex_bin() -> Path:
return Path(sys.executable).parent / "cocoindex"
candidate = Path(sys.executable).parent / "cocoindex"
if candidate.is_file():
return candidate
found = shutil.which("cocoindex")
if found:
return Path(found)
return candidate


class _LineFilter:
Expand Down Expand Up @@ -110,7 +117,7 @@ def run_cocoindex_update(
args=[str(exe)],
returncode=127,
stdout="",
stderr=f"cocoindex not found next to Python: {exe}",
stderr=f"cocoindex not found: {exe}",
)
bd = bundle_dir()
flow = bd / "java_index_flow_lancedb.py"
Expand Down Expand Up @@ -172,7 +179,7 @@ def run_cocoindex_drop(env: dict[str, str], *, quiet: bool) -> subprocess.Comple
args=[str(exe)],
returncode=127,
stdout="",
stderr=f"cocoindex not found next to Python: {exe}",
stderr=f"cocoindex not found: {exe}",
)
bd = bundle_dir()
cmd = [str(exe), "drop", COCOINDEX_TARGET, "-f"]
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "java-codebase-rag"
version = "0.3.0"
version = "0.3.1"
description = "MCP server for semantic + structural search over Java codebases"
readme = "README.md"
requires-python = ">=3.11"
Expand Down
2 changes: 1 addition & 1 deletion tests/test_java_codebase_rag_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -784,7 +784,7 @@ def fake_coco(*_a: object, **_k: object) -> subprocess.CompletedProcess[str]:
args=["/nonexistent/cocoindex"],
returncode=127,
stdout="",
stderr="cocoindex not found next to Python",
stderr="cocoindex not found",
)

monkeypatch.setattr(cli_mod, "run_cocoindex_update", fake_coco)
Expand Down
Loading