symgrep-codesearch 0.6.0__tar.gz → 0.6.2__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.
Files changed (59) hide show
  1. {symgrep_codesearch-0.6.0 → symgrep_codesearch-0.6.2}/PKG-INFO +13 -4
  2. {symgrep_codesearch-0.6.0 → symgrep_codesearch-0.6.2}/README.md +9 -2
  3. {symgrep_codesearch-0.6.0 → symgrep_codesearch-0.6.2}/pyproject.toml +12 -2
  4. {symgrep_codesearch-0.6.0 → symgrep_codesearch-0.6.2}/src/symgrep/ripgrep.py +20 -10
  5. {symgrep_codesearch-0.6.0 → symgrep_codesearch-0.6.2}/src/symgrep_codesearch.egg-info/PKG-INFO +13 -4
  6. {symgrep_codesearch-0.6.0 → symgrep_codesearch-0.6.2}/src/symgrep_codesearch.egg-info/requires.txt +4 -1
  7. {symgrep_codesearch-0.6.0 → symgrep_codesearch-0.6.2}/LICENSE +0 -0
  8. {symgrep_codesearch-0.6.0 → symgrep_codesearch-0.6.2}/setup.cfg +0 -0
  9. {symgrep_codesearch-0.6.0 → symgrep_codesearch-0.6.2}/src/symgrep/__init__.py +0 -0
  10. {symgrep_codesearch-0.6.0 → symgrep_codesearch-0.6.2}/src/symgrep/blocks.py +0 -0
  11. {symgrep_codesearch-0.6.0 → symgrep_codesearch-0.6.2}/src/symgrep/classfile.py +0 -0
  12. {symgrep_codesearch-0.6.0 → symgrep_codesearch-0.6.2}/src/symgrep/cli.py +0 -0
  13. {symgrep_codesearch-0.6.0 → symgrep_codesearch-0.6.2}/src/symgrep/data_symbols.py +0 -0
  14. {symgrep_codesearch-0.6.0 → symgrep_codesearch-0.6.2}/src/symgrep/docsymbols.py +0 -0
  15. {symgrep_codesearch-0.6.0 → symgrep_codesearch-0.6.2}/src/symgrep/enclosing.py +0 -0
  16. {symgrep_codesearch-0.6.0 → symgrep_codesearch-0.6.2}/src/symgrep/mcp_server.py +0 -0
  17. {symgrep_codesearch-0.6.0 → symgrep_codesearch-0.6.2}/src/symgrep/mcp_structured.py +0 -0
  18. {symgrep_codesearch-0.6.0 → symgrep_codesearch-0.6.2}/src/symgrep/report.py +0 -0
  19. {symgrep_codesearch-0.6.0 → symgrep_codesearch-0.6.2}/src/symgrep/resolve.py +0 -0
  20. {symgrep_codesearch-0.6.0 → symgrep_codesearch-0.6.2}/src/symgrep/resolve_js.py +0 -0
  21. {symgrep_codesearch-0.6.0 → symgrep_codesearch-0.6.2}/src/symgrep/resolve_python.py +0 -0
  22. {symgrep_codesearch-0.6.0 → symgrep_codesearch-0.6.2}/src/symgrep/semantic.py +0 -0
  23. {symgrep_codesearch-0.6.0 → symgrep_codesearch-0.6.2}/src/symgrep/structural.py +0 -0
  24. {symgrep_codesearch-0.6.0 → symgrep_codesearch-0.6.2}/src/symgrep/structure.py +0 -0
  25. {symgrep_codesearch-0.6.0 → symgrep_codesearch-0.6.2}/src/symgrep_codesearch.egg-info/SOURCES.txt +0 -0
  26. {symgrep_codesearch-0.6.0 → symgrep_codesearch-0.6.2}/src/symgrep_codesearch.egg-info/dependency_links.txt +0 -0
  27. {symgrep_codesearch-0.6.0 → symgrep_codesearch-0.6.2}/src/symgrep_codesearch.egg-info/entry_points.txt +0 -0
  28. {symgrep_codesearch-0.6.0 → symgrep_codesearch-0.6.2}/src/symgrep_codesearch.egg-info/top_level.txt +0 -0
  29. {symgrep_codesearch-0.6.0 → symgrep_codesearch-0.6.2}/tests/test_blocks_extraction.py +0 -0
  30. {symgrep_codesearch-0.6.0 → symgrep_codesearch-0.6.2}/tests/test_blocks_retrieval.py +0 -0
  31. {symgrep_codesearch-0.6.0 → symgrep_codesearch-0.6.2}/tests/test_bulk_describe.py +0 -0
  32. {symgrep_codesearch-0.6.0 → symgrep_codesearch-0.6.2}/tests/test_classfile.py +0 -0
  33. {symgrep_codesearch-0.6.0 → symgrep_codesearch-0.6.2}/tests/test_data_symbols.py +0 -0
  34. {symgrep_codesearch-0.6.0 → symgrep_codesearch-0.6.2}/tests/test_describe_lane_confinement.py +0 -0
  35. {symgrep_codesearch-0.6.0 → symgrep_codesearch-0.6.2}/tests/test_doc_symbols.py +0 -0
  36. {symgrep_codesearch-0.6.0 → symgrep_codesearch-0.6.2}/tests/test_file_structure.py +0 -0
  37. {symgrep_codesearch-0.6.0 → symgrep_codesearch-0.6.2}/tests/test_freshness.py +0 -0
  38. {symgrep_codesearch-0.6.0 → symgrep_codesearch-0.6.2}/tests/test_honest_recall.py +0 -0
  39. {symgrep_codesearch-0.6.0 → symgrep_codesearch-0.6.2}/tests/test_http_ensure.py +0 -0
  40. {symgrep_codesearch-0.6.0 → symgrep_codesearch-0.6.2}/tests/test_index_reconstruct.py +0 -0
  41. {symgrep_codesearch-0.6.0 → symgrep_codesearch-0.6.2}/tests/test_index_scope.py +0 -0
  42. {symgrep_codesearch-0.6.0 → symgrep_codesearch-0.6.2}/tests/test_index_worker.py +0 -0
  43. {symgrep_codesearch-0.6.0 → symgrep_codesearch-0.6.2}/tests/test_mcp_structured.py +0 -0
  44. {symgrep_codesearch-0.6.0 → symgrep_codesearch-0.6.2}/tests/test_name_uniqueness.py +0 -0
  45. {symgrep_codesearch-0.6.0 → symgrep_codesearch-0.6.2}/tests/test_nudge_runaway.py +0 -0
  46. {symgrep_codesearch-0.6.0 → symgrep_codesearch-0.6.2}/tests/test_report_filters.py +0 -0
  47. {symgrep_codesearch-0.6.0 → symgrep_codesearch-0.6.2}/tests/test_resolve.py +0 -0
  48. {symgrep_codesearch-0.6.0 → symgrep_codesearch-0.6.2}/tests/test_resolve_js.py +0 -0
  49. {symgrep_codesearch-0.6.0 → symgrep_codesearch-0.6.2}/tests/test_resolve_python.py +0 -0
  50. {symgrep_codesearch-0.6.0 → symgrep_codesearch-0.6.2}/tests/test_resolve_r2.py +0 -0
  51. {symgrep_codesearch-0.6.0 → symgrep_codesearch-0.6.2}/tests/test_review_regressions.py +0 -0
  52. {symgrep_codesearch-0.6.0 → symgrep_codesearch-0.6.2}/tests/test_semantic_freshness_signal.py +0 -0
  53. {symgrep_codesearch-0.6.0 → symgrep_codesearch-0.6.2}/tests/test_sites_and_symbols.py +0 -0
  54. {symgrep_codesearch-0.6.0 → symgrep_codesearch-0.6.2}/tests/test_structural.py +0 -0
  55. {symgrep_codesearch-0.6.0 → symgrep_codesearch-0.6.2}/tests/test_symbol_vocabulary.py +0 -0
  56. {symgrep_codesearch-0.6.0 → symgrep_codesearch-0.6.2}/tests/test_ts_fallback_loud.py +0 -0
  57. {symgrep_codesearch-0.6.0 → symgrep_codesearch-0.6.2}/tests/test_ts_symbol_coverage.py +0 -0
  58. {symgrep_codesearch-0.6.0 → symgrep_codesearch-0.6.2}/tests/test_usage.py +0 -0
  59. {symgrep_codesearch-0.6.0 → symgrep_codesearch-0.6.2}/tests/test_veccore_adoption.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: symgrep-codesearch
3
- Version: 0.6.0
3
+ Version: 0.6.2
4
4
  Summary: Code search with honest recall — structure-aware grep that tells you what it does not know, plus search by meaning
5
5
  License-Expression: MIT
6
6
  Project-URL: Repository, https://github.com/ashdamle/symgrep
@@ -20,10 +20,12 @@ Requires-Python: >=3.11
20
20
  Description-Content-Type: text/markdown
21
21
  License-File: LICENSE
22
22
  Requires-Dist: tree-sitter-language-pack>=1.0
23
- Requires-Dist: veccore[fastembed]>=0.2
23
+ Requires-Dist: veccore[fastembed]<1,>=0.2
24
24
  Provides-Extra: semantic
25
25
  Provides-Extra: mcp
26
26
  Requires-Dist: fastmcp>=2.0; extra == "mcp"
27
+ Provides-Extra: rg
28
+ Requires-Dist: ripgrep-bin>=14; extra == "rg"
27
29
  Provides-Extra: structural
28
30
  Dynamic: license-file
29
31
 
@@ -113,8 +115,15 @@ pacman -S ripgrep # Arch
113
115
  # other platforms: https://github.com/BurntSushi/ripgrep#installation
114
116
  ```
115
117
 
116
- If `rg` is missing, symgrep fails with a clear, actionable error (never a silent zero-hit). An `rg` installed
117
- somewhere off `PATH` can be pointed to explicitly with `SYMGREP_RG=/path/to/rg`.
118
+ Or get it from pip, no system package manager needed — the `[rg]` extra bundles the binary (macOS/Linux/Windows):
119
+
120
+ ```bash
121
+ pip install 'symgrep-codesearch[rg]' # self-contained: ships the rg binary via the ripgrep-bin wheel
122
+ ```
123
+
124
+ This is handy for CI and quick starts; prefer a system `rg` where you have one. If `rg` is missing entirely,
125
+ symgrep fails with a clear, actionable error (never a silent zero-hit). An `rg` installed somewhere off `PATH`
126
+ can be pointed to explicitly with `SYMGREP_RG=/path/to/rg`.
118
127
 
119
128
  ```bash
120
129
  # Distribution name is `symgrep-codesearch` (the bare `symgrep` is parked on PyPI by the Semgrep team);
@@ -84,8 +84,15 @@ pacman -S ripgrep # Arch
84
84
  # other platforms: https://github.com/BurntSushi/ripgrep#installation
85
85
  ```
86
86
 
87
- If `rg` is missing, symgrep fails with a clear, actionable error (never a silent zero-hit). An `rg` installed
88
- somewhere off `PATH` can be pointed to explicitly with `SYMGREP_RG=/path/to/rg`.
87
+ Or get it from pip, no system package manager needed — the `[rg]` extra bundles the binary (macOS/Linux/Windows):
88
+
89
+ ```bash
90
+ pip install 'symgrep-codesearch[rg]' # self-contained: ships the rg binary via the ripgrep-bin wheel
91
+ ```
92
+
93
+ This is handy for CI and quick starts; prefer a system `rg` where you have one. If `rg` is missing entirely,
94
+ symgrep fails with a clear, actionable error (never a silent zero-hit). An `rg` installed somewhere off `PATH`
95
+ can be pointed to explicitly with `SYMGREP_RG=/path/to/rg`.
89
96
 
90
97
  ```bash
91
98
  # Distribution name is `symgrep-codesearch` (the bare `symgrep` is parked on PyPI by the Semgrep team);
@@ -7,12 +7,17 @@ build-backend = "setuptools.build_meta"
7
7
  # Semgrep team. The IMPORT name is unchanged — `import symgrep` — so consumers (honestreview, spendguard,
8
8
  # 7thsense, warden) are unaffected by the distribution rename. The package dir stays src/symgrep.
9
9
  name = "symgrep-codesearch"
10
+ # 0.6.2: ripgrep is a system binary and cannot be a normal pip dependency, but the new `[rg]` extra pulls
11
+ # `ripgrep-bin` (a wheel bundling the rg binary) for a self-contained install; rg_binary() now also finds an
12
+ # rg next to the interpreter (venv bin), so the pip-only path works even under `.venv/bin/python -m …`.
13
+ # 0.6.1: cap the veccore dependency at >=0.2,<1 so a future breaking veccore 1.0 is not pulled in unguarded
14
+ # (verified against veccore 0.3.0).
10
15
  # 0.6.0: search-by-meaning is now STANDARD — veccore[fastembed] moved from the `[semantic]` extra into core
11
16
  # `dependencies` (the extra is now a no-op back-compat alias). `pip install symgrep-codesearch` now ships
12
17
  # semantic search. Minor bump (dependency surface changed; no breaking import/CLI/MCP change).
13
18
  # 0.5.0: added the public `file_structure` library API (+ its MCP tool and `symgrep structure` CLI), import
14
19
  # module-name normalization, and the FileStructure `connects` list (structure schema v2).
15
- version = "0.6.0"
20
+ version = "0.6.2"
16
21
  description = "Code search with honest recall — structure-aware grep that tells you what it does not know, plus search by meaning"
17
22
  readme = "README.md"
18
23
  # 3.11+ : the maintained grammar pack (tree-sitter-language-pack, a CORE dep below) ships abi3 wheels for
@@ -42,7 +47,7 @@ dependencies = [
42
47
  # pulls fastembed's ONNX runtime, so the base install is heavier — a deliberate trade for semantic working
43
48
  # out of the box everywhere symgrep is installed. semantic.py still degrades honestly (UNAVAILABLE) if the
44
49
  # stack is somehow absent, but that is now the exception, not the norm.
45
- "veccore[fastembed]>=0.2",
50
+ "veccore[fastembed]>=0.2,<1", # cap below a future breaking 1.0; verified against 0.3.0
46
51
  ]
47
52
  # No "License :: ..." trove classifier: PEP 639 carries the license in the SPDX `license` field above, and
48
53
  # setuptools>=77 rejects a redundant license classifier alongside it. rg is a system prerequisite, not declared here.
@@ -75,6 +80,11 @@ Repository = "https://github.com/ashdamle/symgrep"
75
80
  # alias so `pip install symgrep-codesearch[semantic]` (docs, muscle memory, existing consumers) still resolves.
76
81
  semantic = []
77
82
  mcp = ["fastmcp>=2.0"]
83
+ # rg is a SYSTEM binary (ripgrep), not normally a pip dependency. This OPTIONAL extra pulls `ripgrep-bin`, a
84
+ # wheel that bundles the rg binary (macOS/Linux/Windows), for a self-contained `pip install` with no system
85
+ # package manager — handy for CI and quick starts. rg_binary() finds the binary it lands in the interpreter's
86
+ # bin dir even when that dir is not on PATH. Prefer a system rg where you have one; this is the pip fallback.
87
+ rg = ["ripgrep-bin>=14"]
78
88
  # The grammar deps moved to CORE `dependencies` (grammar-aware symbols must work by default, not opt-in).
79
89
  # This extra is kept as a NO-OP back-compat alias so `pip install symgrep[structural]` (CI, docs, muscle
80
90
  # memory) still resolves — the grammars it used to add are now unconditional.
@@ -9,6 +9,7 @@ import json
9
9
  import os
10
10
  import shutil
11
11
  import subprocess
12
+ import sys
12
13
  import threading
13
14
  from dataclasses import dataclass, field
14
15
  from typing import Iterable, List, Optional
@@ -71,16 +72,25 @@ def rg_binary() -> str:
71
72
  # quietly using whatever rg is on PATH
72
73
  raise RipgrepNotFound(f"{RG_ENV_VAR}={env!r} does not exist")
73
74
  found = shutil.which("rg")
74
- if not found:
75
- # rg is a SYSTEM prerequisite, not a pip dependency — symgrep IS ripgrep underneath. Fail with the
76
- # exact fix rather than degrade to a silent zero-hit (the confusion this tool exists to prevent).
77
- raise RipgrepNotFound(
78
- "ripgrep (rg) is required but was not found on PATH. Install it: "
79
- "macOS `brew install ripgrep`; Debian/Ubuntu `apt install ripgrep`; "
80
- "Fedora `dnf install ripgrep`; Arch `pacman -S ripgrep`; or see "
81
- f"https://github.com/BurntSushi/ripgrep#installation . "
82
- f"Already installed elsewhere? Point symgrep at it with {RG_ENV_VAR}=/path/to/rg")
83
- return found
75
+ if found:
76
+ return found
77
+ # The `symgrep-codesearch[rg]` extra pulls `ripgrep-bin`, which lands `rg` in the interpreter's OWN bin dir
78
+ # (the venv's bin/). That dir is NOT on PATH when symgrep runs via `.venv/bin/python -m …` without
79
+ # activation (the common CI invocation), so shutil.which misses it — look there explicitly, making the
80
+ # pip-only install self-contained regardless of PATH.
81
+ exe_dir = os.path.dirname(sys.executable or "")
82
+ if exe_dir:
83
+ cand = os.path.join(exe_dir, "rg.exe" if os.name == "nt" else "rg")
84
+ if os.path.isfile(cand) and os.access(cand, os.X_OK):
85
+ return cand
86
+ # rg is a SYSTEM binary, not resolvable as a normal pip dependency — symgrep IS ripgrep underneath. Fail
87
+ # with the exact fix rather than degrade to a silent zero-hit (the confusion this tool exists to prevent).
88
+ raise RipgrepNotFound(
89
+ "ripgrep (rg) is required but was not found. Either install the binary — "
90
+ "macOS `brew install ripgrep`; Debian/Ubuntu `apt install ripgrep`; Fedora `dnf install ripgrep`; "
91
+ "Arch `pacman -S ripgrep`; or https://github.com/BurntSushi/ripgrep#installation — OR get it from pip "
92
+ "with the bundled-binary extra: `pip install 'symgrep-codesearch[rg]'`. "
93
+ f"Already installed elsewhere? Point symgrep at it with {RG_ENV_VAR}=/path/to/rg")
84
94
 
85
95
 
86
96
  def _rg_cmd(pattern: str, roots: Iterable[str], case_insensitive: bool, fixed_string: bool,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: symgrep-codesearch
3
- Version: 0.6.0
3
+ Version: 0.6.2
4
4
  Summary: Code search with honest recall — structure-aware grep that tells you what it does not know, plus search by meaning
5
5
  License-Expression: MIT
6
6
  Project-URL: Repository, https://github.com/ashdamle/symgrep
@@ -20,10 +20,12 @@ Requires-Python: >=3.11
20
20
  Description-Content-Type: text/markdown
21
21
  License-File: LICENSE
22
22
  Requires-Dist: tree-sitter-language-pack>=1.0
23
- Requires-Dist: veccore[fastembed]>=0.2
23
+ Requires-Dist: veccore[fastembed]<1,>=0.2
24
24
  Provides-Extra: semantic
25
25
  Provides-Extra: mcp
26
26
  Requires-Dist: fastmcp>=2.0; extra == "mcp"
27
+ Provides-Extra: rg
28
+ Requires-Dist: ripgrep-bin>=14; extra == "rg"
27
29
  Provides-Extra: structural
28
30
  Dynamic: license-file
29
31
 
@@ -113,8 +115,15 @@ pacman -S ripgrep # Arch
113
115
  # other platforms: https://github.com/BurntSushi/ripgrep#installation
114
116
  ```
115
117
 
116
- If `rg` is missing, symgrep fails with a clear, actionable error (never a silent zero-hit). An `rg` installed
117
- somewhere off `PATH` can be pointed to explicitly with `SYMGREP_RG=/path/to/rg`.
118
+ Or get it from pip, no system package manager needed — the `[rg]` extra bundles the binary (macOS/Linux/Windows):
119
+
120
+ ```bash
121
+ pip install 'symgrep-codesearch[rg]' # self-contained: ships the rg binary via the ripgrep-bin wheel
122
+ ```
123
+
124
+ This is handy for CI and quick starts; prefer a system `rg` where you have one. If `rg` is missing entirely,
125
+ symgrep fails with a clear, actionable error (never a silent zero-hit). An `rg` installed somewhere off `PATH`
126
+ can be pointed to explicitly with `SYMGREP_RG=/path/to/rg`.
118
127
 
119
128
  ```bash
120
129
  # Distribution name is `symgrep-codesearch` (the bare `symgrep` is parked on PyPI by the Semgrep team);
@@ -1,9 +1,12 @@
1
1
  tree-sitter-language-pack>=1.0
2
- veccore[fastembed]>=0.2
2
+ veccore[fastembed]<1,>=0.2
3
3
 
4
4
  [mcp]
5
5
  fastmcp>=2.0
6
6
 
7
+ [rg]
8
+ ripgrep-bin>=14
9
+
7
10
  [semantic]
8
11
 
9
12
  [structural]