diff --git a/.flake8 b/.flake8 index fb282454b0..c831b30443 100644 --- a/.flake8 +++ b/.flake8 @@ -24,9 +24,9 @@ ignore = per-file-ignores = hikari/__init__.py: F401,F403 hikari/events/__init__.py: F401,F403 - hikari/utilities/routes.py: FS003 - hikari/utilities/time.py: FS003 hikari/impl/stateless_cache.py: R102 + hikari/internal/routes.py: FS003 + hikari/internal/time.py: FS003 tests/hikari/*: FS003,S106,D106,D104,D103,D101,D100 max-complexity = 20 diff --git a/hikari/api/chunker.py b/hikari/api/chunker.py index c380a5c404..6bf999c9d4 100644 --- a/hikari/api/chunker.py +++ b/hikari/api/chunker.py @@ -33,12 +33,12 @@ if typing.TYPE_CHECKING: import datetime + from hikari import event_stream from hikari import guilds from hikari import snowflakes from hikari import users as users_ from hikari.api import shard as gateway_shard from hikari.events import shard_events - from hikari.utilities import event_stream class RequestInformation(typing.Protocol): diff --git a/hikari/api/entity_factory.py b/hikari/api/entity_factory.py index 1af4b2dfcd..def4ee1294 100644 --- a/hikari/api/entity_factory.py +++ b/hikari/api/entity_factory.py @@ -30,7 +30,7 @@ import attr from hikari import undefined -from hikari.utilities import attr_extensions +from hikari.internal import attr_extensions if typing.TYPE_CHECKING: from hikari import applications as application_models @@ -48,7 +48,7 @@ from hikari import users as user_models from hikari import voices as voice_models from hikari import webhooks as webhook_models - from hikari.utilities import data_binding + from hikari.internal import data_binding @attr_extensions.with_copy diff --git a/hikari/api/event_dispatcher.py b/hikari/api/event_dispatcher.py index 2c5666851e..2ec7c62c0b 100644 --- a/hikari/api/event_dispatcher.py +++ b/hikari/api/event_dispatcher.py @@ -29,8 +29,8 @@ import typing if typing.TYPE_CHECKING: + from hikari import event_stream from hikari.events import base_events - from hikari.utilities import event_stream EventT_co = typing.TypeVar("EventT_co", bound=base_events.Event, covariant=True) EventT_inv = typing.TypeVar("EventT_inv", bound=base_events.Event) diff --git a/hikari/api/event_factory.py b/hikari/api/event_factory.py index 4f77cdcb73..dbc2dc2b88 100644 --- a/hikari/api/event_factory.py +++ b/hikari/api/event_factory.py @@ -39,7 +39,7 @@ from hikari.events import typing_events from hikari.events import user_events from hikari.events import voice_events - from hikari.utilities import data_binding + from hikari.internal import data_binding class EventFactory(typing.Protocol): diff --git a/hikari/api/rest.py b/hikari/api/rest.py index 1304321bcc..949a2ff2d6 100644 --- a/hikari/api/rest.py +++ b/hikari/api/rest.py @@ -52,7 +52,7 @@ from hikari import voices from hikari import webhooks from hikari.api import special_endpoints - from hikari.utilities import time + from hikari.internal import time class ConnectorFactory(abc.ABC): diff --git a/hikari/api/shard.py b/hikari/api/shard.py index f5a7d835b3..1906a9fbeb 100644 --- a/hikari/api/shard.py +++ b/hikari/api/shard.py @@ -28,7 +28,7 @@ import typing from hikari import undefined -from hikari.utilities import enums +from hikari.internal import enums if typing.TYPE_CHECKING: import datetime diff --git a/hikari/api/special_endpoints.py b/hikari/api/special_endpoints.py index c6de1a68c8..382bb81727 100644 --- a/hikari/api/special_endpoints.py +++ b/hikari/api/special_endpoints.py @@ -41,7 +41,7 @@ from hikari import permissions as permissions_ from hikari import snowflakes from hikari import voices - from hikari.utilities import time + from hikari.internal import time class TypingIndicator(abc.ABC): diff --git a/hikari/applications.py b/hikari/applications.py index 52bafce749..6716c36453 100644 --- a/hikari/applications.py +++ b/hikari/applications.py @@ -42,9 +42,9 @@ from hikari import guilds from hikari import snowflakes from hikari import urls -from hikari.utilities import attr_extensions -from hikari.utilities import enums -from hikari.utilities import routes +from hikari.internal import attr_extensions +from hikari.internal import enums +from hikari.internal import routes if typing.TYPE_CHECKING: from hikari import permissions as permissions_ diff --git a/hikari/audit_logs.py b/hikari/audit_logs.py index 8d517d4264..59abff09a9 100644 --- a/hikari/audit_logs.py +++ b/hikari/audit_logs.py @@ -47,9 +47,9 @@ import attr from hikari import snowflakes -from hikari.utilities import attr_extensions -from hikari.utilities import collections -from hikari.utilities import enums +from hikari.internal import attr_extensions +from hikari.internal import collections +from hikari.internal import enums if typing.TYPE_CHECKING: from hikari import channels diff --git a/hikari/channels.py b/hikari/channels.py index 38b15c6dce..6dc3ddba78 100644 --- a/hikari/channels.py +++ b/hikari/channels.py @@ -52,9 +52,9 @@ from hikari import undefined from hikari import urls from hikari import users -from hikari.utilities import attr_extensions -from hikari.utilities import enums -from hikari.utilities import routes +from hikari.internal import attr_extensions +from hikari.internal import enums +from hikari.internal import routes if typing.TYPE_CHECKING: import datetime diff --git a/hikari/config.py b/hikari/config.py index 5d7323baf2..180afd89a1 100644 --- a/hikari/config.py +++ b/hikari/config.py @@ -37,8 +37,8 @@ import attr import yarl -from hikari.utilities import attr_extensions -from hikari.utilities import data_binding +from hikari.internal import attr_extensions +from hikari.internal import data_binding _BASICAUTH_TOKEN_PREFIX: typing.Final[str] = "Basic" # nosec _PROXY_AUTHENTICATION_HEADER: typing.Final[str] = "Proxy-Authentication" diff --git a/hikari/embeds.py b/hikari/embeds.py index f3955f1649..88a4b70fd1 100644 --- a/hikari/embeds.py +++ b/hikari/embeds.py @@ -46,7 +46,7 @@ from hikari import errors from hikari import files from hikari import undefined -from hikari.utilities import attr_extensions +from hikari.internal import attr_extensions if typing.TYPE_CHECKING: import concurrent.futures diff --git a/hikari/emojis.py b/hikari/emojis.py index 50662ea17c..10cab458e1 100644 --- a/hikari/emojis.py +++ b/hikari/emojis.py @@ -34,8 +34,8 @@ from hikari import files from hikari import snowflakes from hikari import urls -from hikari.utilities import attr_extensions -from hikari.utilities import routes +from hikari.internal import attr_extensions +from hikari.internal import routes if typing.TYPE_CHECKING: from hikari import traits diff --git a/hikari/errors.py b/hikari/errors.py index 647ef39c22..affdd8f77d 100644 --- a/hikari/errors.py +++ b/hikari/errors.py @@ -53,15 +53,15 @@ import attr -from hikari.utilities import attr_extensions -from hikari.utilities import enums +from hikari.internal import attr_extensions +from hikari.internal import enums if typing.TYPE_CHECKING: from hikari import intents as intents_ from hikari import messages from hikari import snowflakes - from hikari.utilities import data_binding - from hikari.utilities import routes + from hikari.internal import data_binding + from hikari.internal import routes @attr_extensions.with_copy diff --git a/hikari/utilities/event_stream.py b/hikari/event_stream.py similarity index 100% rename from hikari/utilities/event_stream.py rename to hikari/event_stream.py diff --git a/hikari/events/base_events.py b/hikari/events/base_events.py index 54613e484d..c093529db8 100644 --- a/hikari/events/base_events.py +++ b/hikari/events/base_events.py @@ -40,7 +40,7 @@ from hikari import intents from hikari import traits from hikari.api import shard as gateway_shard -from hikari.utilities import attr_extensions +from hikari.internal import attr_extensions if typing.TYPE_CHECKING: import types diff --git a/hikari/events/channel_events.py b/hikari/events/channel_events.py index 6d699cfc07..7f78bbc596 100644 --- a/hikari/events/channel_events.py +++ b/hikari/events/channel_events.py @@ -54,7 +54,7 @@ from hikari import traits from hikari.events import base_events from hikari.events import shard_events -from hikari.utilities import attr_extensions +from hikari.internal import attr_extensions if typing.TYPE_CHECKING: import datetime diff --git a/hikari/events/guild_events.py b/hikari/events/guild_events.py index 86ac55eb3a..4523af3939 100644 --- a/hikari/events/guild_events.py +++ b/hikari/events/guild_events.py @@ -46,7 +46,7 @@ from hikari import intents from hikari.events import base_events from hikari.events import shard_events -from hikari.utilities import attr_extensions +from hikari.internal import attr_extensions if typing.TYPE_CHECKING: from hikari import channels as channels_ diff --git a/hikari/events/lifetime_events.py b/hikari/events/lifetime_events.py index 6db51e28c4..42c6d9c32e 100644 --- a/hikari/events/lifetime_events.py +++ b/hikari/events/lifetime_events.py @@ -34,7 +34,7 @@ import attr from hikari.events import base_events -from hikari.utilities import attr_extensions +from hikari.internal import attr_extensions if typing.TYPE_CHECKING: from hikari import traits diff --git a/hikari/events/member_events.py b/hikari/events/member_events.py index 7087c475e2..1c15a20c4b 100644 --- a/hikari/events/member_events.py +++ b/hikari/events/member_events.py @@ -38,7 +38,7 @@ from hikari import traits from hikari.events import base_events from hikari.events import shard_events -from hikari.utilities import attr_extensions +from hikari.internal import attr_extensions if typing.TYPE_CHECKING: from hikari import guilds diff --git a/hikari/events/message_events.py b/hikari/events/message_events.py index d0b1498aef..30e15ce6b6 100644 --- a/hikari/events/message_events.py +++ b/hikari/events/message_events.py @@ -48,7 +48,7 @@ from hikari import users from hikari.events import base_events from hikari.events import shard_events -from hikari.utilities import attr_extensions +from hikari.internal import attr_extensions if typing.TYPE_CHECKING: from hikari import embeds as embeds_ diff --git a/hikari/events/reaction_events.py b/hikari/events/reaction_events.py index 123ba8106a..68effb9261 100644 --- a/hikari/events/reaction_events.py +++ b/hikari/events/reaction_events.py @@ -49,7 +49,7 @@ from hikari import intents from hikari.events import base_events from hikari.events import shard_events -from hikari.utilities import attr_extensions +from hikari.internal import attr_extensions if typing.TYPE_CHECKING: from hikari import emojis diff --git a/hikari/events/role_events.py b/hikari/events/role_events.py index 1903e1a3c1..4ec8852e36 100644 --- a/hikari/events/role_events.py +++ b/hikari/events/role_events.py @@ -37,7 +37,7 @@ from hikari import intents from hikari.events import base_events from hikari.events import shard_events -from hikari.utilities import attr_extensions +from hikari.internal import attr_extensions if typing.TYPE_CHECKING: from hikari import guilds diff --git a/hikari/events/shard_events.py b/hikari/events/shard_events.py index bb61992321..28d1231cd3 100644 --- a/hikari/events/shard_events.py +++ b/hikari/events/shard_events.py @@ -39,8 +39,8 @@ import attr from hikari.events import base_events -from hikari.utilities import attr_extensions -from hikari.utilities import collections +from hikari.internal import attr_extensions +from hikari.internal import collections if typing.TYPE_CHECKING: from hikari import guilds diff --git a/hikari/events/typing_events.py b/hikari/events/typing_events.py index ac392baa46..da2d238133 100644 --- a/hikari/events/typing_events.py +++ b/hikari/events/typing_events.py @@ -39,7 +39,7 @@ from hikari.api import special_endpoints from hikari.events import base_events from hikari.events import shard_events -from hikari.utilities import attr_extensions +from hikari.internal import attr_extensions if typing.TYPE_CHECKING: import datetime diff --git a/hikari/events/user_events.py b/hikari/events/user_events.py index 64c86cc439..749fbaab57 100644 --- a/hikari/events/user_events.py +++ b/hikari/events/user_events.py @@ -29,7 +29,7 @@ import attr from hikari.events import shard_events -from hikari.utilities import attr_extensions +from hikari.internal import attr_extensions if typing.TYPE_CHECKING: from hikari import traits diff --git a/hikari/events/voice_events.py b/hikari/events/voice_events.py index 856bd1e00f..4ba0c940d6 100644 --- a/hikari/events/voice_events.py +++ b/hikari/events/voice_events.py @@ -37,7 +37,7 @@ from hikari import intents from hikari.events import base_events from hikari.events import shard_events -from hikari.utilities import attr_extensions +from hikari.internal import attr_extensions if typing.TYPE_CHECKING: from hikari import snowflakes diff --git a/hikari/files.py b/hikari/files.py index f30e0896d5..c2cde9393a 100644 --- a/hikari/files.py +++ b/hikari/files.py @@ -59,9 +59,9 @@ import aiohttp.client import attr -from hikari.utilities import aio -from hikari.utilities import net -from hikari.utilities import time +from hikari.internal import aio +from hikari.internal import net +from hikari.internal import time if typing.TYPE_CHECKING: import types diff --git a/hikari/guilds.py b/hikari/guilds.py index 371dbacb6d..665973312e 100644 --- a/hikari/guilds.py +++ b/hikari/guilds.py @@ -58,10 +58,10 @@ from hikari import snowflakes from hikari import urls from hikari import users -from hikari.utilities import attr_extensions -from hikari.utilities import enums -from hikari.utilities import flag -from hikari.utilities import routes +from hikari.internal import attr_extensions +from hikari.internal import enums +from hikari.internal import flag +from hikari.internal import routes if typing.TYPE_CHECKING: import datetime diff --git a/hikari/impl/bot.py b/hikari/impl/bot.py index 6bd8320630..122a622544 100644 --- a/hikari/impl/bot.py +++ b/hikari/impl/bot.py @@ -41,6 +41,7 @@ from hikari import config from hikari import errors +from hikari import event_stream from hikari import intents as intents_ from hikari import presences from hikari import traits @@ -59,10 +60,9 @@ from hikari.impl import rest as rest_impl from hikari.impl import shard as shard_impl from hikari.impl import voice as voice_impl -from hikari.utilities import aio -from hikari.utilities import event_stream -from hikari.utilities import time -from hikari.utilities import ux +from hikari.internal import aio +from hikari.internal import time +from hikari.internal import ux if typing.TYPE_CHECKING: from hikari.api import cache diff --git a/hikari/impl/buckets.py b/hikari/impl/buckets.py index 329f6d7404..6da9e3cd5a 100644 --- a/hikari/impl/buckets.py +++ b/hikari/impl/buckets.py @@ -210,10 +210,10 @@ import typing from hikari.impl import rate_limits -from hikari.utilities import aio -from hikari.utilities import routes -from hikari.utilities import time -from hikari.utilities import ux +from hikari.internal import aio +from hikari.internal import routes +from hikari.internal import time +from hikari.internal import ux if typing.TYPE_CHECKING: import types diff --git a/hikari/impl/entity_factory.py b/hikari/impl/entity_factory.py index e4fe4c236d..04a1b79db9 100644 --- a/hikari/impl/entity_factory.py +++ b/hikari/impl/entity_factory.py @@ -50,9 +50,9 @@ from hikari import voices as voice_models from hikari import webhooks as webhook_models from hikari.api import entity_factory -from hikari.utilities import attr_extensions -from hikari.utilities import data_binding -from hikari.utilities import time +from hikari.internal import attr_extensions +from hikari.internal import data_binding +from hikari.internal import time _DEFAULT_MAX_PRESENCES: typing.Final[int] = 25000 diff --git a/hikari/impl/event_factory.py b/hikari/impl/event_factory.py index 87924816c2..e4d7f1c092 100644 --- a/hikari/impl/event_factory.py +++ b/hikari/impl/event_factory.py @@ -45,9 +45,9 @@ from hikari.events import typing_events from hikari.events import user_events from hikari.events import voice_events -from hikari.utilities import collections -from hikari.utilities import data_binding -from hikari.utilities import time +from hikari.internal import collections +from hikari.internal import data_binding +from hikari.internal import time class EventFactoryImpl(event_factory.EventFactory): diff --git a/hikari/impl/event_manager_base.py b/hikari/impl/event_manager_base.py index 5a215280ca..48695816df 100644 --- a/hikari/impl/event_manager_base.py +++ b/hikari/impl/event_manager_base.py @@ -32,14 +32,14 @@ import warnings from hikari import errors +from hikari import event_stream from hikari import intents as intents_ from hikari import traits from hikari.api import event_dispatcher from hikari.events import base_events -from hikari.utilities import aio -from hikari.utilities import data_binding -from hikari.utilities import event_stream -from hikari.utilities import reflect +from hikari.internal import aio +from hikari.internal import data_binding +from hikari.internal import reflect if typing.TYPE_CHECKING: from hikari.api import shard as gateway_shard diff --git a/hikari/impl/rate_limits.py b/hikari/impl/rate_limits.py index a9e83047d6..c191e6425d 100644 --- a/hikari/impl/rate_limits.py +++ b/hikari/impl/rate_limits.py @@ -41,7 +41,7 @@ import random import typing -from hikari.utilities import time +from hikari.internal import time if typing.TYPE_CHECKING: import types diff --git a/hikari/impl/rest.py b/hikari/impl/rest.py index 620bd07344..e021d73fa3 100644 --- a/hikari/impl/rest.py +++ b/hikari/impl/rest.py @@ -70,11 +70,11 @@ from hikari.impl import rate_limits from hikari.impl import special_endpoints from hikari.impl import stateless_cache -from hikari.utilities import data_binding -from hikari.utilities import net -from hikari.utilities import routes -from hikari.utilities import time -from hikari.utilities import ux +from hikari.internal import data_binding +from hikari.internal import net +from hikari.internal import routes +from hikari.internal import time +from hikari.internal import ux if typing.TYPE_CHECKING: import concurrent.futures diff --git a/hikari/impl/shard.py b/hikari/impl/shard.py index 926953b7b0..50b6501dac 100644 --- a/hikari/impl/shard.py +++ b/hikari/impl/shard.py @@ -45,10 +45,10 @@ from hikari import undefined from hikari.api import shard from hikari.impl import rate_limits -from hikari.utilities import data_binding -from hikari.utilities import net -from hikari.utilities import time -from hikari.utilities import ux +from hikari.internal import data_binding +from hikari.internal import net +from hikari.internal import time +from hikari.internal import ux if typing.TYPE_CHECKING: import datetime diff --git a/hikari/impl/special_endpoints.py b/hikari/impl/special_endpoints.py index 67bd12ed32..faa96541ea 100644 --- a/hikari/impl/special_endpoints.py +++ b/hikari/impl/special_endpoints.py @@ -41,10 +41,10 @@ from hikari import snowflakes from hikari import undefined from hikari.api import special_endpoints -from hikari.utilities import attr_extensions -from hikari.utilities import data_binding -from hikari.utilities import routes -from hikari.utilities import time +from hikari.internal import attr_extensions +from hikari.internal import data_binding +from hikari.internal import routes +from hikari.internal import time if typing.TYPE_CHECKING: import concurrent.futures diff --git a/hikari/impl/stateful_cache.py b/hikari/impl/stateful_cache.py index 25fd7f63f4..779d7a9c82 100644 --- a/hikari/impl/stateful_cache.py +++ b/hikari/impl/stateful_cache.py @@ -41,8 +41,8 @@ from hikari import users from hikari import voices from hikari.api import cache -from hikari.utilities import cache as cache_utility -from hikari.utilities import collections +from hikari.internal import cache as cache_utility +from hikari.internal import collections if typing.TYPE_CHECKING: from hikari import traits diff --git a/hikari/impl/stateful_event_manager.py b/hikari/impl/stateful_event_manager.py index c22b48106f..fffd100e9f 100644 --- a/hikari/impl/stateful_event_manager.py +++ b/hikari/impl/stateful_event_manager.py @@ -39,7 +39,7 @@ from hikari.api import cache as cache_ from hikari.api import shard as gateway_shard from hikari.events import guild_events as guild_events - from hikari.utilities import data_binding + from hikari.internal import data_binding class StatefulEventManagerImpl(event_manager_base.EventManagerBase): diff --git a/hikari/impl/stateful_guild_chunker.py b/hikari/impl/stateful_guild_chunker.py index 9859ba60ea..ff5362496a 100644 --- a/hikari/impl/stateful_guild_chunker.py +++ b/hikari/impl/stateful_guild_chunker.py @@ -33,15 +33,15 @@ import attr +from hikari import event_stream from hikari import intents as intents_ from hikari import snowflakes from hikari import undefined from hikari.api import chunker from hikari.events import shard_events -from hikari.utilities import attr_extensions -from hikari.utilities import collections -from hikari.utilities import event_stream -from hikari.utilities import time +from hikari.internal import attr_extensions +from hikari.internal import collections +from hikari.internal import time if typing.TYPE_CHECKING: import datetime diff --git a/hikari/impl/stateless_cache.py b/hikari/impl/stateless_cache.py index 3f9bf583e5..32894d109a 100644 --- a/hikari/impl/stateless_cache.py +++ b/hikari/impl/stateless_cache.py @@ -31,7 +31,7 @@ import typing from hikari.api import cache -from hikari.utilities import cache as cache_utilities +from hikari.internal import cache as cache_utilities if typing.TYPE_CHECKING: from hikari import channels diff --git a/hikari/impl/stateless_event_manager.py b/hikari/impl/stateless_event_manager.py index 07868214e9..ac24ad8f34 100644 --- a/hikari/impl/stateless_event_manager.py +++ b/hikari/impl/stateless_event_manager.py @@ -34,7 +34,7 @@ if typing.TYPE_CHECKING: from hikari.api import shard as gateway_shard - from hikari.utilities import data_binding + from hikari.internal import data_binding _LOGGER: typing.Final[logging.Logger] = logging.getLogger("hikari") diff --git a/hikari/impl/stateless_guild_chunker.py b/hikari/impl/stateless_guild_chunker.py index e498c8454d..47ef55233e 100644 --- a/hikari/impl/stateless_guild_chunker.py +++ b/hikari/impl/stateless_guild_chunker.py @@ -27,9 +27,9 @@ import typing +from hikari import event_stream from hikari import undefined from hikari.api import chunker -from hikari.utilities import event_stream if typing.TYPE_CHECKING: from hikari import guilds diff --git a/hikari/impl/voice.py b/hikari/impl/voice.py index 35fbfbb238..d40977eb70 100644 --- a/hikari/impl/voice.py +++ b/hikari/impl/voice.py @@ -37,7 +37,7 @@ from hikari.api import voice from hikari.events import voice_events from hikari.impl import bot -from hikari.utilities import ux +from hikari.internal import ux if typing.TYPE_CHECKING: _VoiceEventCallbackT = typing.Callable[[voice_events.VoiceEvent], typing.Coroutine[None, typing.Any, None]] diff --git a/hikari/intents.py b/hikari/intents.py index ab7486b071..9b6f849064 100644 --- a/hikari/intents.py +++ b/hikari/intents.py @@ -27,7 +27,7 @@ import typing -from hikari.utilities import flag +from hikari.internal import flag @typing.final diff --git a/hikari/utilities/__init__.py b/hikari/internal/__init__.py similarity index 100% rename from hikari/utilities/__init__.py rename to hikari/internal/__init__.py diff --git a/hikari/utilities/aio.py b/hikari/internal/aio.py similarity index 100% rename from hikari/utilities/aio.py rename to hikari/internal/aio.py diff --git a/hikari/utilities/attr_extensions.py b/hikari/internal/attr_extensions.py similarity index 99% rename from hikari/utilities/attr_extensions.py rename to hikari/internal/attr_extensions.py index 64c7f392d6..d01e3ec91b 100644 --- a/hikari/utilities/attr_extensions.py +++ b/hikari/internal/attr_extensions.py @@ -36,7 +36,7 @@ import attr -from hikari.utilities import ux +from hikari.internal import ux ModelT = typing.TypeVar("ModelT") SKIP_DEEP_COPY: typing.Final[str] = "skip_deep_copy" diff --git a/hikari/utilities/cache.py b/hikari/internal/cache.py similarity index 99% rename from hikari/utilities/cache.py rename to hikari/internal/cache.py index 65917d4129..dd6bac29ae 100644 --- a/hikari/utilities/cache.py +++ b/hikari/internal/cache.py @@ -59,8 +59,8 @@ from hikari import undefined from hikari import voices from hikari.api import cache -from hikari.utilities import attr_extensions -from hikari.utilities import collections +from hikari.internal import attr_extensions +from hikari.internal import collections DataT = typing.TypeVar("DataT", bound="BaseData[typing.Any]") """Type-hint for "data" objects used for storing and building entities.""" diff --git a/hikari/utilities/collections.py b/hikari/internal/collections.py similarity index 100% rename from hikari/utilities/collections.py rename to hikari/internal/collections.py diff --git a/hikari/utilities/data_binding.py b/hikari/internal/data_binding.py similarity index 100% rename from hikari/utilities/data_binding.py rename to hikari/internal/data_binding.py diff --git a/hikari/utilities/enums.py b/hikari/internal/enums.py similarity index 100% rename from hikari/utilities/enums.py rename to hikari/internal/enums.py diff --git a/hikari/utilities/enums.pyi b/hikari/internal/enums.pyi similarity index 100% rename from hikari/utilities/enums.pyi rename to hikari/internal/enums.pyi diff --git a/hikari/utilities/flag.py b/hikari/internal/flag.py similarity index 100% rename from hikari/utilities/flag.py rename to hikari/internal/flag.py diff --git a/hikari/utilities/net.py b/hikari/internal/net.py similarity index 100% rename from hikari/utilities/net.py rename to hikari/internal/net.py diff --git a/hikari/utilities/reflect.py b/hikari/internal/reflect.py similarity index 100% rename from hikari/utilities/reflect.py rename to hikari/internal/reflect.py diff --git a/hikari/utilities/routes.py b/hikari/internal/routes.py similarity index 99% rename from hikari/utilities/routes.py rename to hikari/internal/routes.py index 7590347fb6..145c0c646e 100644 --- a/hikari/utilities/routes.py +++ b/hikari/internal/routes.py @@ -33,8 +33,8 @@ import attr from hikari import files -from hikari.utilities import attr_extensions -from hikari.utilities import data_binding +from hikari.internal import attr_extensions +from hikari.internal import data_binding HASH_SEPARATOR: typing.Final[str] = ";" diff --git a/hikari/utilities/spel.py b/hikari/internal/spel.py similarity index 100% rename from hikari/utilities/spel.py rename to hikari/internal/spel.py diff --git a/hikari/utilities/time.py b/hikari/internal/time.py similarity index 100% rename from hikari/utilities/time.py rename to hikari/internal/time.py diff --git a/hikari/utilities/ux.py b/hikari/internal/ux.py similarity index 99% rename from hikari/utilities/ux.py rename to hikari/internal/ux.py index b0c2a3d9fa..7cf300d606 100644 --- a/hikari/utilities/ux.py +++ b/hikari/internal/ux.py @@ -38,7 +38,7 @@ import colorlog # type: ignore[import] from hikari import _about as about -from hikari.utilities import net +from hikari.internal import net if typing.TYPE_CHECKING: from hikari import config diff --git a/hikari/invites.py b/hikari/invites.py index 9371d0b185..22c9a33dc0 100644 --- a/hikari/invites.py +++ b/hikari/invites.py @@ -41,9 +41,9 @@ from hikari import guilds from hikari import snowflakes from hikari import urls -from hikari.utilities import attr_extensions -from hikari.utilities import enums -from hikari.utilities import routes +from hikari.internal import attr_extensions +from hikari.internal import enums +from hikari.internal import routes if typing.TYPE_CHECKING: import datetime diff --git a/hikari/iterators.py b/hikari/iterators.py index 50c9325433..f61f2a337a 100644 --- a/hikari/iterators.py +++ b/hikari/iterators.py @@ -41,7 +41,7 @@ import asyncio import typing -from hikari.utilities import spel +from hikari.internal import spel ValueT = typing.TypeVar("ValueT") """Type-hint of the type of the value returned by a lazy iterator.""" diff --git a/hikari/messages.py b/hikari/messages.py index 00885c760c..5a635bffa7 100644 --- a/hikari/messages.py +++ b/hikari/messages.py @@ -44,9 +44,9 @@ from hikari import snowflakes from hikari import undefined from hikari import urls -from hikari.utilities import attr_extensions -from hikari.utilities import enums -from hikari.utilities import flag +from hikari.internal import attr_extensions +from hikari.internal import enums +from hikari.internal import flag if typing.TYPE_CHECKING: import datetime diff --git a/hikari/permissions.py b/hikari/permissions.py index cd2430b4e8..111cf82967 100644 --- a/hikari/permissions.py +++ b/hikari/permissions.py @@ -28,7 +28,7 @@ import enum import typing -from hikari.utilities import flag +from hikari.internal import flag @enum.unique diff --git a/hikari/presences.py b/hikari/presences.py index 1b29165b9e..a0f038529b 100644 --- a/hikari/presences.py +++ b/hikari/presences.py @@ -43,9 +43,9 @@ import attr from hikari import snowflakes -from hikari.utilities import attr_extensions -from hikari.utilities import enums -from hikari.utilities import flag +from hikari.internal import attr_extensions +from hikari.internal import enums +from hikari.internal import flag if typing.TYPE_CHECKING: import datetime diff --git a/hikari/sessions.py b/hikari/sessions.py index fa50b5499f..eb4cac49e7 100644 --- a/hikari/sessions.py +++ b/hikari/sessions.py @@ -29,8 +29,8 @@ import attr -from hikari.utilities import attr_extensions -from hikari.utilities import time +from hikari.internal import attr_extensions +from hikari.internal import time if typing.TYPE_CHECKING: import datetime diff --git a/hikari/snowflakes.py b/hikari/snowflakes.py index 28d0022e66..e96bd24523 100644 --- a/hikari/snowflakes.py +++ b/hikari/snowflakes.py @@ -37,7 +37,7 @@ import datetime import typing -from hikari.utilities import time +from hikari.internal import time if typing.TYPE_CHECKING: from hikari import guilds diff --git a/hikari/users.py b/hikari/users.py index eed96b6919..be1cce4ac1 100644 --- a/hikari/users.py +++ b/hikari/users.py @@ -35,10 +35,10 @@ from hikari import snowflakes from hikari import undefined from hikari import urls -from hikari.utilities import attr_extensions -from hikari.utilities import enums -from hikari.utilities import flag -from hikari.utilities import routes +from hikari.internal import attr_extensions +from hikari.internal import enums +from hikari.internal import flag +from hikari.internal import routes if typing.TYPE_CHECKING: from hikari import traits diff --git a/hikari/voices.py b/hikari/voices.py index bc5ece1ba5..fd4e2aec77 100644 --- a/hikari/voices.py +++ b/hikari/voices.py @@ -29,7 +29,7 @@ import attr -from hikari.utilities import attr_extensions +from hikari.internal import attr_extensions if typing.TYPE_CHECKING: from hikari import guilds diff --git a/hikari/webhooks.py b/hikari/webhooks.py index 731d613d3b..1b99b7dd10 100644 --- a/hikari/webhooks.py +++ b/hikari/webhooks.py @@ -33,9 +33,9 @@ from hikari import snowflakes from hikari import undefined from hikari import urls -from hikari.utilities import attr_extensions -from hikari.utilities import enums -from hikari.utilities import routes +from hikari.internal import attr_extensions +from hikari.internal import enums +from hikari.internal import routes if typing.TYPE_CHECKING: from hikari import channels as channels_ diff --git a/mypy.ini b/mypy.ini index 180723662d..31ac9bbc2a 100644 --- a/mypy.ini +++ b/mypy.ini @@ -2,7 +2,7 @@ # general settings strict = true check_untyped_defs = true -incremental = false +incremental = true namespace_packages = true no_implicit_optional = true pretty = true diff --git a/pytest.ini b/pytest.ini index 4077041a8c..0411b3436a 100644 --- a/pytest.ini +++ b/pytest.ini @@ -4,6 +4,3 @@ norecursedirs = docs *.egg-info .git tasks .nox .pytest_cache .venv venv public filterwarnings = ignore:.*"@coroutine" decorator is deprecated.*:DeprecationWarning - -junit_family=legacy -junit_duration_report=call diff --git a/scripts/enum_benchmark.py b/scripts/enum_benchmark.py index ab9cfa2f1b..ef2b6b55dd 100644 --- a/scripts/enum_benchmark.py +++ b/scripts/enum_benchmark.py @@ -23,7 +23,7 @@ import enum as py_enum import timeit -from hikari.utilities import enums as hikari_enum +from hikari.internal import enums as hikari_enum class BasicPyEnum(str, py_enum.Enum): diff --git a/tests/hikari/impl/test_buckets.py b/tests/hikari/impl/test_buckets.py index a7636c0b8f..90b54d2464 100644 --- a/tests/hikari/impl/test_buckets.py +++ b/tests/hikari/impl/test_buckets.py @@ -26,8 +26,8 @@ import pytest from hikari.impl import buckets -from hikari.utilities import routes -from hikari.utilities import time as hikari_date +from hikari.internal import routes +from hikari.internal import time as hikari_date from tests.hikari import hikari_test_helpers diff --git a/tests/hikari/impl/test_rest.py b/tests/hikari/impl/test_rest.py index 4d534f4989..376ca870c6 100644 --- a/tests/hikari/impl/test_rest.py +++ b/tests/hikari/impl/test_rest.py @@ -44,8 +44,8 @@ from hikari.impl import entity_factory from hikari.impl import rest from hikari.impl import special_endpoints -from hikari.utilities import net -from hikari.utilities import routes +from hikari.internal import net +from hikari.internal import routes from tests.hikari import client_session_stub from tests.hikari import hikari_test_helpers diff --git a/tests/hikari/impl/test_shard.py b/tests/hikari/impl/test_shard.py index d69a34a53b..73a6191701 100644 --- a/tests/hikari/impl/test_shard.py +++ b/tests/hikari/impl/test_shard.py @@ -34,8 +34,8 @@ from hikari import presences from hikari import undefined from hikari.impl import shard -from hikari.utilities import aio -from hikari.utilities import time +from hikari.internal import aio +from hikari.internal import time from tests.hikari import client_session_stub from tests.hikari import hikari_test_helpers diff --git a/tests/hikari/impl/test_stateful_cache.py b/tests/hikari/impl/test_stateful_cache.py index 942bd10fa3..14904e2fb5 100644 --- a/tests/hikari/impl/test_stateful_cache.py +++ b/tests/hikari/impl/test_stateful_cache.py @@ -31,8 +31,8 @@ from hikari import users from hikari import voices from hikari.impl import stateful_cache -from hikari.utilities import cache -from hikari.utilities import collections +from hikari.internal import cache +from hikari.internal import collections from tests.hikari import hikari_test_helpers diff --git a/tests/hikari/impl/test_stateful_guild_chunker.py b/tests/hikari/impl/test_stateful_guild_chunker.py index 0c51f9be61..ff176c1a37 100644 --- a/tests/hikari/impl/test_stateful_guild_chunker.py +++ b/tests/hikari/impl/test_stateful_guild_chunker.py @@ -24,6 +24,7 @@ import mock import pytest +from hikari import event_stream from hikari import guilds from hikari import intents from hikari import iterators @@ -33,9 +34,8 @@ from hikari.impl import bot from hikari.impl import shard from hikari.impl import stateful_guild_chunker -from hikari.utilities import attr_extensions -from hikari.utilities import event_stream -from hikari.utilities import time +from hikari.internal import attr_extensions +from hikari.internal import time from tests.hikari import hikari_test_helpers diff --git a/tests/hikari/utilities/__init__.py b/tests/hikari/internal/__init__.py similarity index 100% rename from tests/hikari/utilities/__init__.py rename to tests/hikari/internal/__init__.py diff --git a/tests/hikari/utilities/test_aio.py b/tests/hikari/internal/test_aio.py similarity index 99% rename from tests/hikari/utilities/test_aio.py rename to tests/hikari/internal/test_aio.py index c22afbc818..5b17d2a494 100644 --- a/tests/hikari/utilities/test_aio.py +++ b/tests/hikari/internal/test_aio.py @@ -22,7 +22,7 @@ import pytest -from hikari.utilities import aio +from hikari.internal import aio from tests.hikari import hikari_test_helpers diff --git a/tests/hikari/utilities/test_attr_extensions.py b/tests/hikari/internal/test_attr_extensions.py similarity index 99% rename from tests/hikari/utilities/test_attr_extensions.py rename to tests/hikari/internal/test_attr_extensions.py index e28b47bfa2..f6f540a670 100644 --- a/tests/hikari/utilities/test_attr_extensions.py +++ b/tests/hikari/internal/test_attr_extensions.py @@ -24,7 +24,7 @@ import attr import mock -from hikari.utilities import attr_extensions +from hikari.internal import attr_extensions def test_invalidate_shallow_copy_cache(): diff --git a/tests/hikari/utilities/test_collections.py b/tests/hikari/internal/test_collections.py similarity index 99% rename from tests/hikari/utilities/test_collections.py rename to tests/hikari/internal/test_collections.py index a76c6e8cb6..d44c58e2b2 100644 --- a/tests/hikari/utilities/test_collections.py +++ b/tests/hikari/internal/test_collections.py @@ -27,7 +27,7 @@ import pytest -from hikari.utilities import collections +from hikari.internal import collections from tests.hikari import hikari_test_helpers diff --git a/tests/hikari/utilities/test_data_binding.py b/tests/hikari/internal/test_data_binding.py similarity index 99% rename from tests/hikari/utilities/test_data_binding.py rename to tests/hikari/internal/test_data_binding.py index 2a84f63c84..ba97ba2a67 100644 --- a/tests/hikari/utilities/test_data_binding.py +++ b/tests/hikari/internal/test_data_binding.py @@ -27,7 +27,7 @@ from hikari import snowflakes from hikari import undefined -from hikari.utilities import data_binding +from hikari.internal import data_binding @attr.s(slots=True) diff --git a/tests/hikari/utilities/test_enums.py b/tests/hikari/internal/test_enums.py similarity index 99% rename from tests/hikari/utilities/test_enums.py rename to tests/hikari/internal/test_enums.py index 97828afaa0..94eb77ce7c 100644 --- a/tests/hikari/utilities/test_enums.py +++ b/tests/hikari/internal/test_enums.py @@ -21,7 +21,7 @@ import mock import pytest -from hikari.utilities import enums +from hikari.internal import enums class TestEnum: diff --git a/tests/hikari/utilities/test_flag.py b/tests/hikari/internal/test_flag.py similarity index 99% rename from tests/hikari/utilities/test_flag.py rename to tests/hikari/internal/test_flag.py index fc25d42e0f..c5499c9006 100644 --- a/tests/hikari/utilities/test_flag.py +++ b/tests/hikari/internal/test_flag.py @@ -20,7 +20,7 @@ # SOFTWARE. import pytest -from hikari.utilities import flag +from hikari.internal import flag class TestFlag: diff --git a/tests/hikari/utilities/test_net.py b/tests/hikari/internal/test_net.py similarity index 99% rename from tests/hikari/utilities/test_net.py rename to tests/hikari/internal/test_net.py index 8c2777fdc5..f522950d7f 100644 --- a/tests/hikari/utilities/test_net.py +++ b/tests/hikari/internal/test_net.py @@ -26,7 +26,7 @@ import pytest from hikari import errors -from hikari.utilities import net +from hikari.internal import net @pytest.mark.parametrize( diff --git a/tests/hikari/utilities/test_reflect.py b/tests/hikari/internal/test_reflect.py similarity index 99% rename from tests/hikari/utilities/test_reflect.py rename to tests/hikari/internal/test_reflect.py index 07a15b5d1d..813b607643 100644 --- a/tests/hikari/utilities/test_reflect.py +++ b/tests/hikari/internal/test_reflect.py @@ -20,7 +20,7 @@ # SOFTWARE. import typing -from hikari.utilities import reflect +from hikari.internal import reflect class TestResolveSignature: diff --git a/tests/hikari/utilities/test_routes.py b/tests/hikari/internal/test_routes.py similarity index 99% rename from tests/hikari/utilities/test_routes.py rename to tests/hikari/internal/test_routes.py index e35b085604..c653772c96 100644 --- a/tests/hikari/utilities/test_routes.py +++ b/tests/hikari/internal/test_routes.py @@ -22,7 +22,7 @@ import pytest from hikari import files -from hikari.utilities import routes +from hikari.internal import routes from tests.hikari import hikari_test_helpers diff --git a/tests/hikari/utilities/test_time.py b/tests/hikari/internal/test_time.py similarity index 99% rename from tests/hikari/utilities/test_time.py rename to tests/hikari/internal/test_time.py index 3ecf6c749a..b64bcd05cf 100644 --- a/tests/hikari/utilities/test_time.py +++ b/tests/hikari/internal/test_time.py @@ -23,7 +23,7 @@ import mock import pytest -from hikari.utilities import time +from hikari.internal import time def test_parse_iso_8601_date_with_negative_timezone(): diff --git a/tests/hikari/utilities/test_ux.py b/tests/hikari/internal/test_ux.py similarity index 99% rename from tests/hikari/utilities/test_ux.py rename to tests/hikari/internal/test_ux.py index e6230d13b4..eb34d9a105 100644 --- a/tests/hikari/utilities/test_ux.py +++ b/tests/hikari/internal/test_ux.py @@ -32,8 +32,8 @@ from hikari import _about from hikari import config -from hikari.utilities import net -from hikari.utilities import ux +from hikari.internal import net +from hikari.internal import ux from tests.hikari import hikari_test_helpers diff --git a/tests/hikari/test_applications.py b/tests/hikari/test_applications.py index 10c42fab42..ecb5a006a9 100644 --- a/tests/hikari/test_applications.py +++ b/tests/hikari/test_applications.py @@ -24,7 +24,7 @@ from hikari import applications from hikari import urls from hikari import users -from hikari.utilities import routes +from hikari.internal import routes from tests.hikari import hikari_test_helpers diff --git a/tests/hikari/utilities/test_event_stream.py b/tests/hikari/test_event_stream.py similarity index 99% rename from tests/hikari/utilities/test_event_stream.py rename to tests/hikari/test_event_stream.py index 5261824a0f..244dcf949d 100644 --- a/tests/hikari/utilities/test_event_stream.py +++ b/tests/hikari/test_event_stream.py @@ -26,10 +26,10 @@ import mock import pytest +from hikari import event_stream from hikari import events from hikari import iterators from hikari.impl import bot -from hikari.utilities import event_stream from tests.hikari import hikari_test_helpers diff --git a/tests/hikari/test_guilds.py b/tests/hikari/test_guilds.py index 1b5a940a8c..1f5def9f16 100644 --- a/tests/hikari/test_guilds.py +++ b/tests/hikari/test_guilds.py @@ -24,7 +24,7 @@ from hikari import guilds from hikari import urls from hikari import users -from hikari.utilities import routes +from hikari.internal import routes from tests.hikari import hikari_test_helpers diff --git a/tests/hikari/test_users.py b/tests/hikari/test_users.py index 5d26462c24..3dc2773d90 100644 --- a/tests/hikari/test_users.py +++ b/tests/hikari/test_users.py @@ -24,7 +24,7 @@ from hikari import undefined from hikari import urls from hikari import users -from hikari.utilities import routes +from hikari.internal import routes from tests.hikari import hikari_test_helpers