Skip to content

Bump the rev of protobuf supported to 4.21.8 #8937

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Oct 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions scripts/generate_proto_stubs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"
Expand All @@ -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
Expand Down Expand Up @@ -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"
12 changes: 6 additions & 6 deletions stubs/protobuf/google/protobuf/descriptor_pb2.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down
2 changes: 0 additions & 2 deletions stubs/protobuf/google/protobuf/empty_pb2.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down