Skip to content

Commit 0e61b15

Browse files
authored
Mark zeroconf.dns as protected by renaming to zeroconf._dns (#574)
- The public API should only access zeroconf and zeroconf.aio as internals may be relocated between releases
1 parent f10a562 commit 0e61b15

8 files changed

Lines changed: 7 additions & 7 deletions

File tree

tests/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929

3030
from zeroconf.core import Zeroconf
31-
from zeroconf.dns import DNSIncoming
31+
from zeroconf._dns import DNSIncoming
3232

3333

3434
def _inject_response(zc: Zeroconf, msg: DNSIncoming) -> None:

zeroconf/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
from .cache import DNSCache # noqa # import needed for backwards compat
2626
from .core import NotifyListener, Zeroconf # noqa # import needed for backwards compat
27-
from .dns import ( # noqa # import needed for backwards compat
27+
from ._dns import ( # noqa # import needed for backwards compat
2828
DNSAddress,
2929
DNSEntry,
3030
DNSHinfo,
File renamed without changes.

zeroconf/aio.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@
2626
from types import TracebackType # noqa # used in type hints
2727
from typing import Awaitable, Callable, Dict, List, Optional, Type, Union
2828

29+
from ._dns import DNSOutgoing
2930
from .const import _BROWSER_TIME, _CHECK_TIME, _LISTENER_TIME, _MDNS_PORT, _REGISTER_TIME, _UNREGISTER_TIME
3031
from .core import NotifyListener, Zeroconf
31-
from .dns import DNSOutgoing
3232
from .exceptions import NonUniqueNameException
3333
from .services import ServiceInfo, _ServiceBrowserBase, instance_name_from_service_info
3434
from .utils.aio import wait_condition_or_timeout

zeroconf/cache.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222

2323
from typing import Dict, Iterable, List, Optional, cast
2424

25+
from ._dns import DNSEntry, DNSPointer, DNSRecord, DNSService
2526
from .const import _TYPE_PTR
26-
from .dns import DNSEntry, DNSPointer, DNSRecord, DNSService
2727
from .utils.time import current_time_millis
2828

2929

zeroconf/core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
from types import TracebackType # noqa # used in type hints
2929
from typing import Dict, List, Optional, Type, Union, cast
3030

31+
from ._dns import DNSIncoming, DNSOutgoing, DNSQuestion
3132
from .cache import DNSCache
3233
from .const import (
3334
_CACHE_CLEANUP_INTERVAL,
@@ -45,7 +46,6 @@
4546
_TYPE_PTR,
4647
_UNREGISTER_TIME,
4748
)
48-
from .dns import DNSIncoming, DNSOutgoing, DNSQuestion
4949
from .exceptions import NonUniqueNameException
5050
from .handlers import QueryHandler, RecordManager
5151
from .logger import QuietLogger, log

zeroconf/handlers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import itertools
2424
from typing import List, Optional, TYPE_CHECKING, Union
2525

26+
from ._dns import DNSAddress, DNSIncoming, DNSOutgoing, DNSPointer, DNSQuestion, DNSRecord
2627
from .const import (
2728
_CLASS_IN,
2829
_DNS_OTHER_TTL,
@@ -35,7 +36,6 @@
3536
_TYPE_SRV,
3637
_TYPE_TXT,
3738
)
38-
from .dns import DNSAddress, DNSIncoming, DNSOutgoing, DNSPointer, DNSQuestion, DNSRecord
3939
from .logger import log
4040
from .services import (
4141
RecordUpdateListener,

zeroconf/services/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
from collections import OrderedDict
2828
from typing import Any, Callable, Dict, List, Optional, Set, TYPE_CHECKING, Tuple, Union, cast
2929

30+
from .._dns import DNSAddress, DNSOutgoing, DNSPointer, DNSQuestion, DNSRecord, DNSService, DNSText
3031
from ..const import (
3132
_BROWSER_BACKOFF_LIMIT,
3233
_BROWSER_TIME,
@@ -46,7 +47,6 @@
4647
_TYPE_SRV,
4748
_TYPE_TXT,
4849
)
49-
from ..dns import DNSAddress, DNSOutgoing, DNSPointer, DNSQuestion, DNSRecord, DNSService, DNSText
5050
from ..exceptions import BadTypeInNameException
5151
from ..utils.name import service_type_name
5252
from ..utils.net import (

0 commit comments

Comments
 (0)