Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/griffe/_internal/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import tempfile
from contextlib import suppress
from datetime import datetime, timezone
from functools import cached_property
from importlib.util import find_spec
from pathlib import Path
from typing import TYPE_CHECKING, ClassVar, cast
Expand Down Expand Up @@ -90,13 +91,17 @@ def __init__(
"""Whether to force inspecting (importing) modules, even when sources were found."""
self.store_source: bool = store_source
"""Whether to store source code in the lines collection."""
self.finder: ModuleFinder = ModuleFinder(search_paths)
"""The module source finder."""
self._search_paths: Sequence[str | Path] | None = search_paths
self._time_stats: dict = {
"time_spent_visiting": 0,
"time_spent_inspecting": 0,
}

@cached_property
def finder(self) -> ModuleFinder:
"""The module source finder."""
return ModuleFinder(search_paths=self._search_paths)

def load(
self,
objspec: str | Path | None = None,
Expand Down
Loading