pypi protobuf-py 0.5.0
v0.5.0

latest release: 0.6.0
one month ago

This release includes a breaking change to codegen options - the recently introduced rewrite_imports option was removed in favor of an easier to use map_imports.

rewrite_imports accepted a path glob to match against import statements to rewrite to an external dependency. While enabling the use of external packages such as on the BSR, the syntax was difficult to use, especially since there was no way to set a prefix. We have replaced it with a map_imports option, following the same pattern as released in protobuf-es which instead matches on the path of the proto file being imported, i.e. the string next to import in a proto file. Prefixes are also supported, either with a trailing / or **, so for example, mapping all of protovalidate becomes much simpler.

Before:

plugins:
  - local: protoc-gen-py
    out: src/gen
    opt: rewrite_imports=./buf/validate/**/*_pb.py:

After:

plugins:
  - local: protoc-gen-py
    out: src/gen
    opt: map_imports=buf/validate/:

📈 Enhancements

Full Changelog: v0.4.0...v0.5.0

Don't miss a new protobuf-py release

NewReleases is sending notifications on new releases.