Coverage for core/langgraph/tools/_paths.py: 100%
5 statements
« prev ^ index » next coverage.py v7.16.0, created at 2026-09-28 00:19 +0000
« prev ^ index » next coverage.py v7.16.0, created at 2026-09-28 00:19 +0000
1"""Shared filesystem path helpers for per-tool modules."""
2from __future__ import annotations
4from pathlib import Path
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}
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