You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
which states that cross-version runtime support isn't guaranteed. gRPC follows a similar policy.
11
+
12
+
In Pulsar's [Docker image](../../../../../docker/pulsar/Dockerfile), the `grpcio` and `protobuf` packages are
13
+
pinned to specific versions. Whenever these versions are updated, the `PYTHON_GRPCIO_VERSION`
14
+
in [src/update_python_protobuf_stubs.sh](../../../../../src/update_python_protobuf_stubs.sh) should also be updated
15
+
and the generated stubs should be regenerated with this script to ensure compatibility.
16
+
17
+
To update the generated stubs, run the following command in the project root directory:
18
+
19
+
```bash
20
+
# run this command from the project root directory
21
+
src/update_python_protobuf_stubs.sh
22
+
```
23
+
24
+
Alternatively, you can run this command to install the required tools in a docker container and update the stubs:
25
+
26
+
```bash
27
+
# run this command from the project root directory
28
+
src/update_python_protobuf_stubs_with_docker.sh
29
+
```
30
+
31
+
When the script is run, it will also print such information to the console:
32
+
33
+
```
34
+
libprotoc library included in grpcio-tools will be used:
35
+
libprotoc 31.0
36
+
The compatible matching protobuf package version in Python is prefixed with '6.'
37
+
Ensure that you are using a compatible version of the protobuf package such as 6.31.0 (or a matching patch version).
38
+
```
39
+
40
+
When pinning the `protobuf` package in your Python project follow this guidance to ensure compatibility of the generated stubs with the `protobuf` package version.
echo"libprotoc library included in grpcio-tools will be used:"
39
+
python3 -m grpc_tools.protoc --version
40
+
echo"The compatible matching protobuf package version in Python is prefixed with '6.'"
41
+
echo"Ensure that you are using a compatible version of the protobuf package such as 6.$(python3 -m grpc_tools.protoc --version | awk '{print $2}') (or a matching patch version)."
42
+
43
+
cd$SCRIPT_DIR/..
44
+
echo"Generating Python gRPC and Protobuf stubs from the .proto files..."
45
+
46
+
# Generate Python gRPC and Protobuf stubs from the .proto files
47
+
48
+
# Generate stubs for Function.proto and InstanceCommunication.proto, used for Pulsar Functions Python runtime
0 commit comments