8000 chore(pre-commit.ci): pre-commit autoupdate by pre-commit-ci[bot] · Pull Request #1444 · python-zeroconf/python-zeroconf · GitHub
[go: up one dir, main page]

Skip to content

chore(pre-commit.ci): pre-commit autoupdate #1444

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file 8000
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ repos:
- id: pyupgrade
args: [--py38-plus]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.7.4
rev: v0.8.0
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
Expand Down
28 changes: 14 additions & 14 deletions src/zeroconf/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,27 +88,27 @@


__all__ = [
"__version__",
"Zeroconf",
"ServiceInfo",
"ServiceBrowser",
"ServiceListener",
"AbstractMethodException",
"BadTypeInNameException",
"DNSQuestionType",
"InterfaceChoice",
"ServiceStateChange",
"IPVersion",
"ZeroconfServiceTypes",
"RecordUpdate",
"RecordUpdateListener",
"current_time_millis",
# Exceptions
"Error",
"AbstractMethodException",
"BadTypeInNameException",
"EventLoopBlocked",
"IPVersion",
"IncomingDecodeError",
"InterfaceChoice",
"NamePartTooLongException",
"NonUniqueNameException",
"NotRunningException",
"RecordUpdate",
"RecordUpdateListener",
"ServiceBrowser",
"ServiceInfo",
"ServiceListener",
"ServiceNameAlreadyRegistered",
"ServiceStateChange",
"Zeroconf",
"ZeroconfServiceTypes",
"__version__",
"current_time_millis",
]
8 changes: 4 additions & 4 deletions src/zeroconf/_dns.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class DNSQuestionType(enum.Enum):
class DNSEntry:
"""A DNS entry"""

__slots__ = ("key", "name", "type", "class_", "unique")
__slots__ = ("class_", "key", "name", "type", "unique")

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

__slots__ = ("ttl", "created")
__slots__ = ("created", "ttl")

# TODO: Switch to just int ttl
def __init__(
Expand Down Expand Up @@ -421,7 +421,7 @@ def __repr__(self) -> str:
class DNSService(DNSRecord):
"""A DNS service record"""

__slots__ = ("_hash", "priority", "weight", "port", "server", "server_key")
__slots__ = ("_hash", "port", "priority", "server", "server_key", "weight")

def __init__(
self,
Expand Down Expand Up @@ -542,7 +542,7 @@ def __repr__(self) -> str:
class DNSRRSet:
"""A set of dns records with a lookup to get the ttl."""

__slots__ = ("_records", "_lookup")
__slots__ = ("_lookup", "_records")

def __init__(self, records: List[DNSRecord]) -> None:
"""Create an RRset from records sets."""
Expand Down
10 changes: 5 additions & 5 deletions src/zeroconf/_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,15 @@ class AsyncEngine:
"""An engine wraps sockets in the event loop."""

__slots__ = (
"_cleanup_timer",
"_listen_socket",
"_respond_sockets",
"loop",
"zc",
"protocols",
"readers",
"senders",
"running_event",
"_listen_socket",
"_respond_sockets",
"_cleanup_timer",
"senders",
"zc",
)

def __init__(
Expand Down
4 changes: 2 additions & 2 deletions src/zeroconf/_handlers/answers.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
class QuestionAnswers:
"""A group of answers to a question."""

__slots__ = ("ucast", "mcast_now", "mcast_aggregate", "mcast_aggregate_last_second")
__slots__ = ("mcast_aggregate", "mcast_aggregate_last_second", "mcast_now", "ucast")

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

__slots__ = ("send_after", "send_before", "answers")
__slots__ = ("answers", "send_after", "send_before")

def __init__(
self,
Expand Down
8 changes: 4 additions & 4 deletions src/zeroconf/_handlers/multicast_outgoing_queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@ class MulticastOutgoingQueue:
"""An outgoing queue used to aggregate multicast responses."""

__slots__ = (
"zc",
"queue",
"_multicast_delay_random_min",
"_multicast_delay_random_max",
"_additional_delay",
"_aggregation_delay",
"_multicast_delay_random_max",
"_multicast_delay_random_min",
"queue",
"zc",
)

def __init__(self, zeroconf: "Zeroconf", additional_delay: _int, max_aggregation_delay: _int) -> None:
Expand Down
22 changes: 11 additions & 11 deletions src/zeroconf/_handlers/query_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@


class _AnswerStrategy:
__slots__ = ("question", "strategy_type", "types", "services")
__slots__ = ("question", "services", "strategy_type", "types")

def __init__(
self,
Expand All @@ -91,15 +91,15 @@ class _QueryResponse:
"""A pair for unicast and multicast DNSOutgoing responses."""

__slots__ = (
"_is_probe",
"_questions",
"_now",
"_cache",
"_additionals",
"_ucast",
"_mcast_now",
"_cache",
"_is_probe",
"_mcast_aggregate",
"_mcast_aggregate_last_second",
"_mcast_now",
"_now",
"_questions",
"_ucast",
)

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

__slots__ = (
"zc",
"registry",
"cache",
"question_history",
"out_queue",
"out_delay_queue",
"out_queue",
"question_history",
"registry",
"zc",
)

def __init__(self, zc: "Zeroconf") -> None:
Expand Down
2 changes: 1 addition & 1 deletion src/zeroconf/_handlers/record_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
class RecordManager:
"""Process records into the cache and notify listeners."""

__slots__ = ("zc", "cache", "listeners")
__slots__ = ("cache", "listeners", "zc")

def __init__(self, zeroconf: "Zeroconf") -> None:
"""Init the record manager."""
Expand Down
14 changes: 7 additions & 7 deletions src/zeroconf/_listener.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,17 @@ class AsyncListener:
the read() method called when a socket is available for reading."""

__slots__ = (
"zc",
"_registry",
"_record_manager",
"_deferred",
"_query_handler",
"_record_manager",
"_registry",
"_timers",
"data",
"last_time",
"last_message",
"transport",
"last_time",
"sock_description",
"_deferred",
"_timers",
"transport",
"zc",
)

def __init__(self, zc: "Zeroconf") -> None:
Expand Down
24 changes: 12 additions & 12 deletions src/zeroconf/_protocol/incoming.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,25 +70,25 @@ class DNSIncoming:
"""Object representation of an incoming DNS packet"""

__slots__ = (
"_did_read_others",
"flags",
"offset",
"data",
"view",
"_answers",
"_data_len",
"_did_read_others",
"_has_qu_question",
"_name_cache",
"_questions",
"_answers",
"id",
"_num_questions",
"_num_additionals",
"_num_answers",
"_num_authorities",
"_num_additionals",
"valid",
"_num_questions",
"_questions",
"data",
"flags",
"id",
"now",
"offset",
"scope_id",
"source",
"_has_qu_question",
"valid",
"view",
)

def __init__(
Expand Down
16 changes: 8 additions & 8 deletions src/zeroconf/_protocol/outgoing.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,20 +77,20 @@ class DNSOutgoing:
"""Object representation of an outgoing packet"""

__slots__ = (
"flags",
"additionals",
"allow_long",
"answers",
"authorities",
"data",
"finished",
"flags",
"id",
"multicast",
"packets_data",
"names",
"data",
"packets_data",
"questions",
"size",
"allow_long",
"state",
"questions",
"answers",
"authorities",
"additionals",
)

def __init__(self, flags: int, multicast: bool = True, id_: int = 0) -> None:
Expand Down
30 changes: 15 additions & 15 deletions src/zeroconf/_services/browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,10 @@
class _ScheduledPTRQuery:
__slots__ = (
"alias",
"name",
"ttl",
"cancelled",
"expire_time_millis",
"name",
"ttl",
"when_millis",
)

Expand Down Expand Up @@ -189,7 +189,7 @@ def __gt__(self, other: "_ScheduledPTRQuery") -> bool:
class _DNSPointerOutgoingBucket:
"""A DNSOutgoing bucket."""

__slots__ = ("now_millis", "out", "bytes")
__slots__ = ("bytes", "now_millis", "out")

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

__slots__ = (
"_zc",
"_types",
"_addr",
"_port",
"_multicast",
"_clock_resolution_millis",
"_first_random_delay_interval",
"_min_time_between_queries_millis",
"_loop",
"_startup_queries_sent",
"_min_time_between_queries_millis",
"_multicast",
"_next_run",
"_next_scheduled_for_alias",
"_port",
"_query_heap",
"_next_run",
"_clock_resolution_millis",
"_question_type",
"_startup_queries_sent",
"_types",
"_zc",
)

def __init__(
Expand Down Expand Up @@ -556,15 +556,15 @@ class _ServiceBrowserBase(RecordUpdateListener):
"""Base class for ServiceBrowser."""

__slots__ = (
"types",
"zc",
"_cache",
"_loop",
"_pending_handlers",
"_query_sender_task",
"_service_state_changed",
"query_scheduler",
"done",
"_query_sender_task",
"query_scheduler",
"types",
"zc",
)

def __init__(
Expand Down
Loading
Loading
0