Skip to content
This repository was archived by the owner on Jun 9, 2025. It is now read-only.

Add serialized descriptorprotos to python classes #56

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

MichaelSchuldes
Copy link

Summary

This pull request adds a staticmethod _serialized_pb to the generated enums and message classes that returns the serialized DescriptorProto. From that string it is possible to generate die Proto Descriptors, which are needed if you want to write the OSI messages in an MCAP file using mcap-protobuf-support

See this issue for the necessary parts to set the DESCRIPTOR at runtime in python-betterproto2 python-betterproto2/issues/70.

Checklist

  • If code changes were made then they have been tested.
    • I have updated the documentation to reflect the changes.
  • This PR fixes an issue.
  • This PR adds something new (e.g. new method or parameters).
    • This change has an associated test.
  • This PR is a breaking change (e.g. methods or parameters removed/renamed)
  • This PR is not a code change (e.g. documentation, README, ...)

@MichaelSchuldes MichaelSchuldes force-pushed the descriptors_in_python_class branch from 09b978e to 473f71f Compare May 26, 2025 06:54
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant