diff --git a/mcproto/packets/handshaking/handshake.py b/mcproto/packets/handshaking/handshake.py index c56242c3..fe3b5510 100644 --- a/mcproto/packets/handshaking/handshake.py +++ b/mcproto/packets/handshaking/handshake.py @@ -8,7 +8,7 @@ from mcproto.buffer import Buffer from mcproto.packets.packet import GameState, ServerBoundPacket from mcproto.protocol.base_io import StructFormat -from mcproto.utils.abc import define +from attrs import define __all__ = [ "NextState", diff --git a/mcproto/packets/login/login.py b/mcproto/packets/login/login.py index 2b677f92..367d334d 100644 --- a/mcproto/packets/login/login.py +++ b/mcproto/packets/login/login.py @@ -11,7 +11,7 @@ from mcproto.packets.packet import ClientBoundPacket, GameState, ServerBoundPacket from mcproto.types.chat import ChatMessage from mcproto.types.uuid import UUID -from mcproto.utils.abc import define +from attrs import define __all__ = [ "LoginDisconnect", diff --git a/mcproto/packets/status/ping.py b/mcproto/packets/status/ping.py index 6b31ec9b..6816e3fc 100644 --- a/mcproto/packets/status/ping.py +++ b/mcproto/packets/status/ping.py @@ -7,7 +7,7 @@ from mcproto.buffer import Buffer from mcproto.packets.packet import ClientBoundPacket, GameState, ServerBoundPacket from mcproto.protocol.base_io import StructFormat -from mcproto.utils.abc import define +from attrs import define __all__ = ["PingPong"] diff --git a/mcproto/packets/status/status.py b/mcproto/packets/status/status.py index c5bc16ce..63cf7cad 100644 --- a/mcproto/packets/status/status.py +++ b/mcproto/packets/status/status.py @@ -7,7 +7,7 @@ from mcproto.buffer import Buffer from mcproto.packets.packet import ClientBoundPacket, GameState, ServerBoundPacket -from mcproto.utils.abc import define +from attrs import define __all__ = ["StatusRequest", "StatusResponse"] diff --git a/mcproto/types/abc.py b/mcproto/types/abc.py index 6fbcdf34..5019381b 100644 --- a/mcproto/types/abc.py +++ b/mcproto/types/abc.py @@ -1,8 +1,9 @@ from __future__ import annotations -from mcproto.utils.abc import Serializable, define +from mcproto.utils.abc import Serializable -__all__ = ["MCType", "define"] # That way we can import it from mcproto.types.abc + +__all__ = ["MCType"] class MCType(Serializable): diff --git a/mcproto/types/chat.py b/mcproto/types/chat.py index 542b6b65..cdd23783 100644 --- a/mcproto/types/chat.py +++ b/mcproto/types/chat.py @@ -6,7 +6,9 @@ from typing_extensions import Self, TypeAlias, override from mcproto.buffer import Buffer -from mcproto.types.abc import MCType, define +from mcproto.types.abc import MCType +from attrs import define + __all__ = [ "ChatMessage", diff --git a/mcproto/types/nbt.py b/mcproto/types/nbt.py index 999d19e2..0a6e23ca 100644 --- a/mcproto/types/nbt.py +++ b/mcproto/types/nbt.py @@ -9,7 +9,9 @@ from mcproto.buffer import Buffer from mcproto.protocol.base_io import StructFormat, INT_FORMATS_TYPE, FLOAT_FORMATS_TYPE -from mcproto.types.abc import MCType, define +from mcproto.types.abc import MCType +from attrs import define + from mcproto.utils.abc import RequiredParamsABCMixin __all__ = [ diff --git a/mcproto/utils/abc.py b/mcproto/utils/abc.py index bbe78a85..7dc6d3ed 100644 --- a/mcproto/utils/abc.py +++ b/mcproto/utils/abc.py @@ -2,7 +2,6 @@ from abc import ABC, abstractmethod from collections.abc import Sequence -from attrs import define from typing import Any, ClassVar from typing_extensions import Self @@ -10,7 +9,7 @@ from mcproto.buffer import Buffer -__all__ = ["RequiredParamsABCMixin", "Serializable", "define"] +__all__ = ["RequiredParamsABCMixin", "Serializable"] class RequiredParamsABCMixin: diff --git a/tests/mcproto/utils/test_serializable.py b/tests/mcproto/utils/test_serializable.py index 62381808..5f1537c7 100644 --- a/tests/mcproto/utils/test_serializable.py +++ b/tests/mcproto/utils/test_serializable.py @@ -4,7 +4,9 @@ from typing_extensions import override from mcproto.buffer import Buffer -from mcproto.utils.abc import Serializable, define +from mcproto.utils.abc import Serializable +from attrs import define + from tests.helpers import gen_serializable_test, TestExc