Coverage for core/langgraph/tools/_paths.py: 100%

5 statements  

« prev     ^ index     » next       coverage.py v7.16.0, created at 2026-09-25 03:42 +0000

1"""Shared filesystem path helpers for per-tool modules.""" 

2from __future__ import annotations 

3 

4from pathlib import Path 

5 

6# Directories skipped by default in directory listings. 

7_DEFAULT_SKIP_DIRS = { 

8 ".git", "node_modules", "__pycache__", ".venv", "venv", 

9 ".mypy_cache", ".pytest_cache", ".ruff_cache", 

10} 

11 

12 

13def is_within(root: Path, candidate: Path) -> bool: 

14 """True when `candidate` equals `root` or is contained in `root`.""" 

15 return candidate == root or root in candidate.parents