Highlight new from_bytes() context manager usage
diego-plan9 opened this issue · 5 comments
Hello,
if my understanding is correct, in #285 the from_bytes()
signature was changed so it now returns a context manager, requiring users to update their usage, ie:
addressBook = addressbook.AddressBook.from_bytes(msg_bytes)
should now be:
with addressbook.AddressBook.from_bytes(msg_bytes) as addressBook:
...
Would it be possible to highlight this change more prominently in the documentation? It seems it was not mentioned explicitly in the changelog and the quickstart seems to be suggesting the pre-1.1.1 form: for context, we were depending on ~1.1.0
on another project, and it took a bit of time to find out the cause of it breaking when the newest pycapnp
version was pulled in.
Thanks for bringing this up!
I'm very sorry about this, I'll try to fix up the documentation over the next couple weeks (I'm also happy to accept PRs in the meantime).
Thanks to you for the prompt response and for being open to addressing it - it's not critical, the goal is "just" to make it easier for other users to update their code to match the latest release. I'll look into the possibility of submitting a PR myself in the upcoming days 🤞
How about calling the current version 1.1.1 version 2.0.0? This is a breaking change and should be reflected in the version number, as per https://semver.org/.
Automatic updates that pull any version but the next major release, will break existing code (as in my case).
I've created a PR for the quick documentation update (#295). I'm also curious why this change didn't affect the from_bytes_packed
function.
I'm sorry for being so slow with this, things are crazy for me during the summer.
I can try to squeeze in a new release, but it seems the windows CI build is failing now... (I use the CI builds for the PyPi artifacts so that will need to be fixed first). Not sure I'll have time to work on that until late August (I'll have limited internet access in a couple weeks, but I'll have enough to do the occasional PR review).