Skip to content

Fold the hardware and minimum-version decorators into one - #53

Merged
chiconws merged 3 commits into
devfrom
simplify/audit-round-2
Oct 11, 2026
Merged

chiconws merged 3 commits into
devfrom
simplify/audit-round-2

Conversation

@chiconws

Copy link
Copy Markdown
Collaborator

Summary

Second round of the over-engineering audit. Methods limited to one hardware family carried two stacked decorators, one for the hardware and one for the minimum application version. They are now one. The rest removes configuration that had no effect.

Changes

  • require_hardware takes an optional min_version. @require_hardware(HWFamily.NON_PRO, min_version="2.5.1") replaces the pair @require_hardware(HWFamily.NON_PRO) + @require_application_version(non_pro="2.5.1") on 53 methods. It applies require_application_version internally, so the checks and error messages are the same.
  • require_application_version is unchanged and still used on its own for methods that exist on both families with different minimums.
  • ruff. Dropped the exclude list, which named directories that do not exist or that ruff already skips by default, and the F811 per-file ignore for tests, which no longer suppresses anything.
  • coverage. Dropped three exclude_lines patterns that match nothing in the package. pragma: no cover and if TYPE_CHECKING: stay.

Behaviour changes

None. min_version is optional, so existing uses of both decorators keep working.

Testing

402 unit tests pass and coverage stays at 94%. Also run against a NanoKVM PCIe (application 2.5.2) and a NanoKVM Pro (application 1.2.15): supported methods work and methods for the other family are refused with NanoKVMNotSupportedError, as before.

@chiconws
chiconws merged commit 6eaa553 into dev Oct 11, 2026
2 checks passed
@chiconws
chiconws deleted the simplify/audit-round-2 branch October 11, 2026 16:41
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.

1 participant