-
How can I execute 'buf generate' without the remote plugin in PYTHON? It's typically hard to build in an environment without internet access. This is my original buf.gen.yaml file, Is there any way to convert to us local plugin
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Remote plugins are regular Protobuf plugins (typically a simple executable named protoc-gen-foo, where "foo" is the language name). If you prefer to use local plugins, you have to install them yourself, and use them in buf.gen.yaml without the protoc-gen- prefix: version: v1
plugins:
- plugin: foo # calls the executable protoc-gen-foo
out: gen See the documentation here. In case of python, you can make this change to use the local plugin: version: v1
plugins:
- - plugin: buf.build/protocolbuffers/python:v25.1
+ - plugin: python
out: gen However, python is a special case because the plugin is built into |
Beta Was this translation helpful? Give feedback.
Ah, I completely missed that you also have gRPC in there.
The gRPC project does not publish a standard Protobuf plugin for python. You can see here how we are building it from source: https://github.com/bufbuild/plugins/blob/main/plugins/grpc/python/v1.60.0/Dockerfile
There is an open feature request on the gRPC project to publish plugins: grpc/grpc#30369