Skip to content

Improve Python bindings and release workflow#103

Merged
maebli merged 1 commit into
mainfrom
agent/improve-python-bindings
Jul 16, 2026
Merged

Improve Python bindings and release workflow#103
maebli merged 1 commit into
mainfrom
agent/improve-python-bindings

Conversation

@maebli

@maebli maebli commented Jul 16, 2026

Copy link
Copy Markdown
Owner

Summary

  • add parse, parse_records, and render as an explicit Python API that accepts hexadecimal text or raw bytes and returns native Python objects where appropriate
  • validate frame input, output formats, and 16-byte AES keys with clear Python exceptions while retaining the legacy string APIs
  • ship type information and build the binding with the Rust parser's decryption feature
  • add wheel-level tests, including a real encrypted wireless telegram
  • validate package/tag versions on CI, test pull requests before release builds, merge artifacts into a predictable publish directory, and restrict PyPI upload to release tags

Why

The existing binding exposed serialized JSON strings instead of normal Python values, silently ignored malformed decryption keys, and did not enable the parser's decryption feature. The Python workflow also only exercised the package after a release tag was pushed, leaving API and packaging regressions undetected until publish time.

Impact

Callers can use a conventional typed Python API, pass either bytes or readable hex, and decrypt supported M-Bus frames with a 16-byte AES key. Existing m_bus_parse and parse_application_layer imports remain available.

Validation

  • cargo fmt --all -- --check
  • cargo check -p pymbusparser
  • cargo clippy -p pymbusparser --all-targets -- -D warnings
  • cargo test -p m-bus-core --features decryption
  • cargo test -p m-bus-parser --features std,decryption
  • release wheel build with Maturin and six installed-wheel unittest cases
  • Maturin source-distribution build and content inspection
  • actionlint .github/workflows/python.yml

@maebli
maebli marked this pull request as ready for review July 16, 2026 19:38
@maebli
maebli merged commit cc42baf into main Jul 16, 2026
13 checks passed
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.

1 participant