Skip to content
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

Merged
merged 6 commits into from
Jul 15, 2024

Conversation

HenningHolmDE
Copy link
Contributor

@HenningHolmDE HenningHolmDE commented Jun 24, 2024

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:

Also, before releasing a first Python package to PyPI, these things should probably be considered:

@HenningHolmDE HenningHolmDE changed the title Issue 359 python bindings Implement first version of Python bindings for imap-codec Jun 24, 2024
@HenningHolmDE HenningHolmDE force-pushed the issue_359_python_bindings branch from d77173a to e7d5076 Compare June 24, 2024 12:17
@coveralls
Copy link
Collaborator

coveralls commented Jun 24, 2024

Pull Request Test Coverage Report for Build 9645169959

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 92.678%

Totals Coverage Status
Change from base Build 9634738796: 0.0%
Covered Lines: 10190
Relevant Lines: 10995

💛 - Coveralls

@HenningHolmDE HenningHolmDE force-pushed the issue_359_python_bindings branch from e7d5076 to 6d31177 Compare June 25, 2024 21:07
@coveralls
Copy link
Collaborator

coveralls commented Jun 25, 2024

Pull Request Test Coverage Report for Build 9669612084

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 92.678%

Totals Coverage Status
Change from base Build 9658279125: 0.0%
Covered Lines: 10190
Relevant Lines: 10995

💛 - Coveralls

@HenningHolmDE HenningHolmDE force-pushed the issue_359_python_bindings branch from 6d31177 to 99ad5c5 Compare June 25, 2024 21:13
@coveralls
Copy link
Collaborator

coveralls commented Jun 25, 2024

Pull Request Test Coverage Report for Build 9669683508

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 92.678%

Totals Coverage Status
Change from base Build 9658279125: 0.0%
Covered Lines: 10190
Relevant Lines: 10995

💛 - Coveralls

@HenningHolmDE HenningHolmDE force-pushed the issue_359_python_bindings branch from 99ad5c5 to a0248d1 Compare June 27, 2024 16:18
@coveralls
Copy link
Collaborator

coveralls commented Jun 27, 2024

Pull Request Test Coverage Report for Build 9700099017

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 92.678%

Totals Coverage Status
Change from base Build 9658279125: 0.0%
Covered Lines: 10190
Relevant Lines: 10995

💛 - Coveralls

@HenningHolmDE HenningHolmDE force-pushed the issue_359_python_bindings branch 2 times, most recently from e62a4fc to e53223b Compare July 12, 2024 15:41
@coveralls
Copy link
Collaborator

coveralls commented Jul 12, 2024

Pull Request Test Coverage Report for Build 9936217495

Details

  • 25 of 25 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.01%) to 92.999%

Totals Coverage Status
Change from base Build 9922246693: 0.01%
Covered Lines: 11212
Relevant Lines: 12056

💛 - Coveralls

@HenningHolmDE HenningHolmDE force-pushed the issue_359_python_bindings branch 4 times, most recently from 3225860 to ec57ca7 Compare July 13, 2024 07:49
@HenningHolmDE HenningHolmDE changed the title Implement first version of Python bindings for imap-codec Implement initial iteration of Python bindings for imap-codec Jul 13, 2024
@HenningHolmDE HenningHolmDE force-pushed the issue_359_python_bindings branch from ec57ca7 to ba7c2e2 Compare July 13, 2024 08:31
@HenningHolmDE HenningHolmDE marked this pull request as ready for review July 13, 2024 08:35
Copy link
Collaborator

@jakoschiko jakoschiko left a 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!

bindings/imap-codec-python/examples/common/__init__.py Outdated Show resolved Hide resolved
bindings/imap-codec-python/imap_codec.pyi Outdated Show resolved Hide resolved
bindings/imap-codec-python/imap_codec.pyi Outdated Show resolved Hide resolved
bindings/imap-codec-python/imap_codec.pyi Outdated Show resolved Hide resolved
bindings/imap-codec-python/src/lib.rs Outdated Show resolved Hide resolved
bindings/imap-codec-python/imap_codec.pyi Show resolved Hide resolved
bindings/imap-codec-python/Cargo.toml Show resolved Hide resolved
imap-codec/Cargo.toml Show resolved Hide resolved
@jakoschiko jakoschiko requested a review from duesee July 13, 2024 11:17
Copy link
Owner

@duesee duesee left a 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.

bindings/imap-codec-python/src/lib.rs Outdated Show resolved Hide resolved
imap-codec/src/codec/encode.rs Outdated Show resolved Hide resolved
imap-codec/src/codec/encode.rs Outdated Show resolved Hide resolved
For serialization/deserialization in the Python bindings, add new
`serde` feature that is forwarded to `imap-types`.
@HenningHolmDE HenningHolmDE force-pushed the issue_359_python_bindings branch from ba7c2e2 to 09e900a Compare July 13, 2024 22:35
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.
@HenningHolmDE HenningHolmDE force-pushed the issue_359_python_bindings branch from 09e900a to d7c650b Compare July 14, 2024 10:25
@duesee duesee mentioned this pull request Jul 14, 2024
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`.
@HenningHolmDE HenningHolmDE force-pushed the issue_359_python_bindings branch from d7c650b to 9efadeb Compare July 15, 2024 08:33
@HenningHolmDE
Copy link
Contributor Author

@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.

@duesee
Copy link
Owner

duesee commented Jul 15, 2024

Thanks! Let's get this in then! 🎉

@duesee duesee merged commit 75fd956 into duesee:main Jul 15, 2024
10 checks passed
@HenningHolmDE HenningHolmDE deleted the issue_359_python_bindings branch July 15, 2024 13:12
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.

4 participants