diff --git a/ica-rs/plugins/base.py b/ica-rs/plugins/base.py index ef85ddb..952d456 100644 --- a/ica-rs/plugins/base.py +++ b/ica-rs/plugins/base.py @@ -1,5 +1,13 @@ -from ica_typing import IcaNewMessage, IcaClient -from ica_typing import TailchatReciveMessage, TailchatClient +from typing import TYPE_CHECKING, TypeVar + +if TYPE_CHECKING: + from ica_typing import IcaNewMessage, IcaClient + from ica_typing import TailchatReciveMessage, TailchatClient +else: + IcaNewMessage = TypeVar("NewMessage") + IcaClient = TypeVar("IcaClient") + TailchatReciveMessage = TypeVar("TailchatReciveMessage") + TailchatClient = TypeVar("TailchatClient") def on_ica_message(msg: IcaNewMessage, client: IcaClient) -> None: if not (msg.is_from_self or msg.is_reply): diff --git a/ica-rs/plugins/namerena.py b/ica-rs/plugins/namerena.py index 9afa8d1..e34a1d2 100644 --- a/ica-rs/plugins/namerena.py +++ b/ica-rs/plugins/namerena.py @@ -4,9 +4,16 @@ import subprocess from pathlib import Path -from ica_typing import IcaNewMessage, IcaClient, ConfigData +from typing import TYPE_CHECKING, TypeVar -CONFIG_DATA: ConfigData +if TYPE_CHECKING: + from ica_typing import IcaNewMessage, IcaClient, ConfigData + + CONFIG_DATA: ConfigData +else: + CONFIG_DATA = None # type: ignore + IcaNewMessage = TypeVar("NewMessage") + IcaClient = TypeVar("IcaClient") _version_ = "0.4.2"