fix: don't watch mkdocstrings-configured path if it's the root directory

This is a follow-up of commit 6e3d5ef64b which was actually incomplete. Since a/ is relative to a/, we also have to check that a path configured through mkdocstrings-python's  option isn't the project root itself.

Signed-off-by: Timothée Mazzucotelli <dev@pawamoy.fr>
This commit is contained in:
Timothée Mazzucotelli
2026-02-11 16:26:36 +01:00
committed by GitHub
parent b3c699ba45
commit e33c972e03
+1 -1
View File
@@ -501,7 +501,7 @@ def _list_sources(config: dict, config_file: str) -> list[tuple[str, int]]:
root = Path(config_file).parent.resolve()
for python_path in python_paths:
path = root.joinpath(python_path).resolve()
if path.is_dir() and path.is_relative_to(root):
if path.is_dir() and path.is_relative_to(root) and path != root:
for subpath in path.rglob("*"):
# Path.rglob can't do patterns, so we need to filter here
if subpath.suffix in {