fix: build with cython 3.3.0 - #1820
Conversation
|
perf and html look the same so should be good to go if ci passes |
Confirmed on my read — no runtime behavior change, only annotations and Two return annotations look unnecessary. One gap on "if CI passes": CI won't build with 3.3.0. |
PR Review — fix: build with cython 3.3.0Solid, well-scoped compatibility fix. Merge-ready; all findings are non-blocking. The diff is disciplined in the ways that matter for a Cython change. Every altered parameter annotation maps to a real No correctness or security concerns: the diff is annotations and
🟢 Suggestions
1. Nothing in CI actually builds with Cython 3.3.0
|
bluetoothbot
left a comment
There was a problem hiding this comment.
Tip
No blocking issues found — ready to merge.
## v0.150.2 (2026-08-28) ### Bug Fixes - Keep `key=` distinct from a valueless `key` in TXT records ([#1813](python-zeroconf/python-zeroconf#1813), [`899eaaa`](python-zeroconf/python-zeroconf@899eaaa)) ## v0.150.1 (2026-08-28) ### Bug Fixes - Build with cython 3.3.0 ([#1820](python-zeroconf/python-zeroconf#1820), [`df947b2`](python-zeroconf/python-zeroconf@df947b2))
Summary
Cython 3.3.0 now resolves subscripted annotations like
list[str]orset[DNSPointer]when it knows the inner type, then rejects them as incompatible with the plainlist/set/dictdeclarations in the.pxd; seven modules fail to build. It also treats an annotated local that is listed in a.pxd@cython.localsas a redeclaration.The fix routes each failing annotation through an alias Cython cannot resolve, the same
_str = stridiom the codebase already uses, so the annotation degrades to the plain container and the.pxdstays the single source of truth; mypy still sees the full types through the aliases. The three conflicting locals (query_buckets,next_scheduled,known_answers_set) keep their Python annotations and drop their@cython.localsentries, which declared the same types.Details
unique_typesstill compiles to__Pyx_ArgTypeTest(..., 0, "unique_types", 2), and thePy_Noneguard counts per module are identical, so no new None checks landed in the hot paths.cython -ashows every pre existing source line keeps its exact score on both 3.2.9 and 3.3.0; only the new alias lines add score, at import time.Test plan
TO_CYTHONIZEmodules compile with Cython 3.3.0 and 3.2.9Fixes #1818