From 1877aeb8cd6bc68382d248fee720f2aea794b8f6 Mon Sep 17 00:00:00 2001 From: Martin Donath Date: Fri, 23 Jan 2026 12:52:25 +0100 Subject: [PATCH] fix: reload loop when mkdocstrings loads modules from `.` (#294) Signed-off-by: squidfunk --- python/zensical/config.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/python/zensical/config.py b/python/zensical/config.py index bdc45a9..eb0289e 100644 --- a/python/zensical/config.py +++ b/python/zensical/config.py @@ -485,11 +485,12 @@ def _list_sources(config: dict, config_file: str) -> list[tuple[str, int]]: # Collect all files under this root with modification times to detect # changes. We'll replace this with proper dependency tracking later. - files = [(path, int(os.path.getmtime(path)))] + files = [] if path.is_dir(): - for subpath in path.rglob("*"): + for subpath in path.rglob("*.{py,py?,so,dll}"): files.extend([(subpath, int(os.path.getmtime(subpath)))]) - roots_with_hash.append((str(path), _hash(files))) + if files: + roots_with_hash.append((str(path), _hash(files))) return sorted(roots_with_hash)