Skip to content

Commit

Permalink
[Feat] Add __future__.annotations to help TYPE_CHECKING
Browse files Browse the repository at this point in the history
  • Loading branch information
gunyu1019 committed Feb 28, 2024
1 parent fb00547 commit 2d70c5d
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 7 deletions.
11 changes: 7 additions & 4 deletions chzzkpy/chat/chat_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,27 @@
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
"""
from __future__ import annotations

import asyncio
import logging
from typing import Any, Optional, Callable, Coroutine
from typing import Any, Optional, Callable, Coroutine, TYPE_CHECKING

import aiohttp

from .access_token import AccessToken
from .enums import ChatCmd
from .gateway import ChzzkWebSocket, ReconnectWebsocket
from .http import ChzzkChatSession
from .message import ChatMessage
from .recent_chat import RecentChat
from .state import ConnectionState
from ..client import Client
from ..error import LoginRequired
from ..http import ChzzkAPISession

if TYPE_CHECKING:
from .access_token import AccessToken
from .message import ChatMessage
from .recent_chat import RecentChat

_log = logging.getLogger(__name__)


Expand Down
1 change: 0 additions & 1 deletion chzzkpy/chat/connected.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
"""

from typing import Literal, Optional

from pydantic import Field

from ..base_model import ChzzkModel
Expand Down
1 change: 1 addition & 0 deletions chzzkpy/chat/gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
"""
from __future__ import annotations

import asyncio
import json
Expand Down
1 change: 0 additions & 1 deletion chzzkpy/chat/profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
"""

from typing import Any, Optional

from pydantic import computed_field, Field, PrivateAttr

from .enums import UserRole
Expand Down
3 changes: 2 additions & 1 deletion chzzkpy/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,17 @@
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
"""
from __future__ import annotations

import asyncio

from typing import Optional, TYPE_CHECKING
from types import TracebackType
from .http import ChzzkAPISession, NaverGameAPISession
from .live import LiveStatus, LiveDetail
from .user import User

if TYPE_CHECKING:
from types import TracebackType
from typing_extensions import Self


Expand Down

0 comments on commit 2d70c5d

Please sign in to comment.