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
11 changes: 9 additions & 2 deletions src/cocoindex_code/indexer.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

from __future__ import annotations

from pathlib import Path, PurePath
from collections.abc import Iterable
from pathlib import Path, PurePath

import cocoindex as coco
from cocoindex.connectors import localfs, sqlite
Expand All @@ -15,7 +15,14 @@
from pathspec import GitIgnoreSpec

from .settings import PROJECT_SETTINGS
from .shared import CODEBASE_DIR, EMBEDDER, EXT_LANG_OVERRIDE_MAP, GITIGNORE_SPEC, SQLITE_DB, CodeChunk
from .shared import (
CODEBASE_DIR,
EMBEDDER,
EXT_LANG_OVERRIDE_MAP,
GITIGNORE_SPEC,
SQLITE_DB,
CodeChunk,
)

# Chunking configuration
CHUNK_SIZE = 800
Expand Down
9 changes: 8 additions & 1 deletion src/cocoindex_code/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,14 @@
from .indexer import indexer_main
from .protocol import IndexingProgress
from .settings import PROJECT_SETTINGS, ProjectSettings, load_gitignore_spec
from .shared import CODEBASE_DIR, EMBEDDER, EXT_LANG_OVERRIDE_MAP, GITIGNORE_SPEC, SQLITE_DB, Embedder
from .shared import (
CODEBASE_DIR,
EMBEDDER,
EXT_LANG_OVERRIDE_MAP,
GITIGNORE_SPEC,
SQLITE_DB,
Embedder,
)


class Project:
Expand Down
2 changes: 1 addition & 1 deletion src/cocoindex_code/shared.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

import cocoindex as coco
from cocoindex.connectors import sqlite
from pathspec import GitIgnoreSpec
from numpy.typing import NDArray
from pathspec import GitIgnoreSpec

if TYPE_CHECKING:
from cocoindex.ops.litellm import LiteLLMEmbedder
Expand Down
5 changes: 2 additions & 3 deletions tests/test_e2e.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
from pathlib import Path

import pytest
from cocoindex.connectors import sqlite as coco_sqlite
from typer.testing import CliRunner

from cocoindex.connectors import sqlite as coco_sqlite
from cocoindex_code.cli import app
from cocoindex_code.client import stop_daemon
from cocoindex_code.settings import find_parent_with_marker
Expand Down Expand Up @@ -319,8 +319,7 @@ def test_session_respects_gitignore(e2e_project: Path) -> None:
try:
with conn.readonly() as db:
file_paths = {
row[0]
for row in db.execute("SELECT DISTINCT file_path FROM code_chunks_vec")
row[0] for row in db.execute("SELECT DISTINCT file_path FROM code_chunks_vec")
}
finally:
conn.close()
Expand Down
Loading