From c041670236b5d7d1e08b8693a8937b1d01e4e7a0 Mon Sep 17 00:00:00 2001 From: Nipunn Koorapati Date: Wed, 19 Oct 2022 23:37:36 -0700 Subject: [PATCH 1/3] Bump the rev of protobuf supported to 4.21.8 Bumping rev of mypy-protobuf incoming next --- scripts/generate_proto_stubs.sh | 9 +++++---- stubs/protobuf/METADATA.toml | 2 +- stubs/protobuf/google/protobuf/descriptor_pb2.pyi | 12 ++++++------ stubs/protobuf/google/protobuf/empty_pb2.pyi | 2 -- 4 files changed, 12 insertions(+), 13 deletions(-) diff --git a/scripts/generate_proto_stubs.sh b/scripts/generate_proto_stubs.sh index 4677d36a8150..0d4a04909ec8 100755 --- a/scripts/generate_proto_stubs.sh +++ b/scripts/generate_proto_stubs.sh @@ -11,7 +11,8 @@ set -ex -o pipefail # followed by committing the changes to typeshed # # Update these two variables when rerunning script -PROTOBUF_VERSION=3.20.1 +PROTOBUF_VERSION=21.8 +PYTHON_PROTOBUF_VERSION=4.21.8 MYPY_PROTOBUF_VERSION=v3.3.0 if uname -a | grep Darwin; then @@ -22,7 +23,7 @@ else fi REPO_ROOT="$(realpath "$(dirname "${BASH_SOURCE[0]}")"/..)" TMP_DIR="$(mktemp -d)" -PYTHON_PROTOBUF_FILENAME="protobuf-python-${PROTOBUF_VERSION}.zip" +PYTHON_PROTOBUF_FILENAME="protobuf-python-${PYTHON_PROTOBUF_VERSION}.zip" PROTOC_FILENAME="protoc-${PROTOBUF_VERSION}-${PLAT}-x86_64.zip" PROTOC_URL="https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOBUF_VERSION}/$PROTOC_FILENAME" PYTHON_PROTOBUF_URL="https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOBUF_VERSION}/$PYTHON_PROTOBUF_FILENAME" @@ -38,7 +39,7 @@ unzip "$PROTOC_FILENAME" -d protoc_install # Fetch protoc-python (which contains all the .proto files) wget "$PYTHON_PROTOBUF_URL" unzip "$PYTHON_PROTOBUF_FILENAME" -PYTHON_PROTOBUF_DIR="protobuf-$PROTOBUF_VERSION" +PYTHON_PROTOBUF_DIR="protobuf-$PYTHON_PROTOBUF_VERSION" # Prepare virtualenv VENV=venv @@ -76,4 +77,4 @@ isort "$REPO_ROOT/stubs/protobuf" black "$REPO_ROOT/stubs/protobuf" sed -i "" "s/mypy-protobuf [^\"]*/mypy-protobuf ${MYPY_PROTOBUF_VERSION}/" "$REPO_ROOT/stubs/protobuf/METADATA.toml" -sed -i "" "s/version = .*$/version = \"$(echo ${PROTOBUF_VERSION} | cut -d. -f1-2)\.\*\"/" "$REPO_ROOT/stubs/protobuf/METADATA.toml" +sed -i "" "s/version = .*$/version = \"$(echo ${PYTHON_PROTOBUF_VERSION} | cut -d. -f1-2)\.\*\"/" "$REPO_ROOT/stubs/protobuf/METADATA.toml" diff --git a/stubs/protobuf/METADATA.toml b/stubs/protobuf/METADATA.toml index 6967a3b44534..8d682de02314 100644 --- a/stubs/protobuf/METADATA.toml +++ b/stubs/protobuf/METADATA.toml @@ -1,2 +1,2 @@ -version = "3.20.*" +version = "4.21.*" extra_description = "Generated with aid from mypy-protobuf v3.3.0" diff --git a/stubs/protobuf/google/protobuf/descriptor_pb2.pyi b/stubs/protobuf/google/protobuf/descriptor_pb2.pyi index 9ee7ef49b2b6..4201fc470f81 100644 --- a/stubs/protobuf/google/protobuf/descriptor_pb2.pyi +++ b/stubs/protobuf/google/protobuf/descriptor_pb2.pyi @@ -1211,8 +1211,8 @@ class UninterpretedOption(google.protobuf.message.Message): """The name of the uninterpreted option. Each string represents a segment in a dot-separated name. is_extension is true iff a segment represents an extension (denoted with parentheses in options specs in .proto files). - E.g.,{ ["foo", false], ["bar.baz", true], ["qux", false] } represents - "foo.(bar.baz).qux". + E.g.,{ ["foo", false], ["bar.baz", true], ["moo", false] } represents + "foo.(bar.baz).moo". """ DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -1344,13 +1344,13 @@ class SourceCodeInfo(google.protobuf.message.Message): // Comment attached to baz. // Another line attached to baz. - // Comment attached to qux. + // Comment attached to moo. // - // Another line attached to qux. - optional double qux = 4; + // Another line attached to moo. + optional double moo = 4; // Detached comment for corge. This is not leading or trailing comments - // to qux or corge because there are blank lines separating it from + // to moo or corge because there are blank lines separating it from // both. // Detached comment for corge paragraph 2. diff --git a/stubs/protobuf/google/protobuf/empty_pb2.pyi b/stubs/protobuf/google/protobuf/empty_pb2.pyi index 97fd53f6d7d5..b58448ea19cb 100644 --- a/stubs/protobuf/google/protobuf/empty_pb2.pyi +++ b/stubs/protobuf/google/protobuf/empty_pb2.pyi @@ -44,8 +44,6 @@ class Empty(google.protobuf.message.Message): service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } - - The JSON representation for `Empty` is empty JSON object `{}`. """ DESCRIPTOR: google.protobuf.descriptor.Descriptor From 15567e6c9bb6ceb1e4cab0ed7a50bb71fe65ca9f Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Thu, 20 Oct 2022 23:11:46 +0100 Subject: [PATCH 2/3] Update stubs/protobuf/METADATA.toml Co-authored-by: Nipunn Koorapati --- stubs/protobuf/METADATA.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stubs/protobuf/METADATA.toml b/stubs/protobuf/METADATA.toml index 8d682de02314..3f2ba6febd6f 100644 --- a/stubs/protobuf/METADATA.toml +++ b/stubs/protobuf/METADATA.toml @@ -1,2 +1,2 @@ -version = "4.21.*" +version = "3.21.*" extra_description = "Generated with aid from mypy-protobuf v3.3.0" From 31638b8026099120fe6d7158ebcc5c5b0943bbab Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Thu, 20 Oct 2022 23:14:17 +0100 Subject: [PATCH 3/3] protobuf==3.21.* doesn't exist --- stubs/protobuf/METADATA.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stubs/protobuf/METADATA.toml b/stubs/protobuf/METADATA.toml index 3f2ba6febd6f..6967a3b44534 100644 --- a/stubs/protobuf/METADATA.toml +++ b/stubs/protobuf/METADATA.toml @@ -1,2 +1,2 @@ -version = "3.21.*" +version = "3.20.*" extra_description = "Generated with aid from mypy-protobuf v3.3.0"