Latest Results
fix(build): take C types from the .pxd files, not the .py annotations
A source build with a current Cython fails outright:
src/habluetooth/auto_scheduler.py:328:4: Signature not compatible with
previous declaration
src/habluetooth/auto_scheduler.pxd:48:28: Previous declaration is here
Cython 3.3 reconciles a .pxd declaration against the annotations on the .py
definition, and rejects a bare container type in the .pxd against a
parameterised one in the .py:
.pxd cpdef void _attach_owned(self, str address, dict entries)
.py def _attach_owned(
self, address: str, entries: dict[ActiveScanRequest, float]
) -> None
Ten declarations hit this, across auto_scheduler.pxd (7) and base_scanner.pxd
(3). The build-system requirement is only `Cython>=3`, so this is not a
hypothetical: every source build resolves to 3.3 and stops. Only the published
wheels still work.
Writing the parameterised form into the .pxd does not help -- Cython does not
accept `dict[ActiveScanRequest, float]` as a C parameter type there. The types
Cython should use are the ones already spelled out in the .pxd files; the
annotations exist for mypy and for people reading the code. Say so with
`annotation_typing: False`.
Trade-off worth stating: functions that are *not* declared in a .pxd no longer
get C types inferred from their annotations. Everything on the hot paths here
is declared in a .pxd, so this costs nothing that was not already explicit.
Verified with Cython 3.3.0: all seven extension modules compile, the wheel
carries all seven .so, and the suite passes against the compiled build
(899 passed, 1 skipped).
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>rpodgorny:fix/pxd-signatures-match-annotations Latest Branches
+13%
rpodgorny:fix/pxd-signatures-match-annotations +3%
rpodgorny:fix/disconnect-clients-on-scanner-unregister +2%
allocation-callbacks-on-unregister © 2026 CodSpeed Technology