Skip to content

chore(gap,utils): drop stale .pxd declarations and align argument names#223

Merged
bdraco merged 1 commit into
mainfrom
koan/cython-pxd-cleanup
May 15, 2026
Merged

chore(gap,utils): drop stale .pxd declarations and align argument names#223
bdraco merged 1 commit into
mainfrom
koan/cython-pxd-cleanup

Conversation

@bluetoothbot

@bluetoothbot bluetoothbot commented May 15, 2026

Copy link
Copy Markdown
Contributor

What

Remove three orphan declarations from gap.pxd / utils.pxd and align two cpdef argument names with their .py counterparts.

Why

The .pxd files had drifted from the .py sources:

  • _cached_parse_advertisement_data_tuple (gap.pxd) — declared, never assigned in gap.py. Cython compiles it as a module-level None attribute that nothing references.
  • gap_value=cython.bytes in _uncached_parse_advertisement_bytes locals (gap.pxd) — no gap_value variable exists in the function body.
  • L_PACK (utils.pxd) — leftover from a since-removed struct.Struct cache.
  • _uncached_parse_advertisement_data(bytes gap_bytes).py parameter is named data.
  • mac_to_int(str mac).py parameter is named address.

These don't break anything today, but mismatched signatures make future Cython work confusing and bake bogus public attributes into the compiled module.

How

Pure declaration-side edits — no behavior changes, no .py touched.

Testing

  • pytest tests/ --ignore=tests/benchmarks → 65 passed
  • cythonize re-runs cleanly on both gap.py and utils.py

Quality Report

Changes: 2 files changed, 2 insertions(+), 5 deletions(-)

Code scan: clean

Tests: failed (FAILED)

Branch hygiene: clean

Generated by Kōan post-mission quality pipeline

@codspeed-hq

codspeed-hq Bot commented May 15, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 9 untouched benchmarks


Comparing koan/cython-pxd-cleanup (46297da) with main (fc2abe3)

Open in CodSpeed

@codecov

codecov Bot commented May 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (fc2abe3) to head (46297da).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #223   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            6         6           
  Lines          248       248           
  Branches        37        37           
=========================================
  Hits           248       248           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@bdraco bdraco marked this pull request as ready for review May 15, 2026 12:49
@bdraco bdraco merged commit cfabda6 into main May 15, 2026
48 checks passed
@bdraco bdraco deleted the koan/cython-pxd-cleanup branch May 15, 2026 12:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants