diff --git a/broadcaster/__init__.py b/broadcaster/__init__.py index 5ab9306..0bcd9d2 100644 --- a/broadcaster/__init__.py +++ b/broadcaster/__init__.py @@ -1,5 +1,5 @@ -from ._backends.base import BroadcastBackend from ._base import Broadcast, Event +from .backends.base import BroadcastBackend __version__ = "0.3.1" __all__ = ["Broadcast", "Event", "BroadcastBackend"] diff --git a/broadcaster/_base.py b/broadcaster/_base.py index e966a6f..a63b22b 100644 --- a/broadcaster/_base.py +++ b/broadcaster/_base.py @@ -6,7 +6,7 @@ from urllib.parse import urlparse if TYPE_CHECKING: # pragma: no cover - from broadcaster._backends.base import BroadcastBackend + from broadcaster.backends.base import BroadcastBackend class Event: @@ -34,27 +34,27 @@ def __init__(self, url: str | None = None, *, backend: BroadcastBackend | None = def _create_backend(self, url: str) -> BroadcastBackend: parsed_url = urlparse(url) if parsed_url.scheme in ("redis", "rediss"): - from broadcaster._backends.redis import RedisBackend + from broadcaster.backends.redis import RedisBackend return RedisBackend(url) elif parsed_url.scheme == "redis-stream": - from broadcaster._backends.redis import RedisStreamBackend + from broadcaster.backends.redis import RedisStreamBackend return RedisStreamBackend(url) elif parsed_url.scheme in ("postgres", "postgresql"): - from broadcaster._backends.postgres import PostgresBackend + from broadcaster.backends.postgres import PostgresBackend return PostgresBackend(url) if parsed_url.scheme == "kafka": - from broadcaster._backends.kafka import KafkaBackend + from broadcaster.backends.kafka import KafkaBackend return KafkaBackend(url) elif parsed_url.scheme == "memory": - from broadcaster._backends.memory import MemoryBackend + from broadcaster.backends.memory import MemoryBackend return MemoryBackend(url) raise ValueError(f"Unsupported backend: {parsed_url.scheme}") diff --git a/broadcaster/_backends/__init__.py b/broadcaster/backends/__init__.py similarity index 100% rename from broadcaster/_backends/__init__.py rename to broadcaster/backends/__init__.py diff --git a/broadcaster/_backends/base.py b/broadcaster/backends/base.py similarity index 100% rename from broadcaster/_backends/base.py rename to broadcaster/backends/base.py diff --git a/broadcaster/_backends/kafka.py b/broadcaster/backends/kafka.py similarity index 100% rename from broadcaster/_backends/kafka.py rename to broadcaster/backends/kafka.py diff --git a/broadcaster/_backends/memory.py b/broadcaster/backends/memory.py similarity index 100% rename from broadcaster/_backends/memory.py rename to broadcaster/backends/memory.py diff --git a/broadcaster/_backends/postgres.py b/broadcaster/backends/postgres.py similarity index 100% rename from broadcaster/_backends/postgres.py rename to broadcaster/backends/postgres.py diff --git a/broadcaster/_backends/redis.py b/broadcaster/backends/redis.py similarity index 100% rename from broadcaster/_backends/redis.py rename to broadcaster/backends/redis.py diff --git a/tests/test_broadcast.py b/tests/test_broadcast.py index e73b9eb..a8bd3eb 100644 --- a/tests/test_broadcast.py +++ b/tests/test_broadcast.py @@ -6,7 +6,7 @@ import pytest from broadcaster import Broadcast, BroadcastBackend, Event -from broadcaster._backends.kafka import KafkaBackend +from broadcaster.backends.kafka import KafkaBackend class CustomBackend(BroadcastBackend):