Nitrokey / pynitrokey

Python client for Nitrokey devices
Apache License 2.0
94 stars 28 forks source link

fix: improve forwards compatibility with spsdk 2.1+ #524

Closed kmohrf closed 2 months ago

kmohrf commented 2 months ago

Hi,

This PR fixes an incompatibility with spsdk 2.1 which is shipped in Arch Linux. spsdk recently switched to the python-native Enum library and renamed the desc method to get_description in the process.

Changes

get_description is called first and falls back to desc.

Checklist

Make sure to run make check and make fix before creating a PR, otherwise the CI will fail.

Feel free to make this change without attribution if you don’t feel comfortable merging it without the checks :)

Test Environment and Execution

Cheers

Konrad

robin-nitrokey commented 2 months ago

Thank you for the PR! We are currently working on vendoring the spsdk dependency to avoid many unnecessary dependencies, see: https://github.com/Nitrokey/pynitrokey/pull/519. I’m not sure if that will make it into the next release though. Therefore I’d hold off on merging this to avoid additional merge conflicts with #519. If we are closer to a release, we can decide which one to merge.

robin-nitrokey commented 2 months ago

Updated to just use McuBoot.status_string which works for both spsdk 2.0 and spsdk 2.1.