Expose top-level pack/unpack helpers from the Rust extension#1
Draft
Copilot wants to merge 8 commits into
Draft
Conversation
Copilot
AI
changed the title
[WIP] Replace Cython implementation with Rust while maintaining compatibility
Migrate May 29, 2026
msgpack._cmsgpack build path from Cython/C to Rust (PyO3) with API-compatible shim
Copilot
AI
changed the title
Migrate
Implement May 29, 2026
msgpack._cmsgpack build path from Cython/C to Rust (PyO3) with API-compatible shim_cmsgpack.Packer as a Rust-backed class with fallback parity
Copilot
AI
changed the title
Implement
Port May 29, 2026
_cmsgpack.Packer as a Rust-backed class with fallback parity_cmsgpack.Unpacker to Rust wrapper with fallback parity
Copilot
AI
changed the title
Port
Expose top-level pack/unpack helpers from the Rust extension
May 29, 2026
_cmsgpack.Unpacker to Rust wrapper with fallback parity
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.
The Rust
_cmsgpackmodule still routed top-level helper behavior through Python-side wrappers, so the fast path stopped at the class boundary. This change makes the module provide the public helper surface directly, somsgpack.pack*/msgpack.unpack*use the extension implementation when available.Rust module API
pack,packb,unpack, andunpackbto/tmp/workspace/methane/msgpack-python/src/lib.rsunpackberror translationTop-level binding
/tmp/workspace/methane/msgpack-python/msgpack/__init__.pyto import the helper functions from_cmsgpackwhen the extension is activeMSGPACK_PUREPYTHONis set or the extension is unavailableCoverage
/tmp/workspace/methane/msgpack-python/test/test_rust_backend.pyto verify the extension exports the helper functions and that the top-level API resolves to them in extension modeExample:
Original prompt
This pull request was created from Copilot chat.