Preparing for only exporting common WKTs from protobuf.wkt
This release prepares for a breaking change where we only export commonly used types from protobuf.wkt instead of all of them. The current approach has an issue when the names for WKT members collide, which happened with Protobuf Edition 2026. We believe most of the WKT exports are rarely used in applications (some exist only to support protoc plugins for non-Python languages for example) - they will still be available from a fully qualified export path going forward but not protobuf.wkt itself.
In the future, the only items exported from protobuf.wkt will be
AnyFileDescriptorSetand the rest fromdescriptor.protoDurationEmptyFieldMaskListValue,NullValue,Struct,ValueTimestampBoolValue, and the rest fromwrappers.proto
We believe the vast majority of user code will not require any change when other items stop being exported as their use case is very limited.
This release updates the code generator to import WKTs from their fully-qualified import paths instead of the shared module. We continue to export the same items as 0.5.0 so existing generated code can work for one release. 0.7.0 will remove the protobuf.wkt exports except for the above.
Before
from protobuf.wkt import GoFeaturesAfter
from protobuf.wkt.google.protobuf.go_features_pb import GoFeatures🛠️ Bug fixes
- Make Oneof TypeVars covariant by @gabeseltzer in #118
- Merge split map message values in same entry by @anuraaga in #111
New Contributors
- @gabeseltzer made their first contribution in #118
Full Changelog: v0.5.0...v0.6.0