feat: use text-analysis to short-circuit strategy loading

This commit is contained in:
Matthias
2025-10-28 20:40:18 +01:00
parent 3cfa366ec9
commit 86381955a3

View File

@@ -148,6 +148,9 @@ class IResolver:
logger.debug("Ignoring broken symlink %s", entry)
continue
module_path = entry.resolve()
if entry.read_text().find(f"class {object_name}(") == -1:
logger.debug(f"Skipping {module_path} as it does not contain class {object_name}")
continue
if obj := next(cls._get_valid_object(module_path, object_name), None):
obj[0].__file__ = str(entry)