diff options
author | Trygve Aaberge <trygveaa@gmail.com> | 2023-01-28 22:20:09 +0100 |
---|---|---|
committer | Trygve Aaberge <trygveaa@gmail.com> | 2024-02-18 11:32:53 +0100 |
commit | 5f71fedd7213fb5873bafa9233cc28cca5690c31 (patch) | |
tree | b94a6b3698c51b4445df27324a9598d2d1319ad7 | |
parent | 7ab59b24a43b1219aac5caba59188934bdf69e09 (diff) | |
download | wee-slack-5f71fedd7213fb5873bafa9233cc28cca5690c31.tar.gz |
Fix compatibility with Python 3.7
-rw-r--r-- | slack/slack_conversation.py | 4 | ||||
-rw-r--r-- | slack/task.py | 5 | ||||
-rw-r--r-- | typings/slack_api/slack_bots_info.pyi | 4 | ||||
-rw-r--r-- | typings/slack_api/slack_conversations_history.pyi | 4 | ||||
-rw-r--r-- | typings/slack_api/slack_conversations_info.pyi | 3 | ||||
-rw-r--r-- | typings/slack_api/slack_error.pyi | 2 | ||||
-rw-r--r-- | typings/slack_api/slack_rtm_connect.pyi | 4 | ||||
-rw-r--r-- | typings/slack_api/slack_users_conversations.pyi | 3 | ||||
-rw-r--r-- | typings/slack_api/slack_users_info.pyi | 4 | ||||
-rw-r--r-- | typings/slack_edgeapi/slack_users_search.pyi | 3 |
10 files changed, 21 insertions, 15 deletions
diff --git a/slack/slack_conversation.py b/slack/slack_conversation.py index d078ead..a23666e 100644 --- a/slack/slack_conversation.py +++ b/slack/slack_conversation.py @@ -2,7 +2,7 @@ from __future__ import annotations import time from contextlib import contextmanager -from typing import TYPE_CHECKING, List, Literal, Optional, Union +from typing import TYPE_CHECKING, List, Optional, Union import weechat @@ -12,6 +12,8 @@ from slack.task import gather from slack.util import get_callback_name if TYPE_CHECKING: + from typing_extensions import Literal + from slack.slack_api import SlackApi from slack.slack_workspace import SlackWorkspace diff --git a/slack/task.py b/slack/task.py index 5b3ebfd..d765811 100644 --- a/slack/task.py +++ b/slack/task.py @@ -2,13 +2,13 @@ from __future__ import annotations import traceback from typing import ( + TYPE_CHECKING, Any, Awaitable, Coroutine, Dict, Generator, List, - Literal, Optional, Sequence, Tuple, @@ -25,6 +25,9 @@ from slack.log import print_error from slack.shared import shared from slack.util import get_callback_name +if TYPE_CHECKING: + from typing_extensions import Literal + T = TypeVar("T") diff --git a/typings/slack_api/slack_bots_info.pyi b/typings/slack_api/slack_bots_info.pyi index 966d097..3204649 100644 --- a/typings/slack_api/slack_bots_info.pyi +++ b/typings/slack_api/slack_bots_info.pyi @@ -1,7 +1,7 @@ -from typing import Dict, List, Literal, TypedDict, final +from typing import Dict, List from slack_api.slack_error import SlackErrorResponse -from typing_extensions import NotRequired +from typing_extensions import Literal, NotRequired, TypedDict, final class SlackBotInfo(TypedDict): id: str diff --git a/typings/slack_api/slack_conversations_history.pyi b/typings/slack_api/slack_conversations_history.pyi index c50c038..9a12214 100644 --- a/typings/slack_api/slack_conversations_history.pyi +++ b/typings/slack_api/slack_conversations_history.pyi @@ -1,9 +1,9 @@ from __future__ import annotations -from typing import Dict, List, Literal, TypedDict, final +from typing import Dict, List from slack_api.slack_error import SlackErrorResponse -from typing_extensions import NotRequired +from typing_extensions import Literal, NotRequired, TypedDict, final @final class SlackMessageBlockElement(TypedDict): diff --git a/typings/slack_api/slack_conversations_info.pyi b/typings/slack_api/slack_conversations_info.pyi index 0c0a74c..9dc721b 100644 --- a/typings/slack_api/slack_conversations_info.pyi +++ b/typings/slack_api/slack_conversations_info.pyi @@ -1,9 +1,10 @@ from __future__ import annotations -from typing import Generic, List, Literal, TypedDict, TypeVar, final +from typing import Generic, List from slack_api.slack_conversations_history import SlackMessage from slack_api.slack_error import SlackErrorResponse +from typing_extensions import Literal, TypedDict, TypeVar, final T = TypeVar("T") diff --git a/typings/slack_api/slack_error.pyi b/typings/slack_api/slack_error.pyi index 0c84bfc..9e8791d 100644 --- a/typings/slack_api/slack_error.pyi +++ b/typings/slack_api/slack_error.pyi @@ -1,4 +1,4 @@ -from typing import Literal, TypedDict, final +from typing_extensions import Literal, TypedDict, final @final class SlackErrorResponse(TypedDict): diff --git a/typings/slack_api/slack_rtm_connect.pyi b/typings/slack_api/slack_rtm_connect.pyi index 63e23b4..34d20b9 100644 --- a/typings/slack_api/slack_rtm_connect.pyi +++ b/typings/slack_api/slack_rtm_connect.pyi @@ -1,9 +1,7 @@ from __future__ import annotations -from typing import Literal, TypedDict, final - from slack_api.slack_error import SlackErrorResponse -from typing_extensions import NotRequired +from typing_extensions import Literal, NotRequired, TypedDict, final @final class SlackRtmConnectTeam(TypedDict): diff --git a/typings/slack_api/slack_users_conversations.pyi b/typings/slack_api/slack_users_conversations.pyi index 5bfbe62..6c02bca 100644 --- a/typings/slack_api/slack_users_conversations.pyi +++ b/typings/slack_api/slack_users_conversations.pyi @@ -1,8 +1,9 @@ from __future__ import annotations -from typing import Generic, List, Literal, TypedDict, TypeVar, final +from typing import Generic, List from slack_api.slack_error import SlackErrorResponse +from typing_extensions import Literal, TypedDict, TypeVar, final T = TypeVar("T") diff --git a/typings/slack_api/slack_users_info.pyi b/typings/slack_api/slack_users_info.pyi index 20ba3d1..666c11f 100644 --- a/typings/slack_api/slack_users_info.pyi +++ b/typings/slack_api/slack_users_info.pyi @@ -1,9 +1,9 @@ from __future__ import annotations -from typing import Dict, Generic, List, Literal, Optional, TypedDict, TypeVar, final +from typing import Dict, Generic, List, Optional from slack_api.slack_error import SlackErrorResponse -from typing_extensions import NotRequired +from typing_extensions import Literal, NotRequired, TypedDict, TypeVar, final T = TypeVar("T") diff --git a/typings/slack_edgeapi/slack_users_search.pyi b/typings/slack_edgeapi/slack_users_search.pyi index 47a9f38..42f79b0 100644 --- a/typings/slack_edgeapi/slack_users_search.pyi +++ b/typings/slack_edgeapi/slack_users_search.pyi @@ -1,7 +1,8 @@ -from typing import List, Literal, TypedDict +from typing import List from slack_api.slack_error import SlackErrorResponse from slack_api.slack_users_info import SlackUserInfo +from typing_extensions import Literal, TypedDict class SlackUsersSearchSuccessResponse(TypedDict): ok: Literal[True] |