ragrep 0.2.2__tar.gz → 0.2.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {ragrep-0.2.2/src/ragrep.egg-info → ragrep-0.2.3}/PKG-INFO +1 -1
- {ragrep-0.2.2 → ragrep-0.2.3}/pyproject.toml +1 -1
- {ragrep-0.2.2 → ragrep-0.2.3}/src/ragrep/__init__.py +1 -1
- {ragrep-0.2.2 → ragrep-0.2.3}/src/ragrep/core/document_processor.py +7 -12
- {ragrep-0.2.2 → ragrep-0.2.3/src/ragrep.egg-info}/PKG-INFO +1 -1
- {ragrep-0.2.2 → ragrep-0.2.3}/tests/test_ragrep.py +24 -0
- {ragrep-0.2.2 → ragrep-0.2.3}/LICENSE +0 -0
- {ragrep-0.2.2 → ragrep-0.2.3}/MANIFEST.in +0 -0
- {ragrep-0.2.2 → ragrep-0.2.3}/README.md +0 -0
- {ragrep-0.2.2 → ragrep-0.2.3}/docs/README.md +0 -0
- {ragrep-0.2.2 → ragrep-0.2.3}/env.example +0 -0
- {ragrep-0.2.2 → ragrep-0.2.3}/examples/basic_usage.py +0 -0
- {ragrep-0.2.2 → ragrep-0.2.3}/requirements.txt +0 -0
- {ragrep-0.2.2 → ragrep-0.2.3}/setup.cfg +0 -0
- {ragrep-0.2.2 → ragrep-0.2.3}/setup.py +0 -0
- {ragrep-0.2.2 → ragrep-0.2.3}/src/ragrep/cli.py +0 -0
- {ragrep-0.2.2 → ragrep-0.2.3}/src/ragrep/core/__init__.py +0 -0
- {ragrep-0.2.2 → ragrep-0.2.3}/src/ragrep/core/rag_system.py +0 -0
- {ragrep-0.2.2 → ragrep-0.2.3}/src/ragrep/retrieval/__init__.py +0 -0
- {ragrep-0.2.2 → ragrep-0.2.3}/src/ragrep/retrieval/embeddings.py +0 -0
- {ragrep-0.2.2 → ragrep-0.2.3}/src/ragrep/retrieval/vector_store.py +0 -0
- {ragrep-0.2.2 → ragrep-0.2.3}/src/ragrep.egg-info/SOURCES.txt +0 -0
- {ragrep-0.2.2 → ragrep-0.2.3}/src/ragrep.egg-info/dependency_links.txt +0 -0
- {ragrep-0.2.2 → ragrep-0.2.3}/src/ragrep.egg-info/entry_points.txt +0 -0
- {ragrep-0.2.2 → ragrep-0.2.3}/src/ragrep.egg-info/requires.txt +0 -0
- {ragrep-0.2.2 → ragrep-0.2.3}/src/ragrep.egg-info/top_level.txt +0 -0
- {ragrep-0.2.2 → ragrep-0.2.3}/tests/test_cli.py +0 -0
- {ragrep-0.2.2 → ragrep-0.2.3}/tests/test_embeddings.py +0 -0
|
@@ -202,18 +202,13 @@ class DocumentProcessor:
|
|
|
202
202
|
def _load_ignore_patterns(root: Path) -> List[str]:
|
|
203
203
|
patterns = set(_DEFAULT_IGNORE_PATTERNS)
|
|
204
204
|
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
continue
|
|
213
|
-
patterns.add(stripped)
|
|
214
|
-
if current.parent == current:
|
|
215
|
-
break
|
|
216
|
-
current = current.parent
|
|
205
|
+
gitignore = root / ".gitignore"
|
|
206
|
+
if gitignore.exists():
|
|
207
|
+
for line in gitignore.read_text(encoding="utf-8", errors="ignore").splitlines():
|
|
208
|
+
stripped = line.strip()
|
|
209
|
+
if not stripped or stripped.startswith("#"):
|
|
210
|
+
continue
|
|
211
|
+
patterns.add(stripped)
|
|
217
212
|
|
|
218
213
|
return sorted(patterns)
|
|
219
214
|
|
|
@@ -205,6 +205,30 @@ class RAGrepTests(unittest.TestCase):
|
|
|
205
205
|
finally:
|
|
206
206
|
rag.close()
|
|
207
207
|
|
|
208
|
+
def test_index_subdirectory_does_not_inherit_parent_gitignore(self):
|
|
209
|
+
(self.root / ".gitignore").write_text("*\n", encoding="utf-8")
|
|
210
|
+
docs_root = self.root / "docs"
|
|
211
|
+
docs_root.mkdir(parents=True, exist_ok=True)
|
|
212
|
+
(docs_root / "storage-schema.md").write_text(
|
|
213
|
+
"# Storage Schema\n\nUser table and field definitions.\n",
|
|
214
|
+
encoding="utf-8",
|
|
215
|
+
)
|
|
216
|
+
|
|
217
|
+
rag = RAGrep(db_path=str(self.db_path), embedder=FakeEmbedder())
|
|
218
|
+
try:
|
|
219
|
+
index_result = rag.index(str(docs_root))
|
|
220
|
+
self.assertTrue(index_result["indexed"])
|
|
221
|
+
self.assertEqual(index_result["files"], 1)
|
|
222
|
+
|
|
223
|
+
recall_result = rag.recall("schema user", limit=5, auto_index=False)
|
|
224
|
+
self.assertEqual(recall_result["count"], 1)
|
|
225
|
+
self.assertEqual(
|
|
226
|
+
recall_result["matches"][0]["metadata"]["source"],
|
|
227
|
+
"storage-schema.md",
|
|
228
|
+
)
|
|
229
|
+
finally:
|
|
230
|
+
rag.close()
|
|
231
|
+
|
|
208
232
|
def test_stats(self):
|
|
209
233
|
rag = RAGrep(db_path=str(self.db_path), embedder=FakeEmbedder())
|
|
210
234
|
try:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|