-
-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement initial iteration of Python bindings for imap-codec
#517
Conversation
imap-codec
d77173a
to
e7d5076
Compare
Pull Request Test Coverage Report for Build 9645169959Details
💛 - Coveralls |
e7d5076
to
6d31177
Compare
Pull Request Test Coverage Report for Build 9669612084Details
💛 - Coveralls |
6d31177
to
99ad5c5
Compare
Pull Request Test Coverage Report for Build 9669683508Details
💛 - Coveralls |
99ad5c5
to
a0248d1
Compare
Pull Request Test Coverage Report for Build 9700099017Details
💛 - Coveralls |
e62a4fc
to
e53223b
Compare
Pull Request Test Coverage Report for Build 9936217495Details
💛 - Coveralls |
3225860
to
ec57ca7
Compare
imap-codec
imap-codec
ec57ca7
to
ba7c2e2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks very clean, nice!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much for this diligently coded PR! Let's get it in quickly!
I had one thought about serde_json
but would not block on it.
For serialization/deserialization in the Python bindings, add new `serde` feature that is forwarded to `imap-types`.
ba7c2e2
to
09e900a
Compare
Wrap codecs from `imap-codec` into `pyobject` types to be used from Python. For each of the codecs, the `decode` method is implemented and corresponding Python tests are added to prevent regressions on the bindings. The encoding implementation will be added in a subsequent commit. Currently, the resulting `dict`/`tuple` types are still very rough which should be changed further down the road.
09e900a
to
d7c650b
Compare
As the encoded fragments will deserialized into Python objects, `Fragment` has to implement `Serialize`.
Add `encode` methods to the Python wrappers for the codecs and Python tests for each encoder. Currently, the `dict`/`tuple` types are still very rough, which should be changed further down the road.
This adds Python examples `parse_command`, `parse_greeting` and `parse_response`, which are translated from the Rust examples available for `imap-codec`.
d7c650b
to
9efadeb
Compare
@duesee I think, I've now resolved all open questions or created issues for further tracking. As usual, I've tried to put independent changes into separate commits for easier tracibility lateron, so you might not want to squash them. |
Thanks! Let's get this in then! 🎉 |
This adds the first iteration of Python bindings for
imap-codec
.The first iteration aims to provide a first "usable" version wich a very rough API through
dict
/tuple
types. Switching these types to provide a more Pythonic API should be achieved lateron:Command
,Greeting
) -> binding(Python): Use Python classes for codec messages #559This would make it more clear what the methods accept and return, even if these classes itself are constructed from dictionaries.
Fragment
variants (LineFragment
,LiteralFragment
) -> bindings(Python): Use Python classes forFragment
variants #560Note: This would remove the need for
Fragment
to implementSerialize
, so it might make sense to do this before the next release ofimap-codec
.Also, before releasing a first Python package to PyPI, these things should probably be considered: