From f64e8ed2544838058397d78b466c9a792038c082 Mon Sep 17 00:00:00 2001 From: Ivan Levkivskyi Date: Tue, 5 Jan 2021 18:48:21 +0000 Subject: [PATCH 1/2] A temporary protobuf patch --- third_party/2and3/google/protobuf/struct_pb2.pyi | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/third_party/2and3/google/protobuf/struct_pb2.pyi b/third_party/2and3/google/protobuf/struct_pb2.pyi index 57028561fe5a..c5de4da601b5 100644 --- a/third_party/2and3/google/protobuf/struct_pb2.pyi +++ b/third_party/2and3/google/protobuf/struct_pb2.pyi @@ -50,7 +50,11 @@ DESCRIPTOR: google___protobuf___descriptor___FileDescriptor = ... NullValueValue = typing___NewType('NullValueValue', builtin___int) type___NullValueValue = NullValueValue -NullValue: _NullValue + +# We temporary set this to Any to simplify mypy-protobuf migration, +# replace with `NullValue: _NullValue` after mypy-protobuf 1.24 is out. +NullValue = Any + class _NullValue(google___protobuf___internal___enum_type_wrapper____EnumTypeWrapper[NullValueValue]): DESCRIPTOR: google___protobuf___descriptor___EnumDescriptor = ... NULL_VALUE = typing___cast(NullValueValue, 0) From d0a1b111e13fcafcb56692700d38d7b36e94fab4 Mon Sep 17 00:00:00 2001 From: Ivan Levkivskyi Date: Tue, 5 Jan 2021 18:54:24 +0000 Subject: [PATCH 2/2] Fix --- third_party/2and3/google/protobuf/struct_pb2.pyi | 1 + 1 file changed, 1 insertion(+) diff --git a/third_party/2and3/google/protobuf/struct_pb2.pyi b/third_party/2and3/google/protobuf/struct_pb2.pyi index c5de4da601b5..6c555a0d3aff 100644 --- a/third_party/2and3/google/protobuf/struct_pb2.pyi +++ b/third_party/2and3/google/protobuf/struct_pb2.pyi @@ -27,6 +27,7 @@ from google.protobuf.message import ( ) from typing import ( + Any, Iterable as typing___Iterable, Mapping as typing___Mapping, NewType as typing___NewType,