diff --git a/faststream/_internal/broker/abc_broker.py b/faststream/_internal/broker/abc_broker.py index e3998c75d5..9e9f268038 100644 --- a/faststream/_internal/broker/abc_broker.py +++ b/faststream/_internal/broker/abc_broker.py @@ -8,11 +8,7 @@ Optional, ) -from ..types import ( - BrokerMiddleware, - CustomCallable, - MsgType, -) +from faststream._internal.types import BrokerMiddleware, CustomCallable, MsgType if TYPE_CHECKING: from fast_depends.dependencies import Depends diff --git a/faststream/_internal/broker/logging_mixin.py b/faststream/_internal/broker/logging_mixin.py index 43ab11a4e1..3b8f401465 100644 --- a/faststream/_internal/broker/logging_mixin.py +++ b/faststream/_internal/broker/logging_mixin.py @@ -5,8 +5,8 @@ from typing_extensions import Annotated, Doc from faststream._internal.constants import EMPTY +from faststream._internal.types import MsgType -from ..types import MsgType from .abc_broker import ABCBroker if TYPE_CHECKING: diff --git a/faststream/_internal/broker/router.py b/faststream/_internal/broker/router.py index 12d0eb3b76..0661ac4bd6 100644 --- a/faststream/_internal/broker/router.py +++ b/faststream/_internal/broker/router.py @@ -6,11 +6,12 @@ Optional, ) -from ..types import ( +from faststream._internal.types import ( BrokerMiddleware, CustomCallable, MsgType, ) + from .abc_broker import ABCBroker if TYPE_CHECKING: diff --git a/pyproject.toml b/pyproject.toml index 7919811427..9086bf09fd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -213,6 +213,7 @@ select = [ "PT", # flake8-pytest-style https://docs.astral.sh/ruff/rules/#flake8-pytest-style-pt "PTH", # flake8-use-pathlib https://docs.astral.sh/ruff/rules/#flake8-use-pathlib-pth "TCH", # flake8-type-checking https://docs.astral.sh/ruff/rules/#flake8-type-checking-tch + "TID", # flake8-tidy-imports https://docs.astral.sh/ruff/rules/#flake8-tidy-imports-tid "RUF", # Ruff-specific rules https://docs.astral.sh/ruff/rules/#ruff-specific-rules-ruf "PERF", # Perflint https://docs.astral.sh/ruff/rules/#perflint-perf "UP", # pyupgrade https://docs.astral.sh/ruff/rules/#pyupgrade-up diff --git a/tests/opentelemetry/confluent/test_confluent.py b/tests/opentelemetry/confluent/test_confluent.py index 9eb52d9742..af914ebc9d 100644 --- a/tests/opentelemetry/confluent/test_confluent.py +++ b/tests/opentelemetry/confluent/test_confluent.py @@ -17,8 +17,7 @@ from faststream.opentelemetry.consts import MESSAGING_DESTINATION_PUBLISH_NAME from faststream.opentelemetry.middleware import MessageAction as Action from tests.brokers.confluent.basic import ConfluentTestcaseConfig - -from ..basic import LocalTelemetryTestcase +from tests.opentelemetry.basic import LocalTelemetryTestcase @pytest.mark.confluent diff --git a/tests/opentelemetry/kafka/test_kafka.py b/tests/opentelemetry/kafka/test_kafka.py index 0967069ade..a4f83748c4 100644 --- a/tests/opentelemetry/kafka/test_kafka.py +++ b/tests/opentelemetry/kafka/test_kafka.py @@ -18,8 +18,7 @@ from faststream.opentelemetry.middleware import MessageAction as Action from tests.brokers.kafka.test_consume import TestConsume from tests.brokers.kafka.test_publish import TestPublish - -from ..basic import LocalTelemetryTestcase +from tests.opentelemetry.basic import LocalTelemetryTestcase @pytest.mark.kafka diff --git a/tests/opentelemetry/nats/test_nats.py b/tests/opentelemetry/nats/test_nats.py index d1262c7e6a..88dc22d49c 100644 --- a/tests/opentelemetry/nats/test_nats.py +++ b/tests/opentelemetry/nats/test_nats.py @@ -12,8 +12,7 @@ from faststream.nats.opentelemetry import NatsTelemetryMiddleware from tests.brokers.nats.test_consume import TestConsume from tests.brokers.nats.test_publish import TestPublish - -from ..basic import LocalTelemetryTestcase +from tests.opentelemetry.basic import LocalTelemetryTestcase @pytest.fixture diff --git a/tests/opentelemetry/rabbit/test_rabbit.py b/tests/opentelemetry/rabbit/test_rabbit.py index 59d77c3b70..2a779cdd4b 100644 --- a/tests/opentelemetry/rabbit/test_rabbit.py +++ b/tests/opentelemetry/rabbit/test_rabbit.py @@ -12,8 +12,7 @@ from faststream.rabbit.opentelemetry import RabbitTelemetryMiddleware from tests.brokers.rabbit.test_consume import TestConsume from tests.brokers.rabbit.test_publish import TestPublish - -from ..basic import LocalTelemetryTestcase +from tests.opentelemetry.basic import LocalTelemetryTestcase @pytest.fixture diff --git a/tests/opentelemetry/redis/test_redis.py b/tests/opentelemetry/redis/test_redis.py index 9729b0a27f..8d8366ba10 100644 --- a/tests/opentelemetry/redis/test_redis.py +++ b/tests/opentelemetry/redis/test_redis.py @@ -17,8 +17,7 @@ TestConsumeStream, ) from tests.brokers.redis.test_publish import TestPublish - -from ..basic import LocalTelemetryTestcase +from tests.opentelemetry.basic import LocalTelemetryTestcase @pytest.mark.redis