10000 chore(pre-commit.ci): pre-commit autoupdate (#1444) · python-zeroconf/python-zeroconf@84596e0 · GitHub
[go: up one dir, main page]

Skip to content

Commit 84596e0

Browse files
chore(pre-commit.ci): pre-commit autoupdate (#1444)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 1b0d2f5 commit 84596e0

17 files changed

+107
-107
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ repos:
3939
- id: pyupgrade
4040
args: [--py38-plus]
4141
- repo: https://github.com/astral-sh/ruff-pre-commit
42-
rev: v0.7.4
42+
rev: v0.8.0
4343
hooks:
4444
- id: ruff
4545
args: [--fix, --exit-non-zero-on-fix]

src/zeroconf/__init__.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -88,27 +88,27 @@
8888

8989

9090
__all__ = [
91-
"__version__",
92-
"Zeroconf",
93-
"ServiceInfo",
94-
"ServiceBrowser",
95-
"ServiceListener",
91+
"AbstractMethodException",
92+
"BadTypeInNameException",
9693
"DNSQuestionType",
97-
"InterfaceChoice",
98-
"ServiceStateChange",
99-
"IPVersion",
100-
"ZeroconfServiceTypes",
101-
"RecordUpdate",
102-
"RecordUpdateListener",
103-
"current_time_millis",
10494
# Exceptions
10595
"Error",
106-
"AbstractMethodException",
107-
"BadTypeInNameException",
10896
"EventLoopBlocked",
97+
"IPVersion",
10998
"IncomingDecodeError",
99+
"InterfaceChoice",
110100
"NamePartTooLongException",
111101
"NonUniqueNameException",
112102
"NotRunningException",
103+
"RecordUpdate",
104+
"RecordUpdateListener",
105+
"ServiceBrowser",
106+
"ServiceInfo",
107+
"ServiceListener",
113108
"ServiceNameAlreadyRegistered",
109+
"ServiceStateChange",
110+
"Zeroconf",
111+
"ZeroconfServiceTypes",
112+
"__version__",
113+
"current_time_millis",
114114
]

src/zeroconf/_dns.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ class DNSQuestionType(enum.Enum):
6464
class DNSEntry:
6565
"""A DNS entry"""
6666

67-
__slots__ = ("key", "name", "type", "class_", "unique")
67+
__slots__ = ("class_", "key", "name", "type", "unique")
6868

6969
def __init__(self, name: str, type_: int, class_: int) -> None:
7070
self.name = name
@@ -157,7 +157,7 @@ def __repr__(self) -> str:
157157
class DNSRecord(DNSEntry):
158158
"""A DNS record - like a DNS entry, but has a TTL"""
159159

160-
__slots__ = ("ttl", "created")
160+
__slots__ = ("created", "ttl")
161161

162162
# TODO: Switch to just int ttl
163163
def __init__(
@@ -421,7 +421,7 @@ def __repr__(self) -> str:
421421
class DNSService(DNSRecord):
422422
"""A DNS service record"""
423423

424-
__slots__ = ("_hash", "priority", "weight", "port", "server", "server_key")
424+
__slots__ = ("_hash", "port", "priority", "server", "server_key", "weight")
425425

426426
def __init__(
427427
self,
@@ -542,7 +542,7 @@ def __repr__(self) -> str:
542542
class DNSRRSet:
543543
"""A set of dns records with a lookup to get the ttl."""
544544

545-
__slots__ = ("_records", "_lookup")
545+
__slots__ = ("_lookup", "_records")
546546

547547
def __init__(self, records: List[DNSRecord]) -> None:
548548
"""Create an RRset from records sets."""

src/zeroconf/_engine.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,15 @@ class AsyncEngine:
4545
"""An engine wraps sockets in the event loop."""
4646

4747
__slots__ = (
48+
"_cleanup_timer",
49+
"_listen_socket",
50+
"_respond_sockets",
4851
"loop",
49-
"zc",
5052
"protocols",
5153
"readers",
52-
"senders",
5354
"running_event",
54-
"_listen_socket",
55-
"_respond_sockets",
56-
"_cleanup_timer",
55+
"senders",
56+
"zc",
5757
)
5858

5959
def __init__(

src/zeroconf/_handlers/answers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
class QuestionAnswers:
4545
"""A group of answers to a question."""
4646

47-
__slots__ = ("ucast", "mcast_now", "mcast_aggregate", "mcast_aggregate_last_second")
47+
__slots__ = ("mcast_aggregate", "mcast_aggregate_last_second", "mcast_now", "ucast")
4848

4949
def __init__(
5050
self,
@@ -71,7 +71,7 @@ def __repr__(self) -> str:
7171
class AnswerGroup:
7272
"""A group of answers scheduled to be sent at the same time."""
7373

74-
__slots__ = ("send_after", "send_before", "answers")
74+
__slots__ = ("answers", "send_after", "send_before")
7575

7676
def __init__(
7777
self,

src/zeroconf/_handlers/multicast_outgoing_queue.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,12 @@ class MulticastOutgoingQueue:
4545
"""An outgoing queue used to aggregate multicast responses."""
4646

4747
__slots__ = (
48-
"zc",
49-
"queue",
50-
"_multicast_delay_random_min",
51-
"_multicast_delay_random_max",
5248
"_additional_delay",
5349
"_aggregation_delay",
50+
"_multicast_delay_random_max",
51+
"_multicast_delay_random_min",
52+
"queue",
53+
"zc",
5454
)
5555

5656
def __init__(self, zeroconf: "Zeroconf", additional_delay: _int, max_aggregation_delay: _int) -> None:

src/zeroconf/_handlers/query_handler.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171

7272

7373
class _AnswerStrategy:
74-
__slots__ = ("question", "strategy_type", "types", "services")
74+
__slots__ = ("question", "services", "strategy_type", "types")
7575

7676
def __init__(
7777
self,
@@ -91,15 +91,15 @@ class _QueryResponse:
9191
"""A pair for unicast and multicast DNSOutgoing responses."""
9292

9393
__slots__ = (
94-
"_is_probe",
95-
"_questions",
96-
"_now",
97-
"_cache",
9894
"_additionals",
99-
"_ucast",
100-
"_mcast_now",
95+
"_cache",
96+
"_is_probe",
10197
"_mcast_aggregate",
10298
"_mcast_aggregate_last_second",
99+
"_mcast_now",
100+
"_now",
101+
"_questions",
102+
"_ucast",
103103
)
104104

105105
def __init__(self, cache: DNSCache, questions: List[DNSQuestion], is_probe: bool, now: float) -> None:
@@ -191,12 +191,12 @@ class QueryHandler:
191191
"""Query the ServiceRegistry."""
192192

193193
__slots__ = (
194-
"zc",
195-
"registry",
196194
"cache",
197-
"question_history",
198-
"out_queue",
199195
"out_delay_queue",
196+
"out_queue",
197+
"question_history",
198+
"registry",
199+
"zc",
200200
)
201201

202202
def __init__(self, zc: "Zeroconf") -> None:

src/zeroconf/_handlers/record_manager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
class RecordManager:
4141
"""Process records into the cache and notify listeners."""
4242

43-
__slots__ = ("zc", "cache", "listeners")
43+
__slots__ = ("cache", "listeners", "zc")
4444

4545
def __init__(self, zeroconf: "Zeroconf") -> None:
4646
"""Init the record manager."""

src/zeroconf/_listener.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,17 +55,17 @@ class AsyncListener:
5555
the read() method called when a socket is available for reading."""
5656

5757
__slots__ = (
58-
"zc",
59-
"_registry",
60-
"_record_manager",
58+
"_deferred",
6159
"_query_handler",
60+
"_record_manager",
61+
"_registry",
62+
"_timers",
6263
"data",
63-
"last_time",
6464
"last_message",
65-
"transport",
65+
"last_time",
6666
"sock_description",
67-
"_deferred",
68-
"_timers",
67+
"transport",
68+
"zc",
6969
)
7070

7171
def __init__(self, zc: "Zeroconf") -> None:

src/zeroconf/_protocol/incoming.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -70,25 +70,25 @@ class DNSIncoming:
7070
"""Object representation of an incoming DNS packet"""
7171

7272
__slots__ = (
73-
"_did_read_others",
74-
"flags",
75-
"offset",
76-
"data",
77-
"view",
73+
"_answers",
7874
"_data_len",
75+
"_did_read_others",
76+
"_has_qu_question",
7977
"_name_cache",
80-
"_questions",
81-
"_answers",
82-
"id",
83-
"_num_questions",
78+
"_num_additionals",
8479
"_num_answers",
8580
"_num_authorities",
86-
"_num_additionals",
87-
"valid",
81+
"_num_questions",
82+
"_questions",
83+
"data",
84+
"flags",
85+
"id",
8886
"now",
87+
"offset",
8988
"scope_id",
9089
"source",
91-
"_has_qu_question",
90+
"valid",
91+
"view",
9292
)
9393

9494
def __init__(

src/zeroconf/_protocol/outgoing.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -77,20 +77,20 @@ class DNSOutgoing:
7777
"""Object representation of an outgoing packet"""
7878

7979
__slots__ = (
80-
"flags",
80+
"additionals",
81+
"allow_long",
82+
"answers",
83+
"authorities",
84+
"data",
8185
"finished",
86+
"flags",
8287
"id",
8388
"multicast",
84-
"packets_data",
8589
"names",
86-
"data",
90+
"packets_data",
91+
"questions",
8792
"size",
88-
"allow_long",
8993
"state",
90-
"questions",
91-
"answers",
92-
"authorities",
93-
"additionals",
9494
)
9595

9696
def __init__(self, flags: int, multicast: bool = True, id_: int = 0) -> None:

src/zeroconf/_services/browser.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,10 @@
107107
class _ScheduledPTRQuery:
108108
__slots__ = (
109109
"alias",
110-
"name",
111-
"ttl",
112110
"cancelled",
113111
"expire_time_millis",
112+
"name",
113+
"ttl",
114114
"when_millis",
115115
)
116116

@@ -189,7 +189,7 @@ def __gt__(self, other: "_ScheduledPTRQuery") -> bool:
189189
class _DNSPointerOutgoingBucket:
190190
"""A DNSOutgoing bucket."""
191191

192-
__slots__ = ("now_millis", "out", "bytes")
192+
__slots__ = ("bytes", "now_millis", "out")
193193

194194
def __init__(self, now_millis: float, multicast: bool) -> None:
195195
"""Create a bucket to wrap a DNSOutgoing."""
@@ -328,20 +328,20 @@ class QueryScheduler:
328328
"""
329329

330330
__slots__ = (
331-
"_zc",
332-
"_types",
333331
"_addr",
334-
"_port",
335-
"_multicast",
332+
"_clock_resolution_millis",
336333
"_first_random_delay_interval",
337-
"_min_time_between_queries_millis",
338334
"_loop",
339-
"_startup_queries_sent",
335+
"_min_time_between_queries_millis",
336+
"_multicast",
337+
"_next_run",
340338
"_next_scheduled_for_alias",
339+
"_port",
341340
"_query_heap",
342-
"_next_run",
343-
"_clock_resolution_millis",
344341
"_question_type",
342+
"_startup_queries_sent",
343+
"_types",
344+
"_zc",
345345
)
346346

347347
def __init__(
@@ -556,15 +556,15 @@ class _ServiceBrowserBase(RecordUpdateListener):
556556
"""Base class for ServiceBrowser."""
557557

558558
__slots__ = (
559-
"types",
560-
"zc",
561559
"_cache",
562560
"_loop",
563561
"_pending_handlers",
562+
"_query_sender_task",
564563
"_service_state_changed",
565-
"query_scheduler",
566564
"done",
567-
"_query_sender_task",
565+
"query_scheduler",
566+
"types",
567+
"zc",
568568
)
569569

570570
def __init__(

0 commit comments

Comments
 (0)
0