FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

chore: refresh changelog prose, metadata and test listener naming (#1… · python-zeroconf/python-zeroconf@fa34dab · GitHub

Repository navigation

Commit fa34dab

Browse files
authored
chore: refresh changelog prose, metadata and test listener naming (#1884)
1 parent 474ed30 commit fa34dab

7 files changed

Lines changed: 26 additions & 33 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@
415415

416416
### Build System
417417

418-
- Adjust actions checkout ref parameter on release
418+
- Use an explicit checkout ref in the release workflow
419419
([#1669](https://github.com/python-zeroconf/python-zeroconf/pull/1669),
420420
[`bc8ec8d`](https://github.com/python-zeroconf/python-zeroconf/commit/bc8ec8d59d875522f75901644d423d30d803a030))
421421

@@ -2013,17 +2013,10 @@ This also revealed that we do not send NSEC records in the initial broadcast. Th
20132013
([#1145](https://github.com/python-zeroconf/python-zeroconf/pull/1145),
20142014
[`524494e`](https://github.com/python-zeroconf/python-zeroconf/commit/524494edd49bd049726b19ae8ac8f6eea69a3943))
20152015

2016-
- Include tests and docs in sdist archives
2016+
- Ship the tests, docs and COPYING file in the sdist
20172017
([#1142](https://github.com/python-zeroconf/python-zeroconf/pull/1142),
20182018
[`da10a3b`](https://github.com/python-zeroconf/python-zeroconf/commit/da10a3b2827cee0719d3bb9152ae897f061c6e2e))
20192019

2020-
feat: Include tests and docs in sdist archives
2021-
2022-
Include documentation and test files in source distributions, in order to make them more useful for
2023-
packagers (Linux distributions, Conda). Testing is an important part of packaging process, and at
2024-
least Gentoo users have requested offline documentation for Python packages. Furthermore, the
2025-
COPYING file was missing from sdist, even though it was referenced in README.
2026-
20272020
- Small cleanups to cache cleanup interval
20282021
([#1146](https://github.com/python-zeroconf/python-zeroconf/pull/1146),
20292022
[`b434b60`](https://github.com/python-zeroconf/python-zeroconf/commit/b434b60f14ebe8f114b7b19bb4f54081c8ae0173))

‎pyproject.toml‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ license = "LGPL-2.1-or-later"
99
description = "A pure python implementation of multicast DNS service discovery"
1010
readme = "README.rst"
1111
authors = [
12-
{ name = "Paul Scott-Murphy" },
13-
{ name = "William McBrine" },
14-
{ name = "Jakub Stasiak" },
15-
{ name = "J. Nick Koston" },
12+
{ name = "The python-zeroconf authors" }, # full history in COPYING and git
13+
]
14+
maintainers = [
15+
{ name = "J. Nick Koston", email = "nick@koston.org" },
1616
]
1717
requires-python = ">=3.10"
1818

‎src/zeroconf/_dns.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ def _fast_init(self, name: str, type_: _int, class_: _int) -> None:
170170

171171

172172
class DNSRecord(DNSEntry): # noqa: PLW1641
173-
"""A DNS entry that also carries a TTL and creation time."""
173+
"""Record layered on the entry identity with a TTL and creation time."""
174174

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

‎src/zeroconf/_utils/name.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def service_type_name(type_: str, *, strict: bool = True) -> str: # pylint: dis
6060
and anything else that may be represented using Net-Unicode.
6161
6262
:param type_: Type, SubType or service name to validate
63-
:return: fully qualified service name (eg: _http._tcp.local.)
63+
:return: the validated name, fully qualified (eg: _http._tcp.local.)
6464
"""
6565
if len(type_) > 256:
6666
# https://datatracker.ietf.org/doc/html/rfc6763#section-7.2

‎tests/test_asyncio.py‎

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ async def test_async_service_registration(quick_timing: None) -> None:
138138

139139
calls = []
140140

141-
class MyListener(ServiceListener):
141+
class EventStore(ServiceListener):
142142
def add_service(self, zeroconf: Zeroconf, type: str, name: str) -> None:
143143
calls.append(("add", type, name))
144144

@@ -148,7 +148,7 @@ def remove_service(self, zeroconf: Zeroconf, type: str, name: str) -> None:
148148
def update_service(self, zeroconf: Zeroconf, type: str, name: str) -> None:
149149
calls.append(("update", type, name))
150150

151-
listener = MyListener()
151+
listener = EventStore()
152152

153153
aiozc.zeroconf.add_service_listener(type_, listener)
154154

@@ -193,7 +193,7 @@ async def test_async_service_registration_with_server_missing(quick_timing: None
193193

194194
calls = []
195195

196-
class MyListener(ServiceListener):
196+
class EventStore(ServiceListener):
197197
def add_service(self, zeroconf: Zeroconf, type: str, name: str) -> None:
198198
calls.append(("add", type, name))
199199

@@ -203,7 +203,7 @@ def remove_service(self, zeroconf: Zeroconf, type: str, name: str) -> None:
203203
def update_service(self, zeroconf: Zeroconf, type: str, name: str) -> None:
204204
calls.append(("update", type, name))
205205

206-
listener = MyListener()
206+
listener = EventStore()
207207

208208
aiozc.zeroconf.add_service_listener(type_, listener)
209209

@@ -252,7 +252,7 @@ async def test_async_service_registration_same_server_different_ports(quick_timi
252252

253253
calls = []
254254

255-
class MyListener(ServiceListener):
255+
class EventStore(ServiceListener):
256256
def add_service(self, zeroconf: Zeroconf, type: str, name: str) -> None:
257257
calls.append(("add", type, name))
258258

@@ -262,7 +262,7 @@ def remove_service(self, zeroconf: Zeroconf, type: str, name: str) -> None:
262262
def update_service(self, zeroconf: Zeroconf, type: str, name: str) -> None:
263263
calls.append(("update", type, name))
264264

265-
listener = MyListener()
265+
listener = EventStore()
266266

267267
aiozc.zeroconf.add_service_listener(type_, listener)
268268

@@ -310,7 +310,7 @@ async def test_async_service_registration_same_server_same_ports(quick_timing: N
310310

311311
calls = []
312312

313-
class MyListener(ServiceListener):
313+
class EventStore(ServiceListener):
314314
def add_service(self, zeroconf: Zeroconf, type: str, name: str) -> None:
315315
calls.append(("add", type, name))
316316

@@ -320,7 +320,7 @@ def remove_service(self, zeroconf: Zeroconf, type: str, name: str) -> None:
320320
def update_service(self, zeroconf: Zeroconf, type: str, name: str) -> None:
321321
calls.append(("update", type, name))
322322

323-
listener = MyListener()
323+
listener = EventStore()
324324

325325
aiozc.zeroconf.add_service_listener(type_, listener)
326326

@@ -432,7 +432,7 @@ async def test_async_tasks(quick_timing: None) -> None:
432432

433433
calls = []
434434

435-
class MyListener(ServiceListener):
435+
class EventStore(ServiceListener):
436436
def add_service(self, zeroconf: Zeroconf, type: str, name: str) -> None:
437437
calls.append(("add", type, name))
438438

@@ -442,7 +442,7 @@ def remove_service(self, zeroconf: Zeroconf, type: str, name: str) -> None:
442442
def update_service(self, zeroconf: Zeroconf, type: str, name: str) -> None:
443443
calls.append(("update", type, name))
444444

445-
listener = MyListener()
445+
listener = EventStore()
446446
aiozc.zeroconf.add_service_listener(type_, listener)
447447

448448
desc = {"path": "/healthz/"}
@@ -609,7 +609,7 @@ async def test_async_service_browser(quick_timing: None) -> None:
609609

610610
calls = []
611611

612-
class MyListener(ServiceListener):
612+
class EventStore(ServiceListener):
613613
def add_service(self, aiozc: Zeroconf, type: str, name: str) -> None:
614614
calls.append(("add", type, name))
615615

@@ -619,7 +619,7 @@ def remove_service(self, aiozc: Zeroconf, type: str, name: str) -> None:
619619
def update_service(self, aiozc: Zeroconf, type: str, name: str) -> None:
620620
calls.append(("update", type, name))
621621

622-
listener = MyListener()
622+
listener = EventStore()
623623
await aiozc.async_add_service_listener(type_, listener)
624624

625625
desc = {"path": "/healthz/"}

‎tests/test_handlers.py‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1208,7 +1208,7 @@ async def test_record_update_manager_add_listener_callsback_existing_records():
12081208
zc: Zeroconf = aiozc.zeroconf
12091209
updated = []
12101210

1211-
class MyListener(r.RecordUpdateListener):
1211+
class EventStore(r.RecordUpdateListener):
12121212
"""A RecordUpdateListener that does not implement update_records."""
12131213

12141214
def async_update_records(self, zc: Zeroconf, now: float, records: list[r.RecordUpdate]) -> None:
@@ -1225,7 +1225,7 @@ def async_update_records(self, zc: Zeroconf, now: float, records: list[r.RecordU
12251225
ptr_record = info.dns_pointer()
12261226
zc.cache.async_add_records([ptr_record, a_record, info.dns_text(), info.dns_service()])
12271227

1228-
listener = MyListener()
1228+
listener = EventStore()
12291229

12301230
zc.add_listener(
12311231
listener,
@@ -1750,14 +1750,14 @@ async def test_add_listener_warns_when_not_using_record_update_listener(caplog):
17501750
zc: Zeroconf = aiozc.zeroconf
17511751
updated = []
17521752

1753-
class MyListener:
1753+
class EventStore:
17541754
"""A RecordUpdateListener that does not implement update_records."""
17551755

17561756
def async_update_records(self, zc: Zeroconf, now: float, records: list[r.RecordUpdate]) -> None:
17571757
"""Update multiple records in one shot."""
17581758
updated.extend(records)
17591759

1760-
zc.add_listener(MyListener(), None) # type: ignore[arg-type]
1760+
zc.add_listener(EventStore(), None) # type: ignore[arg-type]
17611761
await asyncio.sleep(0) # flush out any call soons
17621762
assert (
17631763
"listeners passed to async_add_listener must inherit from RecordUpdateListener" in caplog.text

‎tests/test_services.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def test_integration_with_listener_class(self):
4747
name = "UPPERxxxyyyæøå"
4848
registration_name = f"{name}.{subtype}"
4949

50-
class MyListener(r.ServiceListener):
50+
class EventStore(r.ServiceListener):
5151
def add_service(self, zeroconf, type, name):
5252
zeroconf.get_service_info(type, name)
5353
service_added.set()
@@ -78,7 +78,7 @@ def remove_service(self, zeroconf, type, name):
7878
def update_service(self, zeroconf, type, name):
7979
sub_service_updated.set()
8080

81-
listener = MyListener()
81+
listener = EventStore()
8282
zeroconf_browser = Zeroconf(interfaces=["127.0.0.1"])
8383
zeroconf_browser.add_service_listener(type_, listener)
8484

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL