Repository navigation
Fold the hardware and minimum-version decorators into one - #53
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_hardwaretakes an optionalmin_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 appliesrequire_application_versioninternally, so the checks and error messages are the same.require_application_versionis unchanged and still used on its own for methods that exist on both families with different minimums.excludelist, which named directories that do not exist or that ruff already skips by default, and theF811per-file ignore for tests, which no longer suppresses anything.exclude_linespatterns that match nothing in the package.pragma: no coverandif TYPE_CHECKING:stay.Behaviour changes
None.
min_versionis 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.