graphe-code 0.1.0__tar.gz → 0.1.1__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 (25) hide show
  1. {graphe_code-0.1.0/src/graphe_code.egg-info → graphe_code-0.1.1}/PKG-INFO +1 -1
  2. {graphe_code-0.1.0 → graphe_code-0.1.1}/pyproject.toml +1 -1
  3. {graphe_code-0.1.0 → graphe_code-0.1.1}/src/graphe/cli.py +6 -4
  4. {graphe_code-0.1.0 → graphe_code-0.1.1/src/graphe_code.egg-info}/PKG-INFO +1 -1
  5. {graphe_code-0.1.0 → graphe_code-0.1.1}/tests/test_host.py +1 -2
  6. {graphe_code-0.1.0 → graphe_code-0.1.1}/LICENSE +0 -0
  7. {graphe_code-0.1.0 → graphe_code-0.1.1}/README.md +0 -0
  8. {graphe_code-0.1.0 → graphe_code-0.1.1}/setup.cfg +0 -0
  9. {graphe_code-0.1.0 → graphe_code-0.1.1}/src/graphe/__init__.py +0 -0
  10. {graphe_code-0.1.0 → graphe_code-0.1.1}/src/graphe/core.py +0 -0
  11. {graphe_code-0.1.0 → graphe_code-0.1.1}/src/graphe/generic.py +0 -0
  12. {graphe_code-0.1.0 → graphe_code-0.1.1}/src/graphe/godot.py +0 -0
  13. {graphe_code-0.1.0 → graphe_code-0.1.1}/src/graphe/js.py +0 -0
  14. {graphe_code-0.1.0 → graphe_code-0.1.1}/src/graphe/python.py +0 -0
  15. {graphe_code-0.1.0 → graphe_code-0.1.1}/src/graphe/root.py +0 -0
  16. {graphe_code-0.1.0 → graphe_code-0.1.1}/src/graphe_code.egg-info/SOURCES.txt +0 -0
  17. {graphe_code-0.1.0 → graphe_code-0.1.1}/src/graphe_code.egg-info/dependency_links.txt +0 -0
  18. {graphe_code-0.1.0 → graphe_code-0.1.1}/src/graphe_code.egg-info/entry_points.txt +0 -0
  19. {graphe_code-0.1.0 → graphe_code-0.1.1}/src/graphe_code.egg-info/requires.txt +0 -0
  20. {graphe_code-0.1.0 → graphe_code-0.1.1}/src/graphe_code.egg-info/top_level.txt +0 -0
  21. {graphe_code-0.1.0 → graphe_code-0.1.1}/tests/test_generic.py +0 -0
  22. {graphe_code-0.1.0 → graphe_code-0.1.1}/tests/test_graphe.py +0 -0
  23. {graphe_code-0.1.0 → graphe_code-0.1.1}/tests/test_plugin.py +0 -0
  24. {graphe_code-0.1.0 → graphe_code-0.1.1}/tests/test_release.py +0 -0
  25. {graphe_code-0.1.0 → graphe_code-0.1.1}/tests/test_root.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: graphe-code
3
- Version: 0.1.0
3
+ Version: 0.1.1
4
4
  Summary: The code graph of a host project: what calls what, what cites what.
5
5
  License-Expression: MIT
6
6
  Requires-Python: >=3.13
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "graphe-code"
3
- version = "0.1.0"
3
+ version = "0.1.1"
4
4
  description = "The code graph of a host project: what calls what, what cites what."
5
5
  license = "MIT"
6
6
  license-files = ["LICENSE"]
@@ -596,10 +596,12 @@ const anchor=()=>{const n=N.find(n=>n.id===decodeURIComponent(location.hash.slic
596
596
 
597
597
  def load(as_is: bool = False) -> nx.DiGraph:
598
598
  """The graph; rebuilt first if it is older than the host's code or than the tool."""
599
- if not JSON.exists() or (not as_is and max((p.stat().st_mtime for p in _sources() + _tool()), default=0)
600
- > JSON.stat().st_mtime):
601
- print("(the graph is older than the code or the tool: rebuilding)", file=sys.stderr)
602
- build(quiet=True)
599
+ if not (as_is and JSON.exists()):
600
+ # The sources first: outside a git repository, their one-line error comes before any rebuilding line (T-0069).
601
+ newest = max((p.stat().st_mtime for p in _sources() + _tool()), default=0)
602
+ if not JSON.exists() or newest > JSON.stat().st_mtime:
603
+ print("(the graph is older than the code or the tool: rebuilding)", file=sys.stderr)
604
+ build(quiet=True)
603
605
  data = json.loads(JSON.read_bytes())
604
606
  graph = nx.DiGraph(communities=data["communities"], unattributed=data.get("unattributed", {}))
605
607
  for n in data["nodes"]:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: graphe-code
3
- Version: 0.1.0
3
+ Version: 0.1.1
4
4
  Summary: The code graph of a host project: what calls what, what cites what.
5
5
  License-Expression: MIT
6
6
  Requires-Python: >=3.13
@@ -254,9 +254,8 @@ def test_an_expected_error_on_a_query_prints_one_line(tmp_path: Path):
254
254
  (tmp_path / "dehors").mkdir()
255
255
  r = _run(tmp_path / "dehors", "explain", "aider")
256
256
  assert r.returncode == 1 and "Traceback" not in r.stderr
257
- line = r.stderr.strip().splitlines()[-1]
257
+ [line] = r.stderr.strip().splitlines() # T-0069: the error alone, no rebuilding line before it
258
258
  assert line.startswith("graphe: ") and "dehors" in line and "files git tracks" in line
259
- assert r.stderr.strip().splitlines()[-2].startswith("(the graph is older") # nothing between
260
259
  host = _host(tmp_path / "hote", {"outils.py": CALLEE, "graphe.toml": WITH_EXTENSION,
261
260
  "ext/regles_du_temoin.py": "SALUT = 1\n"})
262
261
  r = _run(host, "search", "aider")
File without changes
File without changes
File without changes