Skip to content

Commit

Permalink
ci: Improve typing of import utils
Browse files Browse the repository at this point in the history
  • Loading branch information
pawamoy committed Jul 13, 2023
1 parent 0975044 commit 20f1f8f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/griffe/agents/inspector.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
from inspect import Parameter as SignatureParameter
from inspect import Signature, cleandoc
from inspect import signature as getsignature
from typing import TYPE_CHECKING, Any
from typing import TYPE_CHECKING, Any, Sequence

from griffe.agents.nodes import ObjectKind, ObjectNode, safe_get_annotation
from griffe.collections import LinesCollection, ModulesCollection
Expand Down Expand Up @@ -58,7 +58,7 @@ def inspect(
module_name: str,
*,
filepath: Path | None = None,
import_paths: list[Path] | None = None,
import_paths: Sequence[str | Path] | None = None,
extensions: Extensions | None = None,
parent: Module | None = None,
docstring_parser: Parser | None = None,
Expand Down Expand Up @@ -159,7 +159,7 @@ def _get_docstring(self, node: ObjectNode) -> Docstring | None:
parser_options=self.docstring_options,
)

def get_module(self, import_paths: list[Path] | None = None) -> Module:
def get_module(self, import_paths: Sequence[str | Path] | None = None) -> Module:
"""Build and return the object representing the module attached to this inspector.
This method triggers a complete inspection of the module members.
Expand Down
4 changes: 2 additions & 2 deletions src/griffe/importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import sys
from contextlib import contextmanager
from importlib import import_module
from typing import TYPE_CHECKING, Any, Iterator
from typing import TYPE_CHECKING, Any, Iterator, Sequence

if TYPE_CHECKING:
from pathlib import Path
Expand Down Expand Up @@ -33,7 +33,7 @@ def sys_path(*paths: str | Path) -> Iterator[None]:
sys.path = old_path


def dynamic_import(import_path: str, import_paths: list[Path] | None = None) -> Any:
def dynamic_import(import_path: str, import_paths: Sequence[str | Path] | None = None) -> Any:
"""Dynamically import the specified object.
It can be a module, class, method, function, attribute,
Expand Down

0 comments on commit 20f1f8f

Please sign in to comment.