Skip to content

v0.6.0

Latest

Choose a tag to compare

@anuraaga anuraaga released this 30 Sep 06:39
· 20 commits to main since this release
3134276

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

  • Any
  • FileDescriptorSet and the rest from descriptor.proto
  • Duration
  • Empty
  • FieldMask
  • ListValue, NullValue, Struct, Value
  • Timestamp
  • BoolValue, and the rest from wrappers.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 GoFeatures

After

from protobuf.wkt.google.protobuf.go_features_pb import GoFeatures

🛠️ Bug fixes

New Contributors

Full Changelog: v0.5.0...v0.6.0