ph-code-graph 0.3.0__tar.gz → 0.4.0__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: ph-code-graph
3
- Version: 0.3.0
3
+ Version: 0.4.0
4
4
  Summary: pH plugin: `code_index` and `code_graph`, a Python-native tree-sitter code graph with line-accurate answers.
5
5
  Project-URL: Homepage, https://github.com/chastabor/pH
6
6
  Project-URL: Repository, https://github.com/chastabor/pH
@@ -21,7 +21,7 @@ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
21
21
  Classifier: Topic :: Software Development
22
22
  Classifier: Typing :: Typed
23
23
  Requires-Python: >=3.12
24
- Requires-Dist: ph-core==0.3.0
24
+ Requires-Dist: ph-core==0.4.0
25
25
  Requires-Dist: tree-sitter-language-pack>=1.16
26
26
  Requires-Dist: tree-sitter>=0.25
27
27
  Description-Content-Type: text/markdown
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "ph-code-graph"
7
- version = "0.3.0"
7
+ version = "0.4.0"
8
8
  description = "pH plugin: `code_index` and `code_graph`, a Python-native tree-sitter code graph with line-accurate answers."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.12"
@@ -29,7 +29,7 @@ classifiers = [
29
29
  # in (371 available, the rest fetched on demand — which this row never does
30
30
  # implicitly; see `_extract.indexable`). No Rust toolchain, no Node, no
31
31
  # submodule: the graph itself is stdlib `sqlite3`.
32
- dependencies = ["ph-core==0.3.0", "tree-sitter>=0.25", "tree-sitter-language-pack>=1.16"]
32
+ dependencies = ["ph-core==0.4.0", "tree-sitter>=0.25", "tree-sitter-language-pack>=1.16"]
33
33
 
34
34
  [project.urls]
35
35
  Homepage = "https://github.com/chastabor/pH"
@@ -42,6 +42,7 @@ answers most of what an agent actually asks and reports where it cannot.
42
42
  from __future__ import annotations
43
43
 
44
44
  import hashlib
45
+ import importlib.util
45
46
  import logging
46
47
  from collections.abc import Mapping
47
48
  from dataclasses import dataclass, field
@@ -198,7 +199,8 @@ class CodeGraphSeam:
198
199
 
199
200
  def report(self) -> list[tuple[str, str]]:
200
201
  """`phern doctor`'s section."""
201
- import tree_sitter
202
+ # Not a declared dependency: the row checks for it before this runs.
203
+ import tree_sitter # noqa: PLC0415
202
204
 
203
205
  # No `hasattr` guard: the row declares `inject=[FS]`, so `ctx.fs` is
204
206
  # present for as long as it is active — and a `Path.cwd()` fallback
@@ -494,8 +496,6 @@ def offer_skills(ctx: Context) -> None:
494
496
  @plugin("code-graph", inject=[TOOLS, FS], config=Config)
495
497
  async def apply(ctx: Context, config: Config) -> None:
496
498
  """Mount the seam and register both tools."""
497
- import importlib.util
498
-
499
499
  for module in ("tree_sitter", "tree_sitter_language_pack"):
500
500
  if importlib.util.find_spec(module) is None:
501
501
  raise MountRefusal(MISSING)
@@ -40,6 +40,7 @@ query alone yields two tags and no calls — measured. `INHERITS` is that fact.
40
40
  from __future__ import annotations
41
41
 
42
42
  import logging
43
+ import os
43
44
  from collections.abc import Callable, Sequence
44
45
  from dataclasses import dataclass, replace
45
46
  from functools import cache
@@ -129,7 +130,8 @@ class Extraction:
129
130
 
130
131
 
131
132
  def _pack() -> Any: # noqa: ANN401
132
- import tree_sitter_language_pack
133
+ # Not a declared dependency: the row checks for it before this runs.
134
+ import tree_sitter_language_pack # noqa: PLC0415
133
135
 
134
136
  return tree_sitter_language_pack
135
137
 
@@ -196,8 +198,6 @@ def use_cache(directory: Path) -> Path:
196
198
  An operator who set the environment variable deliberately keeps it — their
197
199
  spelling wins, which is what makes the variable still mean something.
198
200
  """
199
- import os
200
-
201
201
  global _configured
202
202
 
203
203
  override = os.environ.get("TREE_SITTER_LANGUAGE_PACK_CACHE_DIR")
@@ -343,7 +343,8 @@ def _tags_query(language: str) -> Any: # noqa: ANN401
343
343
  for the same reason: a `Query` is read-only once built, and `extract` makes
344
344
  a fresh `QueryCursor` per call — which is the mutable half.
345
345
  """
346
- from tree_sitter import Query
346
+ # Not a declared dependency: the row checks for it before this runs.
347
+ from tree_sitter import Query # noqa: PLC0415
347
348
 
348
349
  pack = _pack()
349
350
  sources = [pack.get_tags_query(one) for one in INHERITS.get(language, ())]
@@ -359,7 +360,8 @@ def extract(path: str, text: str, language: str) -> Extraction:
359
360
  should stop the batch or be reported and skipped is its decision, not
360
361
  this function's.
361
362
  """
362
- from tree_sitter import QueryCursor
363
+ # Not a declared dependency: the row checks for it before this runs.
364
+ from tree_sitter import QueryCursor # noqa: PLC0415
363
365
 
364
366
  pack = _pack()
365
367
  config = pack.ProcessConfig(
File without changes
File without changes
File without changes