Skip to content

Commit

Permalink
remove mypy_extensions dep
Browse files Browse the repository at this point in the history
  • Loading branch information
nemith committed Sep 22, 2023
1 parent d8c547c commit 1f69e49
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 185 deletions.
13 changes: 9 additions & 4 deletions nornir/core/inventory.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
ItemsView,
Iterator,
TypeVar,
Protocol,
)

from nornir.core.configuration import Config
Expand All @@ -20,8 +21,6 @@
)
from nornir.core.exceptions import ConnectionAlreadyOpen, ConnectionNotOpen

from mypy_extensions import Arg, KwArg


HostOrGroup = TypeVar("HostOrGroup", "Host", "Group")

Expand Down Expand Up @@ -584,8 +583,14 @@ class Groups(Dict[str, Group]):
pass


TransformFunction = Callable[[Arg(Host), KwArg(Any)], None]
FilterObj = Callable[[Arg(Host), KwArg(Any)], bool]
class TransformFunction(Protocol):
def __call__(self, host: Host, **kwargs: Any) -> None:
...


class FilterObj(Protocol):
def __call__(self, host: Host, **kwargs: Any) -> bool:
...


class Inventory(object):
Expand Down
Loading

0 comments on commit 1f69e49

Please sign in to comment.