diff --git a/CHANGELOG.md b/CHANGELOG.md index 7eb5e8e6..0b7b08ab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,9 @@ - Add `_WhichOneofArgType_` and `_WhichOneofReturnType_` type aliases - Use `__new__` overloads for async stubs instead of `TypeVar` based `__init__` overloads. - https://github.com/nipunn1313/mypy-protobuf/issues/707 +- Export stub methods as properties instead of attributes if deprecated and mark as such +- Export enum fields as properties on class level (not module level) enums if deprecated and mark as such +- Export fields as properties with getters/setters if deprecated and mark as such ## 3.7.0 diff --git a/README.md b/README.md index dc794ad8..a0abb128 100644 --- a/README.md +++ b/README.md @@ -102,12 +102,19 @@ See [Changelog](CHANGELOG.md) for full listing * `mypy-protobuf` generates correctly typed `HasField`, `WhichOneof`, and `ClearField` methods. * There are differences in how `mypy-protobuf` and `pyi_out` generate enums. See [this issue](https://github.com/protocolbuffers/protobuf/issues/8175) for details * Type aliases exported for `HasField`, `WhichOneof` and `ClearField` arguments +* Parses comments as docstrings +* `mypy-protobuf` marks enums, enum values, messages, message fields, services, and methods with `@warnings.deprecated` if the deprecation option is set to true. #### Examples `mypy-protobuf`: ```python +""" +@generated by mypy-protobuf. Do not edit manually! +isort:skip_file +Edition version of proto2 file""" + import builtins import google.protobuf.descriptor import google.protobuf.message @@ -132,8 +139,10 @@ class Editions2024SubMessage(google.protobuf.message.Message): *, thing: builtins.str | None = ..., ) -> None: ... - def HasField(self, field_name: typing.Literal["thing", b"thing"]) -> builtins.bool: ... - def ClearField(self, field_name: typing.Literal["thing", b"thing"]) -> None: ... + _HasFieldArgType: typing_extensions.TypeAlias = typing.Literal["thing", b"thing"] + def HasField(self, field_name: _HasFieldArgType) -> builtins.bool: ... + _ClearFieldArgType: typing_extensions.TypeAlias = typing.Literal["thing", b"thing"] + def ClearField(self, field_name: _ClearFieldArgType) -> None: ... Global___Editions2024SubMessage: typing_extensions.TypeAlias = Editions2024SubMessage @@ -167,10 +176,13 @@ class Editions2024Test(google.protobuf.message.Message): implicit_singular: builtins.str = ..., default_singular: builtins.str | None = ..., ) -> None: ... - def HasField(self, field_name: typing.Literal["default_singular", b"default_singular", "explicit_singular", b"explicit_singular", "legacy", b"legacy", "message_field", b"message_field"]) -> builtins.bool: ... - def ClearField(self, field_name: typing.Literal["default_singular", b"default_singular", "explicit_singular", b"explicit_singular", "implicit_singular", b"implicit_singular", "legacy", b"legacy", "message_field", b"message_field"]) -> None: ... + _HasFieldArgType: typing_extensions.TypeAlias = typing.Literal["default_singular", b"default_singular", "explicit_singular", b"explicit_singular", "legacy", b"legacy", "message_field", b"message_field"] + def HasField(self, field_name: _HasFieldArgType) -> builtins.bool: ... + _ClearFieldArgType: typing_extensions.TypeAlias = typing.Literal["default_singular", b"default_singular", "explicit_singular", b"explicit_singular", "implicit_singular", b"implicit_singular", "legacy", b"legacy", "message_field", b"message_field"] + def ClearField(self, field_name: _ClearFieldArgType) -> None: ... Global___Editions2024Test: typing_extensions.TypeAlias = Editions2024Test + ``` Builtin pyi generator: diff --git a/mypy_protobuf/main.py b/mypy_protobuf/main.py index 1a061563..f688c8df 100644 --- a/mypy_protobuf/main.py +++ b/mypy_protobuf/main.py @@ -315,7 +315,7 @@ def _get_comments(self, scl: SourceCodeLocation) -> List[str]: return lines - def _write_deprecation_warning(self, scl: SourceCodeLocation, default_message: str) -> None: + def _get_deprecation_message(self, scl: SourceCodeLocation, default_message: str) -> str: msg = default_message if not self.use_default_depreaction_warnings and (comments := self._get_comments(scl)): # Make sure the comment string is a valid python string literal @@ -327,6 +327,10 @@ def _write_deprecation_warning(self, scl: SourceCodeLocation, default_message: s except SyntaxError as e: print(f"Warning: Deprecation comment {joined} could not be parsed as a python string literal. Using default deprecation message. {e}", file=sys.stderr) pass + return msg + + def _write_deprecation_warning(self, scl: SourceCodeLocation, default_message: str) -> None: + msg = self._get_deprecation_message(scl, default_message) self._write_line( '@{}("""{}""")', self._import("warnings", "deprecated"), @@ -387,16 +391,32 @@ def write_enum_values( values: Iterable[Tuple[int, d.EnumValueDescriptorProto]], value_type: str, scl_prefix: SourceCodeLocation, + *, + class_attributes: bool = False, ) -> None: for i, val in values: if val.name in PYTHON_RESERVED: continue scl = scl_prefix + [i] - self._write_line( - f"{val.name}: {value_type} # {val.number}", - ) - self._write_comments(scl) + # Class level + if class_attributes and val.options.deprecated: + self._write_line("@property") + self._write_deprecation_warning( + scl + [d.EnumValueDescriptorProto.OPTIONS_FIELD_NUMBER] + [d.EnumOptions.DEPRECATED_FIELD_NUMBER], + "This enum value has been marked as deprecated using proto enum value options.", + ) + self._write_line( + f"def {val.name}(self) -> {value_type}: {'' if self._has_comments(scl) else '...'} # {val.number}", + ) + with self._indent(): + self._write_comments(scl) + # Module level or non-deprecated class level + else: + self._write_line( + f"{val.name}: {value_type} # {val.number}", + ) + self._write_comments(scl) def write_module_attributes(self) -> None: wl = self._write_line @@ -443,6 +463,7 @@ def write_enums( [(i, v) for i, v in enumerate(enum_proto.value) if v.name not in PROTO_ENUM_RESERVED], value_type_helper_fq, scl + [d.EnumDescriptorProto.VALUE_FIELD_NUMBER], + class_attributes=True, ) wl("") @@ -461,6 +482,7 @@ def write_enums( if prefix == "": wl("") + # Write the module level constants for enum values self.write_enum_values( enumerate(enum_proto.value), value_type_fq, @@ -533,9 +555,33 @@ def write_messages( continue field_type = self.python_type(field) if is_scalar(field) and field.label != d.FieldDescriptorProto.LABEL_REPEATED: - # Scalar non repeated fields are r/w - wl(f"{field.name}: {field_type}") - self._write_comments(scl + [d.DescriptorProto.FIELD_FIELD_NUMBER, idx]) + # Scalar non repeated fields are r/w, generate getter and setter if deprecated + scl_field = scl + [d.DescriptorProto.FIELD_FIELD_NUMBER, idx] + deprecation_scl_field = scl_field + [d.FieldDescriptorProto.OPTIONS_FIELD_NUMBER] + [d.FieldOptions.DEPRECATED_FIELD_NUMBER] + if field.options.deprecated: + wl("@property") + self._write_deprecation_warning( + deprecation_scl_field, + "This field has been marked as deprecated using proto field options.", + ) + wl(f"def {field.name}(self) -> {field_type}:{' ...' if not self._has_comments(scl_field) else ''}") + if self._has_comments(scl_field): + with self._indent(): + self._write_comments(scl_field) + wl("") + wl(f"@{field.name}.setter") + self._write_deprecation_warning( + deprecation_scl_field, + "This field has been marked as deprecated using proto field options.", + ) + wl(f"def {field.name}(self, value: {field_type}) -> None:{' ...' if not self._has_comments(scl_field) else ''}") + if self._has_comments(scl_field): + with self._indent(): + self._write_comments(scl_field) + wl("") + else: + wl(f"{field.name}: {field_type}") + self._write_comments(scl_field) for idx, field in enumerate(desc.field): if field.name in PYTHON_RESERVED: @@ -545,8 +591,12 @@ def write_messages( # r/o Getters for non-scalar fields and scalar-repeated fields scl_field = scl + [d.DescriptorProto.FIELD_FIELD_NUMBER, idx] wl("@property") - body = " ..." if not self._has_comments(scl_field) else "" - wl(f"def {field.name}(self) -> {field_type}:{body}") + if field.options.deprecated: + self._write_deprecation_warning( + scl_field + [d.FieldDescriptorProto.OPTIONS_FIELD_NUMBER] + [d.FieldOptions.DEPRECATED_FIELD_NUMBER], + "This field has been marked as deprecated using proto field options.", + ) + wl(f"def {field.name}(self) -> {field_type}:{' ...' if not self._has_comments(scl_field) else ''}") if self._has_comments(scl_field): with self._indent(): self._write_comments(scl_field) @@ -878,7 +928,7 @@ def write_grpc_servicer_context(self) -> None: wl("...") wl("") - def write_grpc_stub_methods(self, service: d.ServiceDescriptorProto, scl_prefix: SourceCodeLocation, *, is_async: bool, both: bool = False, ignore_assignment_errors: bool = False) -> None: + def write_grpc_stub_methods(self, service: d.ServiceDescriptorProto, scl_prefix: SourceCodeLocation, *, is_async: bool, both: bool = False, ignore_type_error: bool = False) -> None: wl = self._write_line methods = [(i, m) for i, m in enumerate(service.method) if m.name not in PYTHON_RESERVED] if not methods: @@ -889,17 +939,30 @@ def type_str(method: d.MethodDescriptorProto, is_async: bool) -> str: for i, method in methods: scl = scl_prefix + [d.ServiceDescriptorProto.METHOD_FIELD_NUMBER, i] + is_deprecated = method.options.deprecated + has_comments = self._has_comments(scl) + + # Generate type annotation once if both: - wl( - "{}: {}[{}, {}]", - method.name, - self._import("typing", "Union"), - type_str(method, is_async=False), - type_str(method, is_async=True), + type_annotation = f"{self._import('typing', 'Union')}[{type_str(method, is_async=False)}, {type_str(method, is_async=True)}]" + else: + type_annotation = type_str(method, is_async=is_async) + + if is_deprecated: + wl("@property") + self._write_deprecation_warning( + scl + [d.MethodDescriptorProto.OPTIONS_FIELD_NUMBER, d.MethodOptions.DEPRECATED_FIELD_NUMBER], + "This method has been marked as deprecated using proto method options.", ) + wl(f"def {method.name}(self) -> {type_annotation}:{' ...' if not has_comments else ''}{' # type: ignore[override]' if ignore_type_error else ''}") + + if has_comments: + with self._indent(): + if not self._write_comments(scl): + wl("...") else: - wl("{}: {}{}", method.name, type_str(method, is_async=is_async), "" if not ignore_assignment_errors else " # type: ignore[assignment]") - self._write_comments(scl) + wl(f"{method.name}: {type_annotation}{' # type: ignore[assignment]' if ignore_type_error else ''}") + self._write_comments(scl) def write_grpc_methods(self, service: d.ServiceDescriptorProto, scl_prefix: SourceCodeLocation) -> None: wl = self._write_line @@ -1016,7 +1079,7 @@ def write_grpc_services( if self._write_comments(scl): wl("") wl("def __init__(self, channel: {}) -> None: ...", self._import("grpc.aio", "Channel")) - self.write_grpc_stub_methods(service, scl, is_async=True, ignore_assignment_errors=True) + self.write_grpc_stub_methods(service, scl, is_async=True, ignore_type_error=True) else: # ASYNC only - use Stub name (not AsyncStub) since there's only one type wl("class {}:", class_name) diff --git a/proto/testproto/grpc/dummy.proto b/proto/testproto/grpc/dummy.proto index e6b6fd56..d9075ec4 100644 --- a/proto/testproto/grpc/dummy.proto +++ b/proto/testproto/grpc/dummy.proto @@ -38,6 +38,10 @@ service DeprecatedService { } // DeprecatedMethodNotDeprecatedRequest rpc DeprecatedMethodNotDeprecatedRequest(DummyRequest) returns (DummyReply) { + // Method is deprecated, but request message is not + option deprecated = true; + } + rpc DeprecatedMethodNoComments(DeprecatedRequest) returns (DummyReply) { option deprecated = true; } } diff --git a/proto/testproto/test.proto b/proto/testproto/test.proto index 34d58399..5469099c 100644 --- a/proto/testproto/test.proto +++ b/proto/testproto/test.proto @@ -175,6 +175,9 @@ message DeprecatedMessage { option deprecated = true; optional string a_string = 1; + optional string deprecated_field = 2 [deprecated = true]; + // This field is deprecated with comment + optional string deprecated_field_with_comment = 3 [deprecated = true]; } message DeprecatedMessageBadComment { @@ -193,6 +196,10 @@ enum DeprecatedEnum { option deprecated = true; // Trailing comment - DEPRECATED_ONE = 1; - DEPRECATED_TWO = 2; + DEPRECATED_ONE = 1 [ + // This enum value is deprecated but this message doesn't show + deprecated = true + ]; // Trailing comment for enum value + DEPRECATED_TWO = 2 [deprecated = true]; + NOT_DEPRECATED = 3; } diff --git a/pyproject.toml b/pyproject.toml index a15fcfac..6bf95b03 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,7 +13,7 @@ line-length = 10000 [tool.isort] profile = "black" skip_gitignore = true -extend_skip_glob = ["*_pb2.py", "*_pb2_grpc.py"] +extend_skip_glob = ["*_pb2.py"] [tool.mypy] strict = true diff --git a/run_test.sh b/run_test.sh index 190aa587..0a7aff5a 100755 --- a/run_test.sh +++ b/run_test.sh @@ -197,6 +197,7 @@ for PY_VER in $PY_VER_UNIT_TESTS; do if [[ "$PY_VER_MYPY" == "3.13.9" ]] || [[ "$PY_VER_MYPY" == "3.14.0" ]]; then echo "Skipping stubtest for Python $PY_VER_MYPY until positional argument decision is made" else + echo "Running stubtest for Python $PY_VER_MYPY with API implementation: $API_IMPL" PYTHONPATH=test/generated python3 -m mypy.stubtest ${CUSTOM_TYPESHED_DIR_ARG:+"$CUSTOM_TYPESHED_DIR_ARG"} --allowlist stubtest_allowlist.txt testproto fi fi diff --git a/stubtest_allowlist.txt b/stubtest_allowlist.txt index c6f72f6d..def734e6 100644 --- a/stubtest_allowlist.txt +++ b/stubtest_allowlist.txt @@ -36,6 +36,7 @@ testproto.nested.nested_pb2.AnotherNested.NestedMessage.NESTED_ENUM2 testproto.nested.nested_pb2.AnotherNested.INVALID testproto.test_pb2.DEPRECATED_ONE testproto.test_pb2.DEPRECATED_TWO +testproto.test_pb2.NOT_DEPRECATED # Our enum types and helper types aren't there at runtime (Dynamic EnumTypeWrapper at runtime) # .*\..*EnumTypeWrapper$ @@ -246,9 +247,14 @@ testproto.test_pb2.Extensions1.ext .*_WhichOneofReturnType.* .*_WhichOneofArgType.* -# -testproto.grpc.dummy_pb2_grpc.DeprecatedServiceStub.__init__ -testproto.grpc.dummy_pb2_grpc.DummyServiceStub.__init__ -testproto.grpc.dummy_pb2_grpc.ManyRPCsServiceStub.__init__ -testproto.grpc.import_pb2_grpc.SimpleServiceStub.__init__ +# Because we represent methods as properties, they do not exist at runtime +testproto.grpc.dummy_pb2_grpc.DeprecatedServiceStub.* +testproto.grpc.dummy_pb2_grpc.DummyServiceStub.* +testproto.grpc.dummy_pb2_grpc.ManyRPCsServiceStub.* +testproto.grpc.import_pb2_grpc.SimpleServiceStub.* testproto.grpc.dummy_pb2_grpc.EmptyServiceStub.__init__ + +# Because we generate message fields as properties when deprecated they do not exist at runtime +testproto.grpc.dummy_pb2.DeprecatedRequest.old_field +testproto.test_pb2.DeprecatedMessage.deprecated_field +testproto.test_pb2.DeprecatedMessage.deprecated_field_with_comment diff --git a/test/generated/testproto/grpc/dummy_pb2.pyi b/test/generated/testproto/grpc/dummy_pb2.pyi index 94987554..2c0487e6 100644 --- a/test/generated/testproto/grpc/dummy_pb2.pyi +++ b/test/generated/testproto/grpc/dummy_pb2.pyi @@ -59,7 +59,12 @@ class DeprecatedRequest(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor OLD_FIELD_FIELD_NUMBER: builtins.int - old_field: builtins.str + @property + @deprecated("""This field has been marked as deprecated using proto field options.""") + def old_field(self) -> builtins.str: ... + @old_field.setter + @deprecated("""This field has been marked as deprecated using proto field options.""") + def old_field(self, value: builtins.str) -> None: ... def __init__( self, *, diff --git a/test/generated/testproto/grpc/dummy_pb2_grpc.pyi b/test/generated/testproto/grpc/dummy_pb2_grpc.pyi index 8c6684e8..afce01d2 100644 --- a/test/generated/testproto/grpc/dummy_pb2_grpc.pyi +++ b/test/generated/testproto/grpc/dummy_pb2_grpc.pyi @@ -101,10 +101,17 @@ class DeprecatedServiceStub: def __new__(cls, channel: grpc.Channel) -> DeprecatedServiceStub: ... @typing.overload def __new__(cls, channel: grpc.aio.Channel) -> DeprecatedServiceAsyncStub: ... - DeprecatedMethod: grpc.UnaryUnaryMultiCallable[testproto.grpc.dummy_pb2.DeprecatedRequest, testproto.grpc.dummy_pb2.DummyReply] - """DeprecatedMethod""" - DeprecatedMethodNotDeprecatedRequest: grpc.UnaryUnaryMultiCallable[testproto.grpc.dummy_pb2.DummyRequest, testproto.grpc.dummy_pb2.DummyReply] - """DeprecatedMethodNotDeprecatedRequest""" + @property + @deprecated("""This method has been marked as deprecated using proto method options.""") + def DeprecatedMethod(self) -> grpc.UnaryUnaryMultiCallable[testproto.grpc.dummy_pb2.DeprecatedRequest, testproto.grpc.dummy_pb2.DummyReply]: + """DeprecatedMethod""" + @property + @deprecated("""Method is deprecated, but request message is not""") + def DeprecatedMethodNotDeprecatedRequest(self) -> grpc.UnaryUnaryMultiCallable[testproto.grpc.dummy_pb2.DummyRequest, testproto.grpc.dummy_pb2.DummyReply]: + """DeprecatedMethodNotDeprecatedRequest""" + @property + @deprecated("""This method has been marked as deprecated using proto method options.""") + def DeprecatedMethodNoComments(self) -> grpc.UnaryUnaryMultiCallable[testproto.grpc.dummy_pb2.DeprecatedRequest, testproto.grpc.dummy_pb2.DummyReply]: ... @deprecated("""This service is deprecated""") @typing.type_check_only @@ -112,10 +119,17 @@ class DeprecatedServiceAsyncStub(DeprecatedServiceStub): """Marking the service as deprecated""" def __init__(self, channel: grpc.aio.Channel) -> None: ... - DeprecatedMethod: grpc.aio.UnaryUnaryMultiCallable[testproto.grpc.dummy_pb2.DeprecatedRequest, testproto.grpc.dummy_pb2.DummyReply] # type: ignore[assignment] - """DeprecatedMethod""" - DeprecatedMethodNotDeprecatedRequest: grpc.aio.UnaryUnaryMultiCallable[testproto.grpc.dummy_pb2.DummyRequest, testproto.grpc.dummy_pb2.DummyReply] # type: ignore[assignment] - """DeprecatedMethodNotDeprecatedRequest""" + @property + @deprecated("""This method has been marked as deprecated using proto method options.""") + def DeprecatedMethod(self) -> grpc.aio.UnaryUnaryMultiCallable[testproto.grpc.dummy_pb2.DeprecatedRequest, testproto.grpc.dummy_pb2.DummyReply]: # type: ignore[override] + """DeprecatedMethod""" + @property + @deprecated("""Method is deprecated, but request message is not""") + def DeprecatedMethodNotDeprecatedRequest(self) -> grpc.aio.UnaryUnaryMultiCallable[testproto.grpc.dummy_pb2.DummyRequest, testproto.grpc.dummy_pb2.DummyReply]: # type: ignore[override] + """DeprecatedMethodNotDeprecatedRequest""" + @property + @deprecated("""This method has been marked as deprecated using proto method options.""") + def DeprecatedMethodNoComments(self) -> grpc.aio.UnaryUnaryMultiCallable[testproto.grpc.dummy_pb2.DeprecatedRequest, testproto.grpc.dummy_pb2.DummyReply]: ... # type: ignore[override] @deprecated("""This service is deprecated""") class DeprecatedServiceServicer(metaclass=abc.ABCMeta): @@ -137,6 +151,13 @@ class DeprecatedServiceServicer(metaclass=abc.ABCMeta): ) -> typing.Union[testproto.grpc.dummy_pb2.DummyReply, collections.abc.Awaitable[testproto.grpc.dummy_pb2.DummyReply]]: """DeprecatedMethodNotDeprecatedRequest""" + @abc.abstractmethod + def DeprecatedMethodNoComments( + self, + request: testproto.grpc.dummy_pb2.DeprecatedRequest, + context: _ServicerContext, + ) -> typing.Union[testproto.grpc.dummy_pb2.DummyReply, collections.abc.Awaitable[testproto.grpc.dummy_pb2.DummyReply]]: ... + @deprecated("""This service is deprecated""") def add_DeprecatedServiceServicer_to_server(servicer: DeprecatedServiceServicer, server: typing.Union[grpc.Server, grpc.aio.Server]) -> None: ... diff --git a/test/generated/testproto/test_pb2.pyi b/test/generated/testproto/test_pb2.pyi index 94e646db..25129fe0 100644 --- a/test/generated/testproto/test_pb2.pyi +++ b/test/generated/testproto/test_pb2.pyi @@ -77,14 +77,22 @@ class _DeprecatedEnum: class _DeprecatedEnumEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_DeprecatedEnum.ValueType], builtins.type): DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor - DEPRECATED_ONE: _DeprecatedEnum.ValueType # 1 - DEPRECATED_TWO: _DeprecatedEnum.ValueType # 2 + @property + @deprecated("""This enum value has been marked as deprecated using proto enum value options.""") + def DEPRECATED_ONE(self) -> _DeprecatedEnum.ValueType: # 1 + """Trailing comment for enum value""" + @property + @deprecated("""This enum value has been marked as deprecated using proto enum value options.""") + def DEPRECATED_TWO(self) -> _DeprecatedEnum.ValueType: ... # 2 + NOT_DEPRECATED: _DeprecatedEnum.ValueType # 3 @deprecated("""This enum is deprecated\n2 lines of comments\n"Quotes in comments"\nand 'single quotes'\nTrailing comment""") class DeprecatedEnum(_DeprecatedEnum, metaclass=_DeprecatedEnumEnumTypeWrapper): ... DEPRECATED_ONE: DeprecatedEnum.ValueType # 1 +"""Trailing comment for enum value""" DEPRECATED_TWO: DeprecatedEnum.ValueType # 2 +NOT_DEPRECATED: DeprecatedEnum.ValueType # 3 Global___DeprecatedEnum: typing_extensions.TypeAlias = DeprecatedEnum @typing.final @@ -432,15 +440,35 @@ class DeprecatedMessage(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor A_STRING_FIELD_NUMBER: builtins.int + DEPRECATED_FIELD_FIELD_NUMBER: builtins.int + DEPRECATED_FIELD_WITH_COMMENT_FIELD_NUMBER: builtins.int a_string: builtins.str + @property + @deprecated("""This field has been marked as deprecated using proto field options.""") + def deprecated_field(self) -> builtins.str: ... + @deprecated_field.setter + @deprecated("""This field has been marked as deprecated using proto field options.""") + def deprecated_field(self, value: builtins.str) -> None: ... + @property + @deprecated("""This field has been marked as deprecated using proto field options.""") + def deprecated_field_with_comment(self) -> builtins.str: + """This field is deprecated with comment""" + + @deprecated_field_with_comment.setter + @deprecated("""This field has been marked as deprecated using proto field options.""") + def deprecated_field_with_comment(self, value: builtins.str) -> None: + """This field is deprecated with comment""" + def __init__( self, *, a_string: builtins.str | None = ..., + deprecated_field: builtins.str | None = ..., + deprecated_field_with_comment: builtins.str | None = ..., ) -> None: ... - _HasFieldArgType: typing_extensions.TypeAlias = typing.Literal["a_string", b"a_string"] + _HasFieldArgType: typing_extensions.TypeAlias = typing.Literal["a_string", b"a_string", "deprecated_field", b"deprecated_field", "deprecated_field_with_comment", b"deprecated_field_with_comment"] def HasField(self, field_name: _HasFieldArgType) -> builtins.bool: ... - _ClearFieldArgType: typing_extensions.TypeAlias = typing.Literal["a_string", b"a_string"] + _ClearFieldArgType: typing_extensions.TypeAlias = typing.Literal["a_string", b"a_string", "deprecated_field", b"deprecated_field", "deprecated_field_with_comment", b"deprecated_field_with_comment"] def ClearField(self, field_name: _ClearFieldArgType) -> None: ... Global___DeprecatedMessage: typing_extensions.TypeAlias = DeprecatedMessage diff --git a/test/generated_async_only/testproto/grpc/dummy_pb2.pyi b/test/generated_async_only/testproto/grpc/dummy_pb2.pyi index 94987554..2c0487e6 100644 --- a/test/generated_async_only/testproto/grpc/dummy_pb2.pyi +++ b/test/generated_async_only/testproto/grpc/dummy_pb2.pyi @@ -59,7 +59,12 @@ class DeprecatedRequest(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor OLD_FIELD_FIELD_NUMBER: builtins.int - old_field: builtins.str + @property + @deprecated("""This field has been marked as deprecated using proto field options.""") + def old_field(self) -> builtins.str: ... + @old_field.setter + @deprecated("""This field has been marked as deprecated using proto field options.""") + def old_field(self, value: builtins.str) -> None: ... def __init__( self, *, diff --git a/test/generated_async_only/testproto/grpc/dummy_pb2_grpc.pyi b/test/generated_async_only/testproto/grpc/dummy_pb2_grpc.pyi index 009b200c..a3d0facd 100644 --- a/test/generated_async_only/testproto/grpc/dummy_pb2_grpc.pyi +++ b/test/generated_async_only/testproto/grpc/dummy_pb2_grpc.pyi @@ -75,10 +75,17 @@ class DeprecatedServiceStub: """Marking the service as deprecated""" def __init__(self, channel: grpc.aio.Channel) -> None: ... - DeprecatedMethod: grpc.aio.UnaryUnaryMultiCallable[testproto.grpc.dummy_pb2.DeprecatedRequest, testproto.grpc.dummy_pb2.DummyReply] - """DeprecatedMethod""" - DeprecatedMethodNotDeprecatedRequest: grpc.aio.UnaryUnaryMultiCallable[testproto.grpc.dummy_pb2.DummyRequest, testproto.grpc.dummy_pb2.DummyReply] - """DeprecatedMethodNotDeprecatedRequest""" + @property + @deprecated("""This method has been marked as deprecated using proto method options.""") + def DeprecatedMethod(self) -> grpc.aio.UnaryUnaryMultiCallable[testproto.grpc.dummy_pb2.DeprecatedRequest, testproto.grpc.dummy_pb2.DummyReply]: + """DeprecatedMethod""" + @property + @deprecated("""Method is deprecated, but request message is not""") + def DeprecatedMethodNotDeprecatedRequest(self) -> grpc.aio.UnaryUnaryMultiCallable[testproto.grpc.dummy_pb2.DummyRequest, testproto.grpc.dummy_pb2.DummyReply]: + """DeprecatedMethodNotDeprecatedRequest""" + @property + @deprecated("""This method has been marked as deprecated using proto method options.""") + def DeprecatedMethodNoComments(self) -> grpc.aio.UnaryUnaryMultiCallable[testproto.grpc.dummy_pb2.DeprecatedRequest, testproto.grpc.dummy_pb2.DummyReply]: ... @deprecated("""This service is deprecated""") class DeprecatedServiceServicer(metaclass=abc.ABCMeta): @@ -100,6 +107,13 @@ class DeprecatedServiceServicer(metaclass=abc.ABCMeta): ) -> collections.abc.Awaitable[testproto.grpc.dummy_pb2.DummyReply]: """DeprecatedMethodNotDeprecatedRequest""" + @abc.abstractmethod + def DeprecatedMethodNoComments( + self, + request: testproto.grpc.dummy_pb2.DeprecatedRequest, + context: grpc.aio.ServicerContext[testproto.grpc.dummy_pb2.DeprecatedRequest, collections.abc.Awaitable[testproto.grpc.dummy_pb2.DummyReply]], + ) -> collections.abc.Awaitable[testproto.grpc.dummy_pb2.DummyReply]: ... + @deprecated("""This service is deprecated""") def add_DeprecatedServiceServicer_to_server(servicer: DeprecatedServiceServicer, server: grpc.aio.Server) -> None: ... diff --git a/test/generated_async_only/testproto/test_pb2.pyi b/test/generated_async_only/testproto/test_pb2.pyi index 94e646db..25129fe0 100644 --- a/test/generated_async_only/testproto/test_pb2.pyi +++ b/test/generated_async_only/testproto/test_pb2.pyi @@ -77,14 +77,22 @@ class _DeprecatedEnum: class _DeprecatedEnumEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_DeprecatedEnum.ValueType], builtins.type): DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor - DEPRECATED_ONE: _DeprecatedEnum.ValueType # 1 - DEPRECATED_TWO: _DeprecatedEnum.ValueType # 2 + @property + @deprecated("""This enum value has been marked as deprecated using proto enum value options.""") + def DEPRECATED_ONE(self) -> _DeprecatedEnum.ValueType: # 1 + """Trailing comment for enum value""" + @property + @deprecated("""This enum value has been marked as deprecated using proto enum value options.""") + def DEPRECATED_TWO(self) -> _DeprecatedEnum.ValueType: ... # 2 + NOT_DEPRECATED: _DeprecatedEnum.ValueType # 3 @deprecated("""This enum is deprecated\n2 lines of comments\n"Quotes in comments"\nand 'single quotes'\nTrailing comment""") class DeprecatedEnum(_DeprecatedEnum, metaclass=_DeprecatedEnumEnumTypeWrapper): ... DEPRECATED_ONE: DeprecatedEnum.ValueType # 1 +"""Trailing comment for enum value""" DEPRECATED_TWO: DeprecatedEnum.ValueType # 2 +NOT_DEPRECATED: DeprecatedEnum.ValueType # 3 Global___DeprecatedEnum: typing_extensions.TypeAlias = DeprecatedEnum @typing.final @@ -432,15 +440,35 @@ class DeprecatedMessage(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor A_STRING_FIELD_NUMBER: builtins.int + DEPRECATED_FIELD_FIELD_NUMBER: builtins.int + DEPRECATED_FIELD_WITH_COMMENT_FIELD_NUMBER: builtins.int a_string: builtins.str + @property + @deprecated("""This field has been marked as deprecated using proto field options.""") + def deprecated_field(self) -> builtins.str: ... + @deprecated_field.setter + @deprecated("""This field has been marked as deprecated using proto field options.""") + def deprecated_field(self, value: builtins.str) -> None: ... + @property + @deprecated("""This field has been marked as deprecated using proto field options.""") + def deprecated_field_with_comment(self) -> builtins.str: + """This field is deprecated with comment""" + + @deprecated_field_with_comment.setter + @deprecated("""This field has been marked as deprecated using proto field options.""") + def deprecated_field_with_comment(self, value: builtins.str) -> None: + """This field is deprecated with comment""" + def __init__( self, *, a_string: builtins.str | None = ..., + deprecated_field: builtins.str | None = ..., + deprecated_field_with_comment: builtins.str | None = ..., ) -> None: ... - _HasFieldArgType: typing_extensions.TypeAlias = typing.Literal["a_string", b"a_string"] + _HasFieldArgType: typing_extensions.TypeAlias = typing.Literal["a_string", b"a_string", "deprecated_field", b"deprecated_field", "deprecated_field_with_comment", b"deprecated_field_with_comment"] def HasField(self, field_name: _HasFieldArgType) -> builtins.bool: ... - _ClearFieldArgType: typing_extensions.TypeAlias = typing.Literal["a_string", b"a_string"] + _ClearFieldArgType: typing_extensions.TypeAlias = typing.Literal["a_string", b"a_string", "deprecated_field", b"deprecated_field", "deprecated_field_with_comment", b"deprecated_field_with_comment"] def ClearField(self, field_name: _ClearFieldArgType) -> None: ... Global___DeprecatedMessage: typing_extensions.TypeAlias = DeprecatedMessage diff --git a/test/generated_concrete/testproto/grpc/dummy_pb2.pyi b/test/generated_concrete/testproto/grpc/dummy_pb2.pyi index 94987554..2c0487e6 100644 --- a/test/generated_concrete/testproto/grpc/dummy_pb2.pyi +++ b/test/generated_concrete/testproto/grpc/dummy_pb2.pyi @@ -59,7 +59,12 @@ class DeprecatedRequest(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor OLD_FIELD_FIELD_NUMBER: builtins.int - old_field: builtins.str + @property + @deprecated("""This field has been marked as deprecated using proto field options.""") + def old_field(self) -> builtins.str: ... + @old_field.setter + @deprecated("""This field has been marked as deprecated using proto field options.""") + def old_field(self, value: builtins.str) -> None: ... def __init__( self, *, diff --git a/test/generated_concrete/testproto/grpc/dummy_pb2_grpc.pyi b/test/generated_concrete/testproto/grpc/dummy_pb2_grpc.pyi index c0d70574..7e2bc1ed 100644 --- a/test/generated_concrete/testproto/grpc/dummy_pb2_grpc.pyi +++ b/test/generated_concrete/testproto/grpc/dummy_pb2_grpc.pyi @@ -97,10 +97,17 @@ class DeprecatedServiceStub: def __new__(cls, channel: grpc.Channel) -> DeprecatedServiceStub: ... @typing.overload def __new__(cls, channel: grpc.aio.Channel) -> DeprecatedServiceAsyncStub: ... - DeprecatedMethod: grpc.UnaryUnaryMultiCallable[testproto.grpc.dummy_pb2.DeprecatedRequest, testproto.grpc.dummy_pb2.DummyReply] - """DeprecatedMethod""" - DeprecatedMethodNotDeprecatedRequest: grpc.UnaryUnaryMultiCallable[testproto.grpc.dummy_pb2.DummyRequest, testproto.grpc.dummy_pb2.DummyReply] - """DeprecatedMethodNotDeprecatedRequest""" + @property + @deprecated("""This method has been marked as deprecated using proto method options.""") + def DeprecatedMethod(self) -> grpc.UnaryUnaryMultiCallable[testproto.grpc.dummy_pb2.DeprecatedRequest, testproto.grpc.dummy_pb2.DummyReply]: + """DeprecatedMethod""" + @property + @deprecated("""Method is deprecated, but request message is not""") + def DeprecatedMethodNotDeprecatedRequest(self) -> grpc.UnaryUnaryMultiCallable[testproto.grpc.dummy_pb2.DummyRequest, testproto.grpc.dummy_pb2.DummyReply]: + """DeprecatedMethodNotDeprecatedRequest""" + @property + @deprecated("""This method has been marked as deprecated using proto method options.""") + def DeprecatedMethodNoComments(self) -> grpc.UnaryUnaryMultiCallable[testproto.grpc.dummy_pb2.DeprecatedRequest, testproto.grpc.dummy_pb2.DummyReply]: ... @deprecated("""This service is deprecated""") @typing.type_check_only @@ -108,10 +115,17 @@ class DeprecatedServiceAsyncStub(DeprecatedServiceStub): """Marking the service as deprecated""" def __init__(self, channel: grpc.aio.Channel) -> None: ... - DeprecatedMethod: grpc.aio.UnaryUnaryMultiCallable[testproto.grpc.dummy_pb2.DeprecatedRequest, testproto.grpc.dummy_pb2.DummyReply] # type: ignore[assignment] - """DeprecatedMethod""" - DeprecatedMethodNotDeprecatedRequest: grpc.aio.UnaryUnaryMultiCallable[testproto.grpc.dummy_pb2.DummyRequest, testproto.grpc.dummy_pb2.DummyReply] # type: ignore[assignment] - """DeprecatedMethodNotDeprecatedRequest""" + @property + @deprecated("""This method has been marked as deprecated using proto method options.""") + def DeprecatedMethod(self) -> grpc.aio.UnaryUnaryMultiCallable[testproto.grpc.dummy_pb2.DeprecatedRequest, testproto.grpc.dummy_pb2.DummyReply]: # type: ignore[override] + """DeprecatedMethod""" + @property + @deprecated("""Method is deprecated, but request message is not""") + def DeprecatedMethodNotDeprecatedRequest(self) -> grpc.aio.UnaryUnaryMultiCallable[testproto.grpc.dummy_pb2.DummyRequest, testproto.grpc.dummy_pb2.DummyReply]: # type: ignore[override] + """DeprecatedMethodNotDeprecatedRequest""" + @property + @deprecated("""This method has been marked as deprecated using proto method options.""") + def DeprecatedMethodNoComments(self) -> grpc.aio.UnaryUnaryMultiCallable[testproto.grpc.dummy_pb2.DeprecatedRequest, testproto.grpc.dummy_pb2.DummyReply]: ... # type: ignore[override] @deprecated("""This service is deprecated""") class DeprecatedServiceServicer: @@ -131,6 +145,12 @@ class DeprecatedServiceServicer: ) -> typing.Union[testproto.grpc.dummy_pb2.DummyReply, collections.abc.Awaitable[testproto.grpc.dummy_pb2.DummyReply]]: """DeprecatedMethodNotDeprecatedRequest""" + def DeprecatedMethodNoComments( + self, + request: testproto.grpc.dummy_pb2.DeprecatedRequest, + context: _ServicerContext, + ) -> typing.Union[testproto.grpc.dummy_pb2.DummyReply, collections.abc.Awaitable[testproto.grpc.dummy_pb2.DummyReply]]: ... + @deprecated("""This service is deprecated""") def add_DeprecatedServiceServicer_to_server(servicer: DeprecatedServiceServicer, server: typing.Union[grpc.Server, grpc.aio.Server]) -> None: ... diff --git a/test/generated_concrete/testproto/test_pb2.pyi b/test/generated_concrete/testproto/test_pb2.pyi index 94e646db..25129fe0 100644 --- a/test/generated_concrete/testproto/test_pb2.pyi +++ b/test/generated_concrete/testproto/test_pb2.pyi @@ -77,14 +77,22 @@ class _DeprecatedEnum: class _DeprecatedEnumEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_DeprecatedEnum.ValueType], builtins.type): DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor - DEPRECATED_ONE: _DeprecatedEnum.ValueType # 1 - DEPRECATED_TWO: _DeprecatedEnum.ValueType # 2 + @property + @deprecated("""This enum value has been marked as deprecated using proto enum value options.""") + def DEPRECATED_ONE(self) -> _DeprecatedEnum.ValueType: # 1 + """Trailing comment for enum value""" + @property + @deprecated("""This enum value has been marked as deprecated using proto enum value options.""") + def DEPRECATED_TWO(self) -> _DeprecatedEnum.ValueType: ... # 2 + NOT_DEPRECATED: _DeprecatedEnum.ValueType # 3 @deprecated("""This enum is deprecated\n2 lines of comments\n"Quotes in comments"\nand 'single quotes'\nTrailing comment""") class DeprecatedEnum(_DeprecatedEnum, metaclass=_DeprecatedEnumEnumTypeWrapper): ... DEPRECATED_ONE: DeprecatedEnum.ValueType # 1 +"""Trailing comment for enum value""" DEPRECATED_TWO: DeprecatedEnum.ValueType # 2 +NOT_DEPRECATED: DeprecatedEnum.ValueType # 3 Global___DeprecatedEnum: typing_extensions.TypeAlias = DeprecatedEnum @typing.final @@ -432,15 +440,35 @@ class DeprecatedMessage(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor A_STRING_FIELD_NUMBER: builtins.int + DEPRECATED_FIELD_FIELD_NUMBER: builtins.int + DEPRECATED_FIELD_WITH_COMMENT_FIELD_NUMBER: builtins.int a_string: builtins.str + @property + @deprecated("""This field has been marked as deprecated using proto field options.""") + def deprecated_field(self) -> builtins.str: ... + @deprecated_field.setter + @deprecated("""This field has been marked as deprecated using proto field options.""") + def deprecated_field(self, value: builtins.str) -> None: ... + @property + @deprecated("""This field has been marked as deprecated using proto field options.""") + def deprecated_field_with_comment(self) -> builtins.str: + """This field is deprecated with comment""" + + @deprecated_field_with_comment.setter + @deprecated("""This field has been marked as deprecated using proto field options.""") + def deprecated_field_with_comment(self, value: builtins.str) -> None: + """This field is deprecated with comment""" + def __init__( self, *, a_string: builtins.str | None = ..., + deprecated_field: builtins.str | None = ..., + deprecated_field_with_comment: builtins.str | None = ..., ) -> None: ... - _HasFieldArgType: typing_extensions.TypeAlias = typing.Literal["a_string", b"a_string"] + _HasFieldArgType: typing_extensions.TypeAlias = typing.Literal["a_string", b"a_string", "deprecated_field", b"deprecated_field", "deprecated_field_with_comment", b"deprecated_field_with_comment"] def HasField(self, field_name: _HasFieldArgType) -> builtins.bool: ... - _ClearFieldArgType: typing_extensions.TypeAlias = typing.Literal["a_string", b"a_string"] + _ClearFieldArgType: typing_extensions.TypeAlias = typing.Literal["a_string", b"a_string", "deprecated_field", b"deprecated_field", "deprecated_field_with_comment", b"deprecated_field_with_comment"] def ClearField(self, field_name: _ClearFieldArgType) -> None: ... Global___DeprecatedMessage: typing_extensions.TypeAlias = DeprecatedMessage diff --git a/test/generated_sync_only/testproto/grpc/dummy_pb2.pyi b/test/generated_sync_only/testproto/grpc/dummy_pb2.pyi index 94987554..2c0487e6 100644 --- a/test/generated_sync_only/testproto/grpc/dummy_pb2.pyi +++ b/test/generated_sync_only/testproto/grpc/dummy_pb2.pyi @@ -59,7 +59,12 @@ class DeprecatedRequest(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor OLD_FIELD_FIELD_NUMBER: builtins.int - old_field: builtins.str + @property + @deprecated("""This field has been marked as deprecated using proto field options.""") + def old_field(self) -> builtins.str: ... + @old_field.setter + @deprecated("""This field has been marked as deprecated using proto field options.""") + def old_field(self, value: builtins.str) -> None: ... def __init__( self, *, diff --git a/test/generated_sync_only/testproto/grpc/dummy_pb2_grpc.pyi b/test/generated_sync_only/testproto/grpc/dummy_pb2_grpc.pyi index f389dbb2..7211af0d 100644 --- a/test/generated_sync_only/testproto/grpc/dummy_pb2_grpc.pyi +++ b/test/generated_sync_only/testproto/grpc/dummy_pb2_grpc.pyi @@ -6,6 +6,7 @@ https://github.com/vmagamedov/grpclib/blob/master/tests/dummy.proto""" import abc import collections.abc import grpc +import grpc.aio import sys import testproto.grpc.dummy_pb2 import typing @@ -74,10 +75,17 @@ class DeprecatedServiceStub: """Marking the service as deprecated""" def __init__(self, channel: grpc.Channel) -> None: ... - DeprecatedMethod: grpc.UnaryUnaryMultiCallable[testproto.grpc.dummy_pb2.DeprecatedRequest, testproto.grpc.dummy_pb2.DummyReply] - """DeprecatedMethod""" - DeprecatedMethodNotDeprecatedRequest: grpc.UnaryUnaryMultiCallable[testproto.grpc.dummy_pb2.DummyRequest, testproto.grpc.dummy_pb2.DummyReply] - """DeprecatedMethodNotDeprecatedRequest""" + @property + @deprecated("""This method has been marked as deprecated using proto method options.""") + def DeprecatedMethod(self) -> grpc.UnaryUnaryMultiCallable[testproto.grpc.dummy_pb2.DeprecatedRequest, testproto.grpc.dummy_pb2.DummyReply]: + """DeprecatedMethod""" + @property + @deprecated("""Method is deprecated, but request message is not""") + def DeprecatedMethodNotDeprecatedRequest(self) -> grpc.UnaryUnaryMultiCallable[testproto.grpc.dummy_pb2.DummyRequest, testproto.grpc.dummy_pb2.DummyReply]: + """DeprecatedMethodNotDeprecatedRequest""" + @property + @deprecated("""This method has been marked as deprecated using proto method options.""") + def DeprecatedMethodNoComments(self) -> grpc.UnaryUnaryMultiCallable[testproto.grpc.dummy_pb2.DeprecatedRequest, testproto.grpc.dummy_pb2.DummyReply]: ... @deprecated("""This service is deprecated""") class DeprecatedServiceServicer(metaclass=abc.ABCMeta): @@ -99,6 +107,13 @@ class DeprecatedServiceServicer(metaclass=abc.ABCMeta): ) -> testproto.grpc.dummy_pb2.DummyReply: """DeprecatedMethodNotDeprecatedRequest""" + @abc.abstractmethod + def DeprecatedMethodNoComments( + self, + request: testproto.grpc.dummy_pb2.DeprecatedRequest, + context: grpc.ServicerContext, + ) -> testproto.grpc.dummy_pb2.DummyReply: ... + @deprecated("""This service is deprecated""") def add_DeprecatedServiceServicer_to_server(servicer: DeprecatedServiceServicer, server: grpc.Server) -> None: ... diff --git a/test/generated_sync_only/testproto/grpc/import_pb2_grpc.pyi b/test/generated_sync_only/testproto/grpc/import_pb2_grpc.pyi index 4525deb7..8609914d 100644 --- a/test/generated_sync_only/testproto/grpc/import_pb2_grpc.pyi +++ b/test/generated_sync_only/testproto/grpc/import_pb2_grpc.pyi @@ -7,6 +7,7 @@ import abc import collections.abc import google.protobuf.empty_pb2 import grpc +import grpc.aio import testproto.test_pb2 import typing diff --git a/test/generated_sync_only/testproto/test_no_generic_services_pb2_grpc.pyi b/test/generated_sync_only/testproto/test_no_generic_services_pb2_grpc.pyi index eb15b37f..c1af3ee3 100644 --- a/test/generated_sync_only/testproto/test_no_generic_services_pb2_grpc.pyi +++ b/test/generated_sync_only/testproto/test_no_generic_services_pb2_grpc.pyi @@ -6,6 +6,7 @@ isort:skip_file import abc import collections.abc import grpc +import grpc.aio import testproto.test_no_generic_services_pb2 import typing diff --git a/test/generated_sync_only/testproto/test_pb2.pyi b/test/generated_sync_only/testproto/test_pb2.pyi index 94e646db..25129fe0 100644 --- a/test/generated_sync_only/testproto/test_pb2.pyi +++ b/test/generated_sync_only/testproto/test_pb2.pyi @@ -77,14 +77,22 @@ class _DeprecatedEnum: class _DeprecatedEnumEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_DeprecatedEnum.ValueType], builtins.type): DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor - DEPRECATED_ONE: _DeprecatedEnum.ValueType # 1 - DEPRECATED_TWO: _DeprecatedEnum.ValueType # 2 + @property + @deprecated("""This enum value has been marked as deprecated using proto enum value options.""") + def DEPRECATED_ONE(self) -> _DeprecatedEnum.ValueType: # 1 + """Trailing comment for enum value""" + @property + @deprecated("""This enum value has been marked as deprecated using proto enum value options.""") + def DEPRECATED_TWO(self) -> _DeprecatedEnum.ValueType: ... # 2 + NOT_DEPRECATED: _DeprecatedEnum.ValueType # 3 @deprecated("""This enum is deprecated\n2 lines of comments\n"Quotes in comments"\nand 'single quotes'\nTrailing comment""") class DeprecatedEnum(_DeprecatedEnum, metaclass=_DeprecatedEnumEnumTypeWrapper): ... DEPRECATED_ONE: DeprecatedEnum.ValueType # 1 +"""Trailing comment for enum value""" DEPRECATED_TWO: DeprecatedEnum.ValueType # 2 +NOT_DEPRECATED: DeprecatedEnum.ValueType # 3 Global___DeprecatedEnum: typing_extensions.TypeAlias = DeprecatedEnum @typing.final @@ -432,15 +440,35 @@ class DeprecatedMessage(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor A_STRING_FIELD_NUMBER: builtins.int + DEPRECATED_FIELD_FIELD_NUMBER: builtins.int + DEPRECATED_FIELD_WITH_COMMENT_FIELD_NUMBER: builtins.int a_string: builtins.str + @property + @deprecated("""This field has been marked as deprecated using proto field options.""") + def deprecated_field(self) -> builtins.str: ... + @deprecated_field.setter + @deprecated("""This field has been marked as deprecated using proto field options.""") + def deprecated_field(self, value: builtins.str) -> None: ... + @property + @deprecated("""This field has been marked as deprecated using proto field options.""") + def deprecated_field_with_comment(self) -> builtins.str: + """This field is deprecated with comment""" + + @deprecated_field_with_comment.setter + @deprecated("""This field has been marked as deprecated using proto field options.""") + def deprecated_field_with_comment(self, value: builtins.str) -> None: + """This field is deprecated with comment""" + def __init__( self, *, a_string: builtins.str | None = ..., + deprecated_field: builtins.str | None = ..., + deprecated_field_with_comment: builtins.str | None = ..., ) -> None: ... - _HasFieldArgType: typing_extensions.TypeAlias = typing.Literal["a_string", b"a_string"] + _HasFieldArgType: typing_extensions.TypeAlias = typing.Literal["a_string", b"a_string", "deprecated_field", b"deprecated_field", "deprecated_field_with_comment", b"deprecated_field_with_comment"] def HasField(self, field_name: _HasFieldArgType) -> builtins.bool: ... - _ClearFieldArgType: typing_extensions.TypeAlias = typing.Literal["a_string", b"a_string"] + _ClearFieldArgType: typing_extensions.TypeAlias = typing.Literal["a_string", b"a_string", "deprecated_field", b"deprecated_field", "deprecated_field_with_comment", b"deprecated_field_with_comment"] def ClearField(self, field_name: _ClearFieldArgType) -> None: ... Global___DeprecatedMessage: typing_extensions.TypeAlias = DeprecatedMessage diff --git a/test/generated_sync_only/testproto/test_pb2_grpc.pyi b/test/generated_sync_only/testproto/test_pb2_grpc.pyi index 71b14ba3..35ecdade 100644 --- a/test/generated_sync_only/testproto/test_pb2_grpc.pyi +++ b/test/generated_sync_only/testproto/test_pb2_grpc.pyi @@ -6,6 +6,7 @@ Proto 2 test file.""" import abc import collections.abc import grpc +import grpc.aio import testproto.test_pb2 import typing diff --git a/test/test_generated_mypy.py b/test/test_generated_mypy.py index 7cd822e8..28101287 100644 --- a/test/test_generated_mypy.py +++ b/test/test_generated_mypy.py @@ -121,7 +121,7 @@ def grab_expectations(filename: str, marker: str) -> Generator[Tuple[str, int], assert errors_39 == expected_errors_39 # Some sanity checks to make sure we don't mess this up. Please update as necessary. - assert len(errors_39) == 90 + assert len(errors_39) == 96 def test_func() -> None: diff --git a/test_negative/negative.py b/test_negative/negative.py index 6e2922d5..66bb3187 100644 --- a/test_negative/negative.py +++ b/test_negative/negative.py @@ -11,7 +11,7 @@ import grpc import grpc.aio from testproto.dot.com.test_pb2 import TestMessage -from testproto.edition2024_pb2 import Editions2024Test +from testproto.edition2024_pb2 import Editions2024SubMessage, Editions2024Test from testproto.grpc import dummy_pb2_grpc from testproto.grpc.dummy_pb2 import ( # E:3.8 DeprecatedRequest, @@ -29,6 +29,7 @@ from testproto.test_extensions2_pb2 import SeparateFileExtension from testproto.test_pb2 import DeprecatedEnum # E:3.8 from testproto.test_pb2 import ( # E:3.8 + DEPRECATED_ONE, DESCRIPTOR, FOO, DeprecatedMessage, @@ -200,6 +201,8 @@ a_string = PythonReservedKeywords().valid # E:3.8 deprecated_message = DeprecatedMessage() +deprecated_field = deprecated_message.deprecated_field +deprecated_message.deprecated_field = "test" # E:3.8 stub0 = DummyServiceStub() # E:3.8 channel = grpc.insecure_channel("127.0.0.1:8080") @@ -310,17 +313,26 @@ def DeprecatedMethodNotDeprecatedRequest( ) -> DummyReply: return DummyReply() + def DeprecatedMethodNoComments( + self, + request: DeprecatedRequest, + context: grpc.ServicerContext, + ) -> DummyReply: + return DummyReply() + server = grpc.server(thread_pool=concurrent.futures.ThreadPoolExecutor()) deprecated_servicer = DeprecatedServicer() add_DeprecatedServiceServicer_to_server(deprecated_servicer, server) stub2 = DeprecatedServiceStub(channel) -stub2.DeprecatedMethod(DeprecatedRequest(old_field="test")) -stub2.DeprecatedMethodNotDeprecatedRequest(DummyRequest()) # Cannot deprecate methods at this time +stub2.DeprecatedMethod(DeprecatedRequest(old_field="test")) # E:3.8 +stub2.DeprecatedMethodNotDeprecatedRequest(DummyRequest()) # E:3.8 async_stub2: "dummy_pb2_grpc.DeprecatedServiceAsyncStub" # E:3.8 async_stub2 = DeprecatedServiceStub(grpc.aio.insecure_channel("")) -de = DeprecatedEnum.DEPRECATED_ONE +de = DeprecatedEnum.DEPRECATED_ONE # E:3.8 +de2 = DeprecatedEnum.DEPRECATED_TWO # E:3.8 +de3 = DEPRECATED_ONE # Cannot mark the global one as deprecated yet # Edition 2024 tests @@ -357,6 +369,8 @@ def test_clearfield_alias(msg: Editions2024Test, field: "Editions2024Test._Clear test_clearfield_alias(Editions2024Test(), "not_a_field") # E:3.8 +Editions2024Test().message_field = Editions2024SubMessage() # E:3.8 +mf = Editions2024Test().message_field def test_whichoneof_alias( diff --git a/test_negative/output.expected.3.10 b/test_negative/output.expected.3.10 index f60b9d96..d7341476 100644 --- a/test_negative/output.expected.3.10 +++ b/test_negative/output.expected.3.10 @@ -1,18 +1,22 @@ -test/generated/testproto/grpc/dummy_pb2.pyi:71: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] +test/generated/testproto/grpc/dummy_pb2.pyi:76: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] test/generated/testproto/grpc/dummy_pb2_grpc.pyi:103: error: class testproto.grpc.dummy_pb2_grpc.DeprecatedServiceAsyncStub is deprecated: This service is deprecated [deprecated] -test/generated/testproto/grpc/dummy_pb2_grpc.pyi:104: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] -test/generated/testproto/grpc/dummy_pb2_grpc.pyi:111: error: class testproto.grpc.dummy_pb2_grpc.DeprecatedServiceStub is deprecated: This service is deprecated [deprecated] -test/generated/testproto/grpc/dummy_pb2_grpc.pyi:115: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] -test/generated/testproto/grpc/dummy_pb2_grpc.pyi:115: note: Error code "deprecated" not covered by "type: ignore" comment -test/generated/testproto/grpc/dummy_pb2_grpc.pyi:127: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] -test/generated/testproto/grpc/dummy_pb2_grpc.pyi:141: error: class testproto.grpc.dummy_pb2_grpc.DeprecatedServiceServicer is deprecated: This service is deprecated [deprecated] -test/generated/testproto/test_pb2.pyi:88: error: class testproto.test_pb2.DeprecatedEnum is deprecated: This enum is deprecated +test/generated/testproto/grpc/dummy_pb2_grpc.pyi:106: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] +test/generated/testproto/grpc/dummy_pb2_grpc.pyi:114: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] +test/generated/testproto/grpc/dummy_pb2_grpc.pyi:118: error: class testproto.grpc.dummy_pb2_grpc.DeprecatedServiceStub is deprecated: This service is deprecated [deprecated] +test/generated/testproto/grpc/dummy_pb2_grpc.pyi:124: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] +test/generated/testproto/grpc/dummy_pb2_grpc.pyi:124: note: Error code "deprecated" not covered by "type: ignore" comment +test/generated/testproto/grpc/dummy_pb2_grpc.pyi:132: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] +test/generated/testproto/grpc/dummy_pb2_grpc.pyi:132: note: Error code "deprecated" not covered by "type: ignore" comment +test/generated/testproto/grpc/dummy_pb2_grpc.pyi:141: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] +test/generated/testproto/grpc/dummy_pb2_grpc.pyi:157: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] +test/generated/testproto/grpc/dummy_pb2_grpc.pyi:162: error: class testproto.grpc.dummy_pb2_grpc.DeprecatedServiceServicer is deprecated: This service is deprecated [deprecated] +test/generated/testproto/test_pb2.pyi:96: error: class testproto.test_pb2.DeprecatedEnum is deprecated: This enum is deprecated 2 lines of comments "Quotes in comments" and 'single quotes' Trailing comment [deprecated] -test/generated/testproto/test_pb2.pyi:446: error: class testproto.test_pb2.DeprecatedMessage is deprecated: This message is deprecated [deprecated] -test/generated/testproto/test_pb2.pyi:465: error: class testproto.test_pb2.DeprecatedMessageBadComment is deprecated: This message has been marked as deprecated using proto message options. [deprecated] +test/generated/testproto/test_pb2.pyi:474: error: class testproto.test_pb2.DeprecatedMessage is deprecated: This message is deprecated [deprecated] +test/generated/testproto/test_pb2.pyi:493: error: class testproto.test_pb2.DeprecatedMessageBadComment is deprecated: This message has been marked as deprecated using proto message options. [deprecated] test_negative/negative.py:16: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] test_negative/negative.py:21: error: class testproto.grpc.dummy_pb2_grpc.DeprecatedServiceServicer is deprecated: This service is deprecated [deprecated] test_negative/negative.py:21: error: class testproto.grpc.dummy_pb2_grpc.DeprecatedServiceStub is deprecated: This service is deprecated [deprecated] @@ -23,120 +27,126 @@ test_negative/negative.py:30: error: class testproto.test_pb2.DeprecatedEnum is and 'single quotes' Trailing comment [deprecated] test_negative/negative.py:31: error: class testproto.test_pb2.DeprecatedMessage is deprecated: This message is deprecated [deprecated] -test_negative/negative.py:45: error: "Simple1" has no attribute "SerializeToStringg" [attr-defined] -test_negative/negative.py:48: error: Argument 1 to "ParseFromString" of "Message" has incompatible type "Simple1"; expected "bytes" [arg-type] -test_negative/negative.py:51: error: Argument 1 to "CopyFrom" of "Message" has incompatible type "bytes"; expected "Simple1" [arg-type] -test_negative/negative.py:55: error: Argument 1 to "extend" of "list" has incompatible type "RepeatedScalarFieldContainer[str]"; expected "Iterable[int]" [arg-type] -test_negative/negative.py:57: error: Argument "foo" to "TestMessage" has incompatible type "int"; expected "str" [arg-type] -test_negative/negative.py:60: error: Incompatible types in assignment (expression has type "int", variable has type "ValueType") [assignment] -test_negative/negative.py:63: error: Argument 1 to "HasField" of "Simple1" has incompatible type "Literal['garbage']"; expected "Literal['a_boolean', b'a_boolean', 'a_enum', b'a_enum', 'a_external_enum', b'a_external_enum', 'a_inner', b'a_inner', 'a_nested', b'a_nested', 'a_oneof', b'a_oneof', 'a_oneof_1', b'a_oneof_1', 'a_oneof_2', b'a_oneof_2', 'a_string', b'a_string', 'a_uint32', b'a_uint32', 'email', b'email', 'inner_enum', b'inner_enum', 'inner_enum_in_oneof', b'inner_enum_in_oneof', 'inner_message', b'inner_message', 'nested_enum', b'nested_enum', 'nested_message', b'nested_message', 'no_package', b'no_package', 'outer_enum_in_oneof', b'outer_enum_in_oneof', 'outer_message_in_oneof', b'outer_message_in_oneof', 'user_id', b'user_id']" [arg-type] -test_negative/negative.py:64: error: Argument 1 to "HasField" of "Simple1" has incompatible type "Literal['a_repeated_string']"; expected "Literal['a_boolean', b'a_boolean', 'a_enum', b'a_enum', 'a_external_enum', b'a_external_enum', 'a_inner', b'a_inner', 'a_nested', b'a_nested', 'a_oneof', b'a_oneof', 'a_oneof_1', b'a_oneof_1', 'a_oneof_2', b'a_oneof_2', 'a_string', b'a_string', 'a_uint32', b'a_uint32', 'email', b'email', 'inner_enum', b'inner_enum', 'inner_enum_in_oneof', b'inner_enum_in_oneof', 'inner_message', b'inner_message', 'nested_enum', b'nested_enum', 'nested_message', b'nested_message', 'no_package', b'no_package', 'outer_enum_in_oneof', b'outer_enum_in_oneof', 'outer_message_in_oneof', b'outer_message_in_oneof', 'user_id', b'user_id']" [arg-type] -test_negative/negative.py:68: error: Argument 1 to "HasField" of "SimpleProto3" has incompatible type "Literal['garbage']"; expected "Literal['OuterMessage3', b'OuterMessage3', '_an_optional_string', b'_an_optional_string', 'a_oneof', b'a_oneof', 'a_oneof_1', b'a_oneof_1', 'a_oneof_2', b'a_oneof_2', 'an_optional_string', b'an_optional_string', 'b_oneof', b'b_oneof', 'b_oneof_1', b'b_oneof_1', 'b_oneof_2', b'b_oneof_2', 'bool', b'bool', 'inner_enum_in_oneof', b'inner_enum_in_oneof', 'outer_enum_in_oneof', b'outer_enum_in_oneof', 'outer_message', b'outer_message', 'outer_message_in_oneof', b'outer_message_in_oneof']" [arg-type] -test_negative/negative.py:69: error: Argument 1 to "HasField" of "SimpleProto3" has incompatible type "Literal['a_string']"; expected "Literal['OuterMessage3', b'OuterMessage3', '_an_optional_string', b'_an_optional_string', 'a_oneof', b'a_oneof', 'a_oneof_1', b'a_oneof_1', 'a_oneof_2', b'a_oneof_2', 'an_optional_string', b'an_optional_string', 'b_oneof', b'b_oneof', 'b_oneof_1', b'b_oneof_1', 'b_oneof_2', b'b_oneof_2', 'bool', b'bool', 'inner_enum_in_oneof', b'inner_enum_in_oneof', 'outer_enum_in_oneof', b'outer_enum_in_oneof', 'outer_message', b'outer_message', 'outer_message_in_oneof', b'outer_message_in_oneof']" [arg-type] -test_negative/negative.py:70: error: Argument 1 to "HasField" of "SimpleProto3" has incompatible type "Literal['outer_enum']"; expected "Literal['OuterMessage3', b'OuterMessage3', '_an_optional_string', b'_an_optional_string', 'a_oneof', b'a_oneof', 'a_oneof_1', b'a_oneof_1', 'a_oneof_2', b'a_oneof_2', 'an_optional_string', b'an_optional_string', 'b_oneof', b'b_oneof', 'b_oneof_1', b'b_oneof_1', 'b_oneof_2', b'b_oneof_2', 'bool', b'bool', 'inner_enum_in_oneof', b'inner_enum_in_oneof', 'outer_enum_in_oneof', b'outer_enum_in_oneof', 'outer_message', b'outer_message', 'outer_message_in_oneof', b'outer_message_in_oneof']" [arg-type] -test_negative/negative.py:71: error: Argument 1 to "HasField" of "SimpleProto3" has incompatible type "Literal['a_repeated_string']"; expected "Literal['OuterMessage3', b'OuterMessage3', '_an_optional_string', b'_an_optional_string', 'a_oneof', b'a_oneof', 'a_oneof_1', b'a_oneof_1', 'a_oneof_2', b'a_oneof_2', 'an_optional_string', b'an_optional_string', 'b_oneof', b'b_oneof', 'b_oneof_1', b'b_oneof_1', 'b_oneof_2', b'b_oneof_2', 'bool', b'bool', 'inner_enum_in_oneof', b'inner_enum_in_oneof', 'outer_enum_in_oneof', b'outer_enum_in_oneof', 'outer_message', b'outer_message', 'outer_message_in_oneof', b'outer_message_in_oneof']" [arg-type] -test_negative/negative.py:74: error: Argument 1 to "ClearField" of "Simple1" has incompatible type "Literal['garbage']"; expected "Literal['a_boolean', b'a_boolean', 'a_enum', b'a_enum', 'a_external_enum', b'a_external_enum', 'a_inner', b'a_inner', 'a_nested', b'a_nested', 'a_oneof', b'a_oneof', 'a_oneof_1', b'a_oneof_1', 'a_oneof_2', b'a_oneof_2', 'a_repeated_string', b'a_repeated_string', 'a_string', b'a_string', 'a_uint32', b'a_uint32', 'email', b'email', 'email_by_uid', b'email_by_uid', 'inner_enum', b'inner_enum', 'inner_enum_in_oneof', b'inner_enum_in_oneof', 'inner_message', b'inner_message', 'nested_enum', b'nested_enum', 'nested_message', b'nested_message', 'no_package', b'no_package', 'outer_enum_in_oneof', b'outer_enum_in_oneof', 'outer_message_in_oneof', b'outer_message_in_oneof', 'rep_inner_enum', b'rep_inner_enum', 'rep_inner_message', b'rep_inner_message', 'user_id', b'user_id']" [arg-type] -test_negative/negative.py:77: error: Argument 1 to "ClearField" of "SimpleProto3" has incompatible type "Literal['garbage']"; expected "Literal['OuterEnum', b'OuterEnum', 'OuterMessage3', b'OuterMessage3', '_an_optional_string', b'_an_optional_string', 'a_oneof', b'a_oneof', 'a_oneof_1', b'a_oneof_1', 'a_oneof_2', b'a_oneof_2', 'a_outer_enum', b'a_outer_enum', 'a_repeated_string', b'a_repeated_string', 'a_string', b'a_string', 'an_optional_string', b'an_optional_string', 'b_oneof', b'b_oneof', 'b_oneof_1', b'b_oneof_1', 'b_oneof_2', b'b_oneof_2', 'bool', b'bool', 'email', b'email', 'email_by_uid', b'email_by_uid', 'inner_enum', b'inner_enum', 'inner_enum_in_oneof', b'inner_enum_in_oneof', 'map_message', b'map_message', 'map_scalar', b'map_scalar', 'outer_enum_in_oneof', b'outer_enum_in_oneof', 'outer_message', b'outer_message', 'outer_message_in_oneof', b'outer_message_in_oneof', 'user_id', b'user_id']" [arg-type] -test_negative/negative.py:80: error: Argument 1 to "WhichOneof" of "Simple1" has incompatible type "Literal['garbage']"; expected "Literal['a_oneof', b'a_oneof']" [arg-type] -test_negative/negative.py:82: error: Incompatible types in assignment (expression has type "Literal['a_oneof_1', 'a_oneof_2', 'outer_message_in_oneof', 'outer_enum_in_oneof', 'inner_enum_in_oneof'] | None", variable has type "int") [assignment] -test_negative/negative.py:87: error: Argument 1 to "HasField" of "Simple2" has incompatible type "Literal['a_oneof_1', 'a_oneof_2', 'outer_message_in_oneof', 'outer_enum_in_oneof', 'inner_enum_in_oneof']"; expected "Literal['a_string', b'a_string']" [arg-type] -test_negative/negative.py:91: error: Incompatible types in assignment (expression has type "Literal['a_oneof_1', 'a_oneof_2', 'outer_message_in_oneof', 'outer_enum_in_oneof', 'inner_enum_in_oneof'] | None", variable has type "str") [assignment] -test_negative/negative.py:94: error: No overload variant of "WhichOneof" of "SimpleProto3" matches argument type "str" [call-overload] -test_negative/negative.py:94: note: Possible overload variants: -test_negative/negative.py:94: note: def WhichOneof(self, oneof_group: Literal['_an_optional_string', b'_an_optional_string']) -> Literal['an_optional_string'] | None -test_negative/negative.py:94: note: def WhichOneof(self, oneof_group: Literal['a_oneof', b'a_oneof']) -> Literal['a_oneof_1', 'a_oneof_2', 'outer_message_in_oneof', 'outer_enum_in_oneof', 'inner_enum_in_oneof'] | None -test_negative/negative.py:94: note: def WhichOneof(self, oneof_group: Literal['b_oneof', b'b_oneof']) -> Literal['b_oneof_1', 'b_oneof_2'] | None -test_negative/negative.py:96: error: Incompatible types in assignment (expression has type "Literal['a_oneof_1', 'a_oneof_2', 'outer_message_in_oneof', 'outer_enum_in_oneof', 'inner_enum_in_oneof'] | None", variable has type "int") [assignment] -test_negative/negative.py:100: error: Argument 1 to "HasField" of "Simple2" has incompatible type "Literal['a_oneof_1', 'a_oneof_2', 'outer_message_in_oneof', 'outer_enum_in_oneof', 'inner_enum_in_oneof']"; expected "Literal['a_string', b'a_string']" [arg-type] -test_negative/negative.py:104: error: Incompatible types in assignment (expression has type "_ExtensionFieldDescriptor[Simple1, Extensions1]", variable has type "int") [assignment] -test_negative/negative.py:105: error: "type[Extensions1]" has no attribute "bad" [attr-defined] -test_negative/negative.py:107: error: "Extensions1" has no attribute "foo" [attr-defined] -test_negative/negative.py:108: error: Incompatible types in assignment (expression has type "Extensions2", variable has type "Extensions1") [assignment] -test_negative/negative.py:112: error: Invalid index type "str" for "_ExtensionDict[Simple1]"; expected type "_ExtensionFieldDescriptor[Simple1, Never]" [index] -test_negative/negative.py:113: error: Invalid index type "_ExtensionFieldDescriptor[Simple2, SeparateFileExtension]" for "_ExtensionDict[Simple1]"; expected type "_ExtensionFieldDescriptor[Simple1, SeparateFileExtension]" [index] -test_negative/negative.py:114: error: Unsupported operand types for in ("_ExtensionFieldDescriptor[Simple2, SeparateFileExtension]" and "_ExtensionDict[Simple1]") [operator] -test_negative/negative.py:115: error: Argument 1 to "__delitem__" of "_ExtensionDict" has incompatible type "_ExtensionFieldDescriptor[Simple2, SeparateFileExtension]"; expected "_ExtensionFieldDescriptor[Simple1, SeparateFileExtension]" [arg-type] -test_negative/negative.py:116: error: Argument 1 to "HasExtension" of "Message" has incompatible type "_ExtensionFieldDescriptor[Simple2, SeparateFileExtension]"; expected "_ExtensionFieldDescriptor[Simple1, Any]" [arg-type] -test_negative/negative.py:117: error: Argument 1 to "ClearExtension" of "Message" has incompatible type "_ExtensionFieldDescriptor[Simple1, Extensions1]"; expected "_ExtensionFieldDescriptor[Simple2, Any]" [arg-type] -test_negative/negative.py:121: error: Incompatible types in assignment (expression has type "int", variable has type "_ExtensionFieldDescriptor[Simple1, Any]") [assignment] -test_negative/negative.py:125: error: Incompatible types in assignment (expression has type "Literal['b_oneof_1', 'b_oneof_2'] | None", variable has type "Literal['a_oneof_1', 'a_oneof_2', 'outer_message_in_oneof', 'outer_enum_in_oneof', 'inner_enum_in_oneof'] | None") [assignment] -test_negative/negative.py:128: error: "Descriptor" has no attribute "Garbage" [attr-defined] +test_negative/negative.py:46: error: "Simple1" has no attribute "SerializeToStringg" [attr-defined] +test_negative/negative.py:49: error: Argument 1 to "ParseFromString" of "Message" has incompatible type "Simple1"; expected "bytes" [arg-type] +test_negative/negative.py:52: error: Argument 1 to "CopyFrom" of "Message" has incompatible type "bytes"; expected "Simple1" [arg-type] +test_negative/negative.py:56: error: Argument 1 to "extend" of "list" has incompatible type "RepeatedScalarFieldContainer[str]"; expected "Iterable[int]" [arg-type] +test_negative/negative.py:58: error: Argument "foo" to "TestMessage" has incompatible type "int"; expected "str" [arg-type] +test_negative/negative.py:61: error: Incompatible types in assignment (expression has type "int", variable has type "ValueType") [assignment] +test_negative/negative.py:64: error: Argument 1 to "HasField" of "Simple1" has incompatible type "Literal['garbage']"; expected "Literal['a_boolean', b'a_boolean', 'a_enum', b'a_enum', 'a_external_enum', b'a_external_enum', 'a_inner', b'a_inner', 'a_nested', b'a_nested', 'a_oneof', b'a_oneof', 'a_oneof_1', b'a_oneof_1', 'a_oneof_2', b'a_oneof_2', 'a_string', b'a_string', 'a_uint32', b'a_uint32', 'email', b'email', 'inner_enum', b'inner_enum', 'inner_enum_in_oneof', b'inner_enum_in_oneof', 'inner_message', b'inner_message', 'nested_enum', b'nested_enum', 'nested_message', b'nested_message', 'no_package', b'no_package', 'outer_enum_in_oneof', b'outer_enum_in_oneof', 'outer_message_in_oneof', b'outer_message_in_oneof', 'user_id', b'user_id']" [arg-type] +test_negative/negative.py:65: error: Argument 1 to "HasField" of "Simple1" has incompatible type "Literal['a_repeated_string']"; expected "Literal['a_boolean', b'a_boolean', 'a_enum', b'a_enum', 'a_external_enum', b'a_external_enum', 'a_inner', b'a_inner', 'a_nested', b'a_nested', 'a_oneof', b'a_oneof', 'a_oneof_1', b'a_oneof_1', 'a_oneof_2', b'a_oneof_2', 'a_string', b'a_string', 'a_uint32', b'a_uint32', 'email', b'email', 'inner_enum', b'inner_enum', 'inner_enum_in_oneof', b'inner_enum_in_oneof', 'inner_message', b'inner_message', 'nested_enum', b'nested_enum', 'nested_message', b'nested_message', 'no_package', b'no_package', 'outer_enum_in_oneof', b'outer_enum_in_oneof', 'outer_message_in_oneof', b'outer_message_in_oneof', 'user_id', b'user_id']" [arg-type] +test_negative/negative.py:69: error: Argument 1 to "HasField" of "SimpleProto3" has incompatible type "Literal['garbage']"; expected "Literal['OuterMessage3', b'OuterMessage3', '_an_optional_string', b'_an_optional_string', 'a_oneof', b'a_oneof', 'a_oneof_1', b'a_oneof_1', 'a_oneof_2', b'a_oneof_2', 'an_optional_string', b'an_optional_string', 'b_oneof', b'b_oneof', 'b_oneof_1', b'b_oneof_1', 'b_oneof_2', b'b_oneof_2', 'bool', b'bool', 'inner_enum_in_oneof', b'inner_enum_in_oneof', 'outer_enum_in_oneof', b'outer_enum_in_oneof', 'outer_message', b'outer_message', 'outer_message_in_oneof', b'outer_message_in_oneof']" [arg-type] +test_negative/negative.py:70: error: Argument 1 to "HasField" of "SimpleProto3" has incompatible type "Literal['a_string']"; expected "Literal['OuterMessage3', b'OuterMessage3', '_an_optional_string', b'_an_optional_string', 'a_oneof', b'a_oneof', 'a_oneof_1', b'a_oneof_1', 'a_oneof_2', b'a_oneof_2', 'an_optional_string', b'an_optional_string', 'b_oneof', b'b_oneof', 'b_oneof_1', b'b_oneof_1', 'b_oneof_2', b'b_oneof_2', 'bool', b'bool', 'inner_enum_in_oneof', b'inner_enum_in_oneof', 'outer_enum_in_oneof', b'outer_enum_in_oneof', 'outer_message', b'outer_message', 'outer_message_in_oneof', b'outer_message_in_oneof']" [arg-type] +test_negative/negative.py:71: error: Argument 1 to "HasField" of "SimpleProto3" has incompatible type "Literal['outer_enum']"; expected "Literal['OuterMessage3', b'OuterMessage3', '_an_optional_string', b'_an_optional_string', 'a_oneof', b'a_oneof', 'a_oneof_1', b'a_oneof_1', 'a_oneof_2', b'a_oneof_2', 'an_optional_string', b'an_optional_string', 'b_oneof', b'b_oneof', 'b_oneof_1', b'b_oneof_1', 'b_oneof_2', b'b_oneof_2', 'bool', b'bool', 'inner_enum_in_oneof', b'inner_enum_in_oneof', 'outer_enum_in_oneof', b'outer_enum_in_oneof', 'outer_message', b'outer_message', 'outer_message_in_oneof', b'outer_message_in_oneof']" [arg-type] +test_negative/negative.py:72: error: Argument 1 to "HasField" of "SimpleProto3" has incompatible type "Literal['a_repeated_string']"; expected "Literal['OuterMessage3', b'OuterMessage3', '_an_optional_string', b'_an_optional_string', 'a_oneof', b'a_oneof', 'a_oneof_1', b'a_oneof_1', 'a_oneof_2', b'a_oneof_2', 'an_optional_string', b'an_optional_string', 'b_oneof', b'b_oneof', 'b_oneof_1', b'b_oneof_1', 'b_oneof_2', b'b_oneof_2', 'bool', b'bool', 'inner_enum_in_oneof', b'inner_enum_in_oneof', 'outer_enum_in_oneof', b'outer_enum_in_oneof', 'outer_message', b'outer_message', 'outer_message_in_oneof', b'outer_message_in_oneof']" [arg-type] +test_negative/negative.py:75: error: Argument 1 to "ClearField" of "Simple1" has incompatible type "Literal['garbage']"; expected "Literal['a_boolean', b'a_boolean', 'a_enum', b'a_enum', 'a_external_enum', b'a_external_enum', 'a_inner', b'a_inner', 'a_nested', b'a_nested', 'a_oneof', b'a_oneof', 'a_oneof_1', b'a_oneof_1', 'a_oneof_2', b'a_oneof_2', 'a_repeated_string', b'a_repeated_string', 'a_string', b'a_string', 'a_uint32', b'a_uint32', 'email', b'email', 'email_by_uid', b'email_by_uid', 'inner_enum', b'inner_enum', 'inner_enum_in_oneof', b'inner_enum_in_oneof', 'inner_message', b'inner_message', 'nested_enum', b'nested_enum', 'nested_message', b'nested_message', 'no_package', b'no_package', 'outer_enum_in_oneof', b'outer_enum_in_oneof', 'outer_message_in_oneof', b'outer_message_in_oneof', 'rep_inner_enum', b'rep_inner_enum', 'rep_inner_message', b'rep_inner_message', 'user_id', b'user_id']" [arg-type] +test_negative/negative.py:78: error: Argument 1 to "ClearField" of "SimpleProto3" has incompatible type "Literal['garbage']"; expected "Literal['OuterEnum', b'OuterEnum', 'OuterMessage3', b'OuterMessage3', '_an_optional_string', b'_an_optional_string', 'a_oneof', b'a_oneof', 'a_oneof_1', b'a_oneof_1', 'a_oneof_2', b'a_oneof_2', 'a_outer_enum', b'a_outer_enum', 'a_repeated_string', b'a_repeated_string', 'a_string', b'a_string', 'an_optional_string', b'an_optional_string', 'b_oneof', b'b_oneof', 'b_oneof_1', b'b_oneof_1', 'b_oneof_2', b'b_oneof_2', 'bool', b'bool', 'email', b'email', 'email_by_uid', b'email_by_uid', 'inner_enum', b'inner_enum', 'inner_enum_in_oneof', b'inner_enum_in_oneof', 'map_message', b'map_message', 'map_scalar', b'map_scalar', 'outer_enum_in_oneof', b'outer_enum_in_oneof', 'outer_message', b'outer_message', 'outer_message_in_oneof', b'outer_message_in_oneof', 'user_id', b'user_id']" [arg-type] +test_negative/negative.py:81: error: Argument 1 to "WhichOneof" of "Simple1" has incompatible type "Literal['garbage']"; expected "Literal['a_oneof', b'a_oneof']" [arg-type] +test_negative/negative.py:83: error: Incompatible types in assignment (expression has type "Literal['a_oneof_1', 'a_oneof_2', 'outer_message_in_oneof', 'outer_enum_in_oneof', 'inner_enum_in_oneof'] | None", variable has type "int") [assignment] +test_negative/negative.py:88: error: Argument 1 to "HasField" of "Simple2" has incompatible type "Literal['a_oneof_1', 'a_oneof_2', 'outer_message_in_oneof', 'outer_enum_in_oneof', 'inner_enum_in_oneof']"; expected "Literal['a_string', b'a_string']" [arg-type] +test_negative/negative.py:92: error: Incompatible types in assignment (expression has type "Literal['a_oneof_1', 'a_oneof_2', 'outer_message_in_oneof', 'outer_enum_in_oneof', 'inner_enum_in_oneof'] | None", variable has type "str") [assignment] +test_negative/negative.py:95: error: No overload variant of "WhichOneof" of "SimpleProto3" matches argument type "str" [call-overload] +test_negative/negative.py:95: note: Possible overload variants: +test_negative/negative.py:95: note: def WhichOneof(self, oneof_group: Literal['_an_optional_string', b'_an_optional_string']) -> Literal['an_optional_string'] | None +test_negative/negative.py:95: note: def WhichOneof(self, oneof_group: Literal['a_oneof', b'a_oneof']) -> Literal['a_oneof_1', 'a_oneof_2', 'outer_message_in_oneof', 'outer_enum_in_oneof', 'inner_enum_in_oneof'] | None +test_negative/negative.py:95: note: def WhichOneof(self, oneof_group: Literal['b_oneof', b'b_oneof']) -> Literal['b_oneof_1', 'b_oneof_2'] | None +test_negative/negative.py:97: error: Incompatible types in assignment (expression has type "Literal['a_oneof_1', 'a_oneof_2', 'outer_message_in_oneof', 'outer_enum_in_oneof', 'inner_enum_in_oneof'] | None", variable has type "int") [assignment] +test_negative/negative.py:101: error: Argument 1 to "HasField" of "Simple2" has incompatible type "Literal['a_oneof_1', 'a_oneof_2', 'outer_message_in_oneof', 'outer_enum_in_oneof', 'inner_enum_in_oneof']"; expected "Literal['a_string', b'a_string']" [arg-type] +test_negative/negative.py:105: error: Incompatible types in assignment (expression has type "_ExtensionFieldDescriptor[Simple1, Extensions1]", variable has type "int") [assignment] +test_negative/negative.py:106: error: "type[Extensions1]" has no attribute "bad" [attr-defined] +test_negative/negative.py:108: error: "Extensions1" has no attribute "foo" [attr-defined] +test_negative/negative.py:109: error: Incompatible types in assignment (expression has type "Extensions2", variable has type "Extensions1") [assignment] +test_negative/negative.py:113: error: Invalid index type "str" for "_ExtensionDict[Simple1]"; expected type "_ExtensionFieldDescriptor[Simple1, Never]" [index] +test_negative/negative.py:114: error: Invalid index type "_ExtensionFieldDescriptor[Simple2, SeparateFileExtension]" for "_ExtensionDict[Simple1]"; expected type "_ExtensionFieldDescriptor[Simple1, SeparateFileExtension]" [index] +test_negative/negative.py:115: error: Unsupported operand types for in ("_ExtensionFieldDescriptor[Simple2, SeparateFileExtension]" and "_ExtensionDict[Simple1]") [operator] +test_negative/negative.py:116: error: Argument 1 to "__delitem__" of "_ExtensionDict" has incompatible type "_ExtensionFieldDescriptor[Simple2, SeparateFileExtension]"; expected "_ExtensionFieldDescriptor[Simple1, SeparateFileExtension]" [arg-type] +test_negative/negative.py:117: error: Argument 1 to "HasExtension" of "Message" has incompatible type "_ExtensionFieldDescriptor[Simple2, SeparateFileExtension]"; expected "_ExtensionFieldDescriptor[Simple1, Any]" [arg-type] +test_negative/negative.py:118: error: Argument 1 to "ClearExtension" of "Message" has incompatible type "_ExtensionFieldDescriptor[Simple1, Extensions1]"; expected "_ExtensionFieldDescriptor[Simple2, Any]" [arg-type] +test_negative/negative.py:122: error: Incompatible types in assignment (expression has type "int", variable has type "_ExtensionFieldDescriptor[Simple1, Any]") [assignment] +test_negative/negative.py:126: error: Incompatible types in assignment (expression has type "Literal['b_oneof_1', 'b_oneof_2'] | None", variable has type "Literal['a_oneof_1', 'a_oneof_2', 'outer_message_in_oneof', 'outer_enum_in_oneof', 'inner_enum_in_oneof'] | None") [assignment] test_negative/negative.py:129: error: "Descriptor" has no attribute "Garbage" [attr-defined] -test_negative/negative.py:132: error: "EnumDescriptor" has no attribute "Garbage" [attr-defined] -test_negative/negative.py:135: error: "FileDescriptor" has no attribute "Garbage" [attr-defined] -test_negative/negative.py:142: error: "ValueType" has no attribute "FOO" [attr-defined] -test_negative/negative.py:146: error: Argument 1 to "Name" of "_EnumTypeWrapper" has incompatible type "int"; expected "ValueType" [arg-type] -test_negative/negative.py:148: error: Argument 1 to "Name" of "_EnumTypeWrapper" has incompatible type "testproto.test3_pb2.SimpleProto3._InnerEnum.ValueType"; expected "testproto.test3_pb2._OuterEnum.ValueType" [arg-type] -test_negative/negative.py:150: error: Argument 1 to "Name" of "_EnumTypeWrapper" has incompatible type "testproto.test3_pb2.SimpleProto3._InnerEnum.ValueType"; expected "testproto.test3_pb2._OuterEnum.ValueType" [arg-type] -test_negative/negative.py:152: error: Argument 1 to "Name" of "_EnumTypeWrapper" has incompatible type "testproto.test3_pb2.SimpleProto3._InnerEnum.ValueType"; expected "testproto.test3_pb2._OuterEnum.ValueType" [arg-type] -test_negative/negative.py:156: error: "ScalarMap[int, str]" has no attribute "get_or_create" [attr-defined] -test_negative/negative.py:158: error: No overload variant of "get" of "ScalarMap" matches argument type "str" [call-overload] -test_negative/negative.py:158: note: Possible overload variants: -test_negative/negative.py:158: note: def get(self, key: int, default: None = ...) -> str | None -test_negative/negative.py:158: note: def get(self, key: int, default: str) -> str -test_negative/negative.py:158: note: def [_T] get(self, key: int, default: _T) -> str | _T -test_negative/negative.py:159: error: No overload variant of "get" of "MessageMap" matches argument type "str" [call-overload] +test_negative/negative.py:130: error: "Descriptor" has no attribute "Garbage" [attr-defined] +test_negative/negative.py:133: error: "EnumDescriptor" has no attribute "Garbage" [attr-defined] +test_negative/negative.py:136: error: "FileDescriptor" has no attribute "Garbage" [attr-defined] +test_negative/negative.py:143: error: "ValueType" has no attribute "FOO" [attr-defined] +test_negative/negative.py:147: error: Argument 1 to "Name" of "_EnumTypeWrapper" has incompatible type "int"; expected "ValueType" [arg-type] +test_negative/negative.py:149: error: Argument 1 to "Name" of "_EnumTypeWrapper" has incompatible type "testproto.test3_pb2.SimpleProto3._InnerEnum.ValueType"; expected "testproto.test3_pb2._OuterEnum.ValueType" [arg-type] +test_negative/negative.py:151: error: Argument 1 to "Name" of "_EnumTypeWrapper" has incompatible type "testproto.test3_pb2.SimpleProto3._InnerEnum.ValueType"; expected "testproto.test3_pb2._OuterEnum.ValueType" [arg-type] +test_negative/negative.py:153: error: Argument 1 to "Name" of "_EnumTypeWrapper" has incompatible type "testproto.test3_pb2.SimpleProto3._InnerEnum.ValueType"; expected "testproto.test3_pb2._OuterEnum.ValueType" [arg-type] +test_negative/negative.py:157: error: "ScalarMap[int, str]" has no attribute "get_or_create" [attr-defined] +test_negative/negative.py:159: error: No overload variant of "get" of "ScalarMap" matches argument type "str" [call-overload] test_negative/negative.py:159: note: Possible overload variants: -test_negative/negative.py:159: note: def get(self, key: int, default: None = ...) -> OuterMessage3 | None -test_negative/negative.py:159: note: def get(self, key: int, default: OuterMessage3) -> OuterMessage3 -test_negative/negative.py:159: note: def [_T] get(self, key: int, default: _T) -> OuterMessage3 | _T -test_negative/negative.py:162: error: Incompatible types in assignment (expression has type "str | None", variable has type "int") [assignment] -test_negative/negative.py:163: error: Incompatible types in assignment (expression has type "OuterMessage3 | None", variable has type "int") [assignment] -test_negative/negative.py:165: error: Dict entry 0 has incompatible type "str": "int"; expected "int": "str" [dict-item] -test_negative/negative.py:165: error: Dict entry 0 has incompatible type "str": "str"; expected "int": "OuterMessage3" [dict-item] -test_negative/negative.py:169: error: Incompatible types in assignment (expression has type "int", variable has type "UserId") [assignment] -test_negative/negative.py:170: error: Incompatible types in assignment (expression has type "str", variable has type "Email") [assignment] -test_negative/negative.py:171: error: Invalid index type "int" for "ScalarMap[UserId, Email]"; expected type "UserId" [index] -test_negative/negative.py:171: error: Incompatible types in assignment (expression has type "str", target has type "Email") [assignment] +test_negative/negative.py:159: note: def get(self, key: int, default: None = ...) -> str | None +test_negative/negative.py:159: note: def get(self, key: int, default: str) -> str +test_negative/negative.py:159: note: def [_T] get(self, key: int, default: _T) -> str | _T +test_negative/negative.py:160: error: No overload variant of "get" of "MessageMap" matches argument type "str" [call-overload] +test_negative/negative.py:160: note: Possible overload variants: +test_negative/negative.py:160: note: def get(self, key: int, default: None = ...) -> OuterMessage3 | None +test_negative/negative.py:160: note: def get(self, key: int, default: OuterMessage3) -> OuterMessage3 +test_negative/negative.py:160: note: def [_T] get(self, key: int, default: _T) -> OuterMessage3 | _T +test_negative/negative.py:163: error: Incompatible types in assignment (expression has type "str | None", variable has type "int") [assignment] +test_negative/negative.py:164: error: Incompatible types in assignment (expression has type "OuterMessage3 | None", variable has type "int") [assignment] +test_negative/negative.py:166: error: Dict entry 0 has incompatible type "str": "int"; expected "int": "str" [dict-item] +test_negative/negative.py:166: error: Dict entry 0 has incompatible type "str": "str"; expected "int": "OuterMessage3" [dict-item] +test_negative/negative.py:170: error: Incompatible types in assignment (expression has type "int", variable has type "UserId") [assignment] +test_negative/negative.py:171: error: Incompatible types in assignment (expression has type "str", variable has type "Email") [assignment] +test_negative/negative.py:172: error: Invalid index type "int" for "ScalarMap[UserId, Email]"; expected type "UserId" [index] test_negative/negative.py:172: error: Incompatible types in assignment (expression has type "str", target has type "Email") [assignment] -test_negative/negative.py:173: error: Invalid index type "int" for "ScalarMap[UserId, Email]"; expected type "UserId" [index] -test_negative/negative.py:175: error: Argument "user_id" to "Simple1" has incompatible type "int"; expected "UserId | None" [arg-type] -test_negative/negative.py:176: error: Argument "email" to "Simple1" has incompatible type "str"; expected "Email | None" [arg-type] -test_negative/negative.py:177: error: Dict entry 0 has incompatible type "int": "str"; expected "UserId": "Email" [dict-item] -test_negative/negative.py:181: error: Module "testproto.reexport_pb2" has no attribute "Inner" [attr-defined] -test_negative/negative.py:185: error: Argument "a_string" to "OuterMessage3" has incompatible type "None"; expected "str" [arg-type] -test_negative/negative.py:190: error: Property "a_repeated_string" defined in "Simple1" is read-only [misc] -test_negative/negative.py:191: error: Property "rep_inner_enum" defined in "Simple1" is read-only [misc] -test_negative/negative.py:196: error: "_r_None" has no attribute "invalid"; maybe "valid"? [attr-defined] -test_negative/negative.py:200: error: Incompatible types in assignment (expression has type "ValueType", variable has type "str") [assignment] -test_negative/negative.py:204: error: All overload variants of "DummyServiceStub" require at least one argument [call-overload] -test_negative/negative.py:204: note: Possible overload variants: -test_negative/negative.py:204: note: def __new__(cls, channel: Channel) -> DummyServiceStub -test_negative/negative.py:204: note: def __new__(cls, channel: Channel) -> DummyServiceAsyncStub -test_negative/negative.py:211: error: "DummyReply" has no attribute "not_exists" [attr-defined] -test_negative/negative.py:212: error: "DummyReply" has no attribute "__iter__" (not iterable) [attr-defined] -test_negative/negative.py:217: error: "DummyReply" has no attribute "not_exists" [attr-defined] -test_negative/negative.py:219: error: "_CallIterator[DummyReply]" has no attribute "value" [attr-defined] -test_negative/negative.py:226: error: Argument 1 to "__call__" of "StreamUnaryMultiCallable" has incompatible type "DummyRequest"; expected "Iterator[DummyRequest]" [arg-type] -test_negative/negative.py:228: error: "DummyReply" has no attribute "__iter__" (not iterable) [attr-defined] -test_negative/negative.py:228: error: Argument 1 to "__call__" of "StreamUnaryMultiCallable" has incompatible type "DummyRequest"; expected "Iterator[DummyRequest]" [arg-type] -test_negative/negative.py:231: error: Argument 1 to "__call__" of "StreamStreamMultiCallable" has incompatible type "DummyRequest"; expected "Iterator[DummyRequest]" [arg-type] -test_negative/negative.py:235: error: "DummyReply" has no attribute "not_exists" [attr-defined] -test_negative/negative.py:272: error: Return type "Iterator[DummyReply]" of "UnaryUnary" incompatible with return type "DummyReply | Awaitable[DummyReply]" in supertype "testproto.grpc.dummy_pb2_grpc.DummyServiceServicer" [override] -test_negative/negative.py:274: error: Argument 1 of "UnaryUnary" is incompatible with supertype "testproto.grpc.dummy_pb2_grpc.DummyServiceServicer"; supertype defines the argument type as "DummyRequest" [override] -test_negative/negative.py:274: note: This violates the Liskov substitution principle -test_negative/negative.py:274: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#incompatible-overrides -test_negative/negative.py:280: error: Return type "DummyReply" of "UnaryStream" incompatible with return type "Iterator[DummyReply] | AsyncIterator[DummyReply]" in supertype "testproto.grpc.dummy_pb2_grpc.DummyServiceServicer" [override] -test_negative/negative.py:282: error: Argument 1 of "UnaryStream" is incompatible with supertype "testproto.grpc.dummy_pb2_grpc.DummyServiceServicer"; supertype defines the argument type as "DummyRequest" [override] -test_negative/negative.py:282: note: This violates the Liskov substitution principle -test_negative/negative.py:282: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#incompatible-overrides -test_negative/negative.py:289: error: Return type "Iterator[DummyReply]" of "StreamUnary" incompatible with return type "DummyReply | Awaitable[DummyReply]" in supertype "testproto.grpc.dummy_pb2_grpc.DummyServiceServicer" [override] -test_negative/negative.py:291: error: Argument 1 of "StreamUnary" is incompatible with supertype "testproto.grpc.dummy_pb2_grpc.DummyServiceServicer"; supertype defines the argument type as "_MaybeAsyncIterator[DummyRequest]" [override] -test_negative/negative.py:291: note: This violates the Liskov substitution principle -test_negative/negative.py:291: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#incompatible-overrides -test_negative/negative.py:320: error: class testproto.grpc.dummy_pb2_grpc.DeprecatedServiceAsyncStub is deprecated: This service is deprecated [deprecated] -test_negative/negative.py:332: error: Argument "implicit_singular" to "Editions2024Test" has incompatible type "None"; expected "str" [arg-type] -test_negative/negative.py:334: error: Argument 1 to "HasField" of "Editions2024Test" has incompatible type "Literal['implicit_singular']"; expected "Literal['default_singular', b'default_singular', 'explicit_singular', b'explicit_singular', 'legacy', b'legacy', 'message_field', b'message_field']" [arg-type] -test_negative/negative.py:345: error: Cannot instantiate abstract class "IncompleteServicer" with abstract attributes "StreamStream", "StreamUnary", "UnaryStream" and "UnaryUnary" [abstract] -test_negative/negative.py:352: error: Argument 2 to "test_hasfield_alias" has incompatible type "Literal['not_a_field']"; expected "Literal['default_singular', b'default_singular', 'explicit_singular', b'explicit_singular', 'legacy', b'legacy', 'message_field', b'message_field']" [arg-type] -test_negative/negative.py:359: error: Argument 2 to "test_clearfield_alias" has incompatible type "Literal['not_a_field']"; expected "Literal['default_singular', b'default_singular', 'explicit_singular', b'explicit_singular', 'implicit_singular', b'implicit_singular', 'legacy', b'legacy', 'message_field', b'message_field']" [arg-type] -test_negative/negative.py:369: error: Argument 2 to "test_whichoneof_alias" has incompatible type "Literal['not_a_oneof']"; expected "Literal['a_oneof', b'a_oneof']" [arg-type] -test_negative/negative.py:372: error: All overload variants of "DummyServiceStub" require at least one argument [call-overload] -test_negative/negative.py:372: note: Possible overload variants: -test_negative/negative.py:372: note: def __new__(cls, channel: Channel) -> DummyServiceStub -test_negative/negative.py:372: note: def __new__(cls, channel: Channel) -> DummyServiceAsyncStub -test_negative/negative.py:373: error: No overload variant of "DummyServiceStub" matches argument type "str" [call-overload] -test_negative/negative.py:373: note: Possible overload variants: -test_negative/negative.py:373: note: def __new__(cls, channel: Channel) -> DummyServiceStub -test_negative/negative.py:373: note: def __new__(cls, channel: Channel) -> DummyServiceAsyncStub -Found 105 errors in 4 files (checked 4 source files) +test_negative/negative.py:173: error: Incompatible types in assignment (expression has type "str", target has type "Email") [assignment] +test_negative/negative.py:174: error: Invalid index type "int" for "ScalarMap[UserId, Email]"; expected type "UserId" [index] +test_negative/negative.py:176: error: Argument "user_id" to "Simple1" has incompatible type "int"; expected "UserId | None" [arg-type] +test_negative/negative.py:177: error: Argument "email" to "Simple1" has incompatible type "str"; expected "Email | None" [arg-type] +test_negative/negative.py:178: error: Dict entry 0 has incompatible type "int": "str"; expected "UserId": "Email" [dict-item] +test_negative/negative.py:182: error: Module "testproto.reexport_pb2" has no attribute "Inner" [attr-defined] +test_negative/negative.py:186: error: Argument "a_string" to "OuterMessage3" has incompatible type "None"; expected "str" [arg-type] +test_negative/negative.py:191: error: Property "a_repeated_string" defined in "Simple1" is read-only [misc] +test_negative/negative.py:192: error: Property "rep_inner_enum" defined in "Simple1" is read-only [misc] +test_negative/negative.py:197: error: "_r_None" has no attribute "invalid"; maybe "valid"? [attr-defined] +test_negative/negative.py:201: error: Incompatible types in assignment (expression has type "ValueType", variable has type "str") [assignment] +test_negative/negative.py:205: error: function testproto.test_pb2.DeprecatedMessage.deprecated_field is deprecated: This field has been marked as deprecated using proto field options. [deprecated] +test_negative/negative.py:207: error: All overload variants of "DummyServiceStub" require at least one argument [call-overload] +test_negative/negative.py:207: note: Possible overload variants: +test_negative/negative.py:207: note: def __new__(cls, channel: Channel) -> DummyServiceStub +test_negative/negative.py:207: note: def __new__(cls, channel: Channel) -> DummyServiceAsyncStub +test_negative/negative.py:214: error: "DummyReply" has no attribute "not_exists" [attr-defined] +test_negative/negative.py:215: error: "DummyReply" has no attribute "__iter__" (not iterable) [attr-defined] +test_negative/negative.py:220: error: "DummyReply" has no attribute "not_exists" [attr-defined] +test_negative/negative.py:222: error: "_CallIterator[DummyReply]" has no attribute "value" [attr-defined] +test_negative/negative.py:229: error: Argument 1 to "__call__" of "StreamUnaryMultiCallable" has incompatible type "DummyRequest"; expected "Iterator[DummyRequest]" [arg-type] +test_negative/negative.py:231: error: "DummyReply" has no attribute "__iter__" (not iterable) [attr-defined] +test_negative/negative.py:231: error: Argument 1 to "__call__" of "StreamUnaryMultiCallable" has incompatible type "DummyRequest"; expected "Iterator[DummyRequest]" [arg-type] +test_negative/negative.py:234: error: Argument 1 to "__call__" of "StreamStreamMultiCallable" has incompatible type "DummyRequest"; expected "Iterator[DummyRequest]" [arg-type] +test_negative/negative.py:238: error: "DummyReply" has no attribute "not_exists" [attr-defined] +test_negative/negative.py:275: error: Return type "Iterator[DummyReply]" of "UnaryUnary" incompatible with return type "DummyReply | Awaitable[DummyReply]" in supertype "testproto.grpc.dummy_pb2_grpc.DummyServiceServicer" [override] +test_negative/negative.py:277: error: Argument 1 of "UnaryUnary" is incompatible with supertype "testproto.grpc.dummy_pb2_grpc.DummyServiceServicer"; supertype defines the argument type as "DummyRequest" [override] +test_negative/negative.py:277: note: This violates the Liskov substitution principle +test_negative/negative.py:277: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#incompatible-overrides +test_negative/negative.py:283: error: Return type "DummyReply" of "UnaryStream" incompatible with return type "Iterator[DummyReply] | AsyncIterator[DummyReply]" in supertype "testproto.grpc.dummy_pb2_grpc.DummyServiceServicer" [override] +test_negative/negative.py:285: error: Argument 1 of "UnaryStream" is incompatible with supertype "testproto.grpc.dummy_pb2_grpc.DummyServiceServicer"; supertype defines the argument type as "DummyRequest" [override] +test_negative/negative.py:285: note: This violates the Liskov substitution principle +test_negative/negative.py:285: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#incompatible-overrides +test_negative/negative.py:292: error: Return type "Iterator[DummyReply]" of "StreamUnary" incompatible with return type "DummyReply | Awaitable[DummyReply]" in supertype "testproto.grpc.dummy_pb2_grpc.DummyServiceServicer" [override] +test_negative/negative.py:294: error: Argument 1 of "StreamUnary" is incompatible with supertype "testproto.grpc.dummy_pb2_grpc.DummyServiceServicer"; supertype defines the argument type as "_MaybeAsyncIterator[DummyRequest]" [override] +test_negative/negative.py:294: note: This violates the Liskov substitution principle +test_negative/negative.py:294: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#incompatible-overrides +test_negative/negative.py:328: error: function testproto.grpc.dummy_pb2_grpc.DeprecatedServiceStub.DeprecatedMethod is deprecated: This method has been marked as deprecated using proto method options. [deprecated] +test_negative/negative.py:329: error: function testproto.grpc.dummy_pb2_grpc.DeprecatedServiceStub.DeprecatedMethodNotDeprecatedRequest is deprecated: Method is deprecated, but request message is not [deprecated] +test_negative/negative.py:330: error: class testproto.grpc.dummy_pb2_grpc.DeprecatedServiceAsyncStub is deprecated: This service is deprecated [deprecated] +test_negative/negative.py:333: error: function testproto.test_pb2._DeprecatedEnumEnumTypeWrapper.DEPRECATED_ONE is deprecated: This enum value has been marked as deprecated using proto enum value options. [deprecated] +test_negative/negative.py:334: error: function testproto.test_pb2._DeprecatedEnumEnumTypeWrapper.DEPRECATED_TWO is deprecated: This enum value has been marked as deprecated using proto enum value options. [deprecated] +test_negative/negative.py:344: error: Argument "implicit_singular" to "Editions2024Test" has incompatible type "None"; expected "str" [arg-type] +test_negative/negative.py:346: error: Argument 1 to "HasField" of "Editions2024Test" has incompatible type "Literal['implicit_singular']"; expected "Literal['default_singular', b'default_singular', 'explicit_singular', b'explicit_singular', 'legacy', b'legacy', 'message_field', b'message_field']" [arg-type] +test_negative/negative.py:357: error: Cannot instantiate abstract class "IncompleteServicer" with abstract attributes "StreamStream", "StreamUnary", "UnaryStream" and "UnaryUnary" [abstract] +test_negative/negative.py:364: error: Argument 2 to "test_hasfield_alias" has incompatible type "Literal['not_a_field']"; expected "Literal['default_singular', b'default_singular', 'explicit_singular', b'explicit_singular', 'legacy', b'legacy', 'message_field', b'message_field']" [arg-type] +test_negative/negative.py:371: error: Argument 2 to "test_clearfield_alias" has incompatible type "Literal['not_a_field']"; expected "Literal['default_singular', b'default_singular', 'explicit_singular', b'explicit_singular', 'implicit_singular', b'implicit_singular', 'legacy', b'legacy', 'message_field', b'message_field']" [arg-type] +test_negative/negative.py:372: error: Property "message_field" defined in "Editions2024Test" is read-only [misc] +test_negative/negative.py:383: error: Argument 2 to "test_whichoneof_alias" has incompatible type "Literal['not_a_oneof']"; expected "Literal['a_oneof', b'a_oneof']" [arg-type] +test_negative/negative.py:386: error: All overload variants of "DummyServiceStub" require at least one argument [call-overload] +test_negative/negative.py:386: note: Possible overload variants: +test_negative/negative.py:386: note: def __new__(cls, channel: Channel) -> DummyServiceStub +test_negative/negative.py:386: note: def __new__(cls, channel: Channel) -> DummyServiceAsyncStub +test_negative/negative.py:387: error: No overload variant of "DummyServiceStub" matches argument type "str" [call-overload] +test_negative/negative.py:387: note: Possible overload variants: +test_negative/negative.py:387: note: def __new__(cls, channel: Channel) -> DummyServiceStub +test_negative/negative.py:387: note: def __new__(cls, channel: Channel) -> DummyServiceAsyncStub +Found 114 errors in 4 files (checked 4 source files) diff --git a/test_negative/output.expected.3.10.omit_linenos b/test_negative/output.expected.3.10.omit_linenos index b32a0a1e..abe41b67 100644 --- a/test_negative/output.expected.3.10.omit_linenos +++ b/test_negative/output.expected.3.10.omit_linenos @@ -1,10 +1,14 @@ test/generated/testproto/grpc/dummy_pb2.pyi: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] test/generated/testproto/grpc/dummy_pb2_grpc.pyi: error: class testproto.grpc.dummy_pb2_grpc.DeprecatedServiceAsyncStub is deprecated: This service is deprecated [deprecated] test/generated/testproto/grpc/dummy_pb2_grpc.pyi: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] +test/generated/testproto/grpc/dummy_pb2_grpc.pyi: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] test/generated/testproto/grpc/dummy_pb2_grpc.pyi: error: class testproto.grpc.dummy_pb2_grpc.DeprecatedServiceStub is deprecated: This service is deprecated [deprecated] test/generated/testproto/grpc/dummy_pb2_grpc.pyi: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] test/generated/testproto/grpc/dummy_pb2_grpc.pyi: note: Error code "deprecated" not covered by "type: ignore" comment test/generated/testproto/grpc/dummy_pb2_grpc.pyi: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] +test/generated/testproto/grpc/dummy_pb2_grpc.pyi: note: Error code "deprecated" not covered by "type: ignore" comment +test/generated/testproto/grpc/dummy_pb2_grpc.pyi: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] +test/generated/testproto/grpc/dummy_pb2_grpc.pyi: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] test/generated/testproto/grpc/dummy_pb2_grpc.pyi: error: class testproto.grpc.dummy_pb2_grpc.DeprecatedServiceServicer is deprecated: This service is deprecated [deprecated] test/generated/testproto/test_pb2.pyi: error: class testproto.test_pb2.DeprecatedEnum is deprecated: This enum is deprecated 2 lines of comments @@ -99,6 +103,7 @@ test_negative/negative.py: error: Property "a_repeated_string" defined in "Simpl test_negative/negative.py: error: Property "rep_inner_enum" defined in "Simple1" is read-only [misc] test_negative/negative.py: error: "_r_None" has no attribute "invalid"; maybe "valid"? [attr-defined] test_negative/negative.py: error: Incompatible types in assignment (expression has type "ValueType", variable has type "str") [assignment] +test_negative/negative.py: error: function testproto.test_pb2.DeprecatedMessage.deprecated_field is deprecated: This field has been marked as deprecated using proto field options. [deprecated] test_negative/negative.py: error: All overload variants of "DummyServiceStub" require at least one argument [call-overload] test_negative/negative.py: note: Possible overload variants: test_negative/negative.py: note: def __new__(cls, channel: Channel) -> DummyServiceStub @@ -124,12 +129,17 @@ test_negative/negative.py: error: Return type "Iterator[DummyReply]" of "StreamU test_negative/negative.py: error: Argument 1 of "StreamUnary" is incompatible with supertype "testproto.grpc.dummy_pb2_grpc.DummyServiceServicer"; supertype defines the argument type as "_MaybeAsyncIterator[DummyRequest]" [override] test_negative/negative.py: note: This violates the Liskov substitution principle test_negative/negative.py: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#incompatible-overrides +test_negative/negative.py: error: function testproto.grpc.dummy_pb2_grpc.DeprecatedServiceStub.DeprecatedMethod is deprecated: This method has been marked as deprecated using proto method options. [deprecated] +test_negative/negative.py: error: function testproto.grpc.dummy_pb2_grpc.DeprecatedServiceStub.DeprecatedMethodNotDeprecatedRequest is deprecated: Method is deprecated, but request message is not [deprecated] test_negative/negative.py: error: class testproto.grpc.dummy_pb2_grpc.DeprecatedServiceAsyncStub is deprecated: This service is deprecated [deprecated] +test_negative/negative.py: error: function testproto.test_pb2._DeprecatedEnumEnumTypeWrapper.DEPRECATED_ONE is deprecated: This enum value has been marked as deprecated using proto enum value options. [deprecated] +test_negative/negative.py: error: function testproto.test_pb2._DeprecatedEnumEnumTypeWrapper.DEPRECATED_TWO is deprecated: This enum value has been marked as deprecated using proto enum value options. [deprecated] test_negative/negative.py: error: Argument "implicit_singular" to "Editions2024Test" has incompatible type "None"; expected "str" [arg-type] test_negative/negative.py: error: Argument 1 to "HasField" of "Editions2024Test" has incompatible type "Literal['implicit_singular']"; expected "Literal['default_singular', b'default_singular', 'explicit_singular', b'explicit_singular', 'legacy', b'legacy', 'message_field', b'message_field']" [arg-type] test_negative/negative.py: error: Cannot instantiate abstract class "IncompleteServicer" with abstract attributes "StreamStream", "StreamUnary", "UnaryStream" and "UnaryUnary" [abstract] test_negative/negative.py: error: Argument 2 to "test_hasfield_alias" has incompatible type "Literal['not_a_field']"; expected "Literal['default_singular', b'default_singular', 'explicit_singular', b'explicit_singular', 'legacy', b'legacy', 'message_field', b'message_field']" [arg-type] test_negative/negative.py: error: Argument 2 to "test_clearfield_alias" has incompatible type "Literal['not_a_field']"; expected "Literal['default_singular', b'default_singular', 'explicit_singular', b'explicit_singular', 'implicit_singular', b'implicit_singular', 'legacy', b'legacy', 'message_field', b'message_field']" [arg-type] +test_negative/negative.py: error: Property "message_field" defined in "Editions2024Test" is read-only [misc] test_negative/negative.py: error: Argument 2 to "test_whichoneof_alias" has incompatible type "Literal['not_a_oneof']"; expected "Literal['a_oneof', b'a_oneof']" [arg-type] test_negative/negative.py: error: All overload variants of "DummyServiceStub" require at least one argument [call-overload] test_negative/negative.py: note: Possible overload variants: @@ -139,4 +149,4 @@ test_negative/negative.py: error: No overload variant of "DummyServiceStub" matc test_negative/negative.py: note: Possible overload variants: test_negative/negative.py: note: def __new__(cls, channel: Channel) -> DummyServiceStub test_negative/negative.py: note: def __new__(cls, channel: Channel) -> DummyServiceAsyncStub -Found 105 errors in 4 files (checked 4 source files) +Found 114 errors in 4 files (checked 4 source files) diff --git a/test_negative/output.expected.3.11 b/test_negative/output.expected.3.11 index f60b9d96..d7341476 100644 --- a/test_negative/output.expected.3.11 +++ b/test_negative/output.expected.3.11 @@ -1,18 +1,22 @@ -test/generated/testproto/grpc/dummy_pb2.pyi:71: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] +test/generated/testproto/grpc/dummy_pb2.pyi:76: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] test/generated/testproto/grpc/dummy_pb2_grpc.pyi:103: error: class testproto.grpc.dummy_pb2_grpc.DeprecatedServiceAsyncStub is deprecated: This service is deprecated [deprecated] -test/generated/testproto/grpc/dummy_pb2_grpc.pyi:104: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] -test/generated/testproto/grpc/dummy_pb2_grpc.pyi:111: error: class testproto.grpc.dummy_pb2_grpc.DeprecatedServiceStub is deprecated: This service is deprecated [deprecated] -test/generated/testproto/grpc/dummy_pb2_grpc.pyi:115: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] -test/generated/testproto/grpc/dummy_pb2_grpc.pyi:115: note: Error code "deprecated" not covered by "type: ignore" comment -test/generated/testproto/grpc/dummy_pb2_grpc.pyi:127: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] -test/generated/testproto/grpc/dummy_pb2_grpc.pyi:141: error: class testproto.grpc.dummy_pb2_grpc.DeprecatedServiceServicer is deprecated: This service is deprecated [deprecated] -test/generated/testproto/test_pb2.pyi:88: error: class testproto.test_pb2.DeprecatedEnum is deprecated: This enum is deprecated +test/generated/testproto/grpc/dummy_pb2_grpc.pyi:106: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] +test/generated/testproto/grpc/dummy_pb2_grpc.pyi:114: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] +test/generated/testproto/grpc/dummy_pb2_grpc.pyi:118: error: class testproto.grpc.dummy_pb2_grpc.DeprecatedServiceStub is deprecated: This service is deprecated [deprecated] +test/generated/testproto/grpc/dummy_pb2_grpc.pyi:124: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] +test/generated/testproto/grpc/dummy_pb2_grpc.pyi:124: note: Error code "deprecated" not covered by "type: ignore" comment +test/generated/testproto/grpc/dummy_pb2_grpc.pyi:132: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] +test/generated/testproto/grpc/dummy_pb2_grpc.pyi:132: note: Error code "deprecated" not covered by "type: ignore" comment +test/generated/testproto/grpc/dummy_pb2_grpc.pyi:141: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] +test/generated/testproto/grpc/dummy_pb2_grpc.pyi:157: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] +test/generated/testproto/grpc/dummy_pb2_grpc.pyi:162: error: class testproto.grpc.dummy_pb2_grpc.DeprecatedServiceServicer is deprecated: This service is deprecated [deprecated] +test/generated/testproto/test_pb2.pyi:96: error: class testproto.test_pb2.DeprecatedEnum is deprecated: This enum is deprecated 2 lines of comments "Quotes in comments" and 'single quotes' Trailing comment [deprecated] -test/generated/testproto/test_pb2.pyi:446: error: class testproto.test_pb2.DeprecatedMessage is deprecated: This message is deprecated [deprecated] -test/generated/testproto/test_pb2.pyi:465: error: class testproto.test_pb2.DeprecatedMessageBadComment is deprecated: This message has been marked as deprecated using proto message options. [deprecated] +test/generated/testproto/test_pb2.pyi:474: error: class testproto.test_pb2.DeprecatedMessage is deprecated: This message is deprecated [deprecated] +test/generated/testproto/test_pb2.pyi:493: error: class testproto.test_pb2.DeprecatedMessageBadComment is deprecated: This message has been marked as deprecated using proto message options. [deprecated] test_negative/negative.py:16: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] test_negative/negative.py:21: error: class testproto.grpc.dummy_pb2_grpc.DeprecatedServiceServicer is deprecated: This service is deprecated [deprecated] test_negative/negative.py:21: error: class testproto.grpc.dummy_pb2_grpc.DeprecatedServiceStub is deprecated: This service is deprecated [deprecated] @@ -23,120 +27,126 @@ test_negative/negative.py:30: error: class testproto.test_pb2.DeprecatedEnum is and 'single quotes' Trailing comment [deprecated] test_negative/negative.py:31: error: class testproto.test_pb2.DeprecatedMessage is deprecated: This message is deprecated [deprecated] -test_negative/negative.py:45: error: "Simple1" has no attribute "SerializeToStringg" [attr-defined] -test_negative/negative.py:48: error: Argument 1 to "ParseFromString" of "Message" has incompatible type "Simple1"; expected "bytes" [arg-type] -test_negative/negative.py:51: error: Argument 1 to "CopyFrom" of "Message" has incompatible type "bytes"; expected "Simple1" [arg-type] -test_negative/negative.py:55: error: Argument 1 to "extend" of "list" has incompatible type "RepeatedScalarFieldContainer[str]"; expected "Iterable[int]" [arg-type] -test_negative/negative.py:57: error: Argument "foo" to "TestMessage" has incompatible type "int"; expected "str" [arg-type] -test_negative/negative.py:60: error: Incompatible types in assignment (expression has type "int", variable has type "ValueType") [assignment] -test_negative/negative.py:63: error: Argument 1 to "HasField" of "Simple1" has incompatible type "Literal['garbage']"; expected "Literal['a_boolean', b'a_boolean', 'a_enum', b'a_enum', 'a_external_enum', b'a_external_enum', 'a_inner', b'a_inner', 'a_nested', b'a_nested', 'a_oneof', b'a_oneof', 'a_oneof_1', b'a_oneof_1', 'a_oneof_2', b'a_oneof_2', 'a_string', b'a_string', 'a_uint32', b'a_uint32', 'email', b'email', 'inner_enum', b'inner_enum', 'inner_enum_in_oneof', b'inner_enum_in_oneof', 'inner_message', b'inner_message', 'nested_enum', b'nested_enum', 'nested_message', b'nested_message', 'no_package', b'no_package', 'outer_enum_in_oneof', b'outer_enum_in_oneof', 'outer_message_in_oneof', b'outer_message_in_oneof', 'user_id', b'user_id']" [arg-type] -test_negative/negative.py:64: error: Argument 1 to "HasField" of "Simple1" has incompatible type "Literal['a_repeated_string']"; expected "Literal['a_boolean', b'a_boolean', 'a_enum', b'a_enum', 'a_external_enum', b'a_external_enum', 'a_inner', b'a_inner', 'a_nested', b'a_nested', 'a_oneof', b'a_oneof', 'a_oneof_1', b'a_oneof_1', 'a_oneof_2', b'a_oneof_2', 'a_string', b'a_string', 'a_uint32', b'a_uint32', 'email', b'email', 'inner_enum', b'inner_enum', 'inner_enum_in_oneof', b'inner_enum_in_oneof', 'inner_message', b'inner_message', 'nested_enum', b'nested_enum', 'nested_message', b'nested_message', 'no_package', b'no_package', 'outer_enum_in_oneof', b'outer_enum_in_oneof', 'outer_message_in_oneof', b'outer_message_in_oneof', 'user_id', b'user_id']" [arg-type] -test_negative/negative.py:68: error: Argument 1 to "HasField" of "SimpleProto3" has incompatible type "Literal['garbage']"; expected "Literal['OuterMessage3', b'OuterMessage3', '_an_optional_string', b'_an_optional_string', 'a_oneof', b'a_oneof', 'a_oneof_1', b'a_oneof_1', 'a_oneof_2', b'a_oneof_2', 'an_optional_string', b'an_optional_string', 'b_oneof', b'b_oneof', 'b_oneof_1', b'b_oneof_1', 'b_oneof_2', b'b_oneof_2', 'bool', b'bool', 'inner_enum_in_oneof', b'inner_enum_in_oneof', 'outer_enum_in_oneof', b'outer_enum_in_oneof', 'outer_message', b'outer_message', 'outer_message_in_oneof', b'outer_message_in_oneof']" [arg-type] -test_negative/negative.py:69: error: Argument 1 to "HasField" of "SimpleProto3" has incompatible type "Literal['a_string']"; expected "Literal['OuterMessage3', b'OuterMessage3', '_an_optional_string', b'_an_optional_string', 'a_oneof', b'a_oneof', 'a_oneof_1', b'a_oneof_1', 'a_oneof_2', b'a_oneof_2', 'an_optional_string', b'an_optional_string', 'b_oneof', b'b_oneof', 'b_oneof_1', b'b_oneof_1', 'b_oneof_2', b'b_oneof_2', 'bool', b'bool', 'inner_enum_in_oneof', b'inner_enum_in_oneof', 'outer_enum_in_oneof', b'outer_enum_in_oneof', 'outer_message', b'outer_message', 'outer_message_in_oneof', b'outer_message_in_oneof']" [arg-type] -test_negative/negative.py:70: error: Argument 1 to "HasField" of "SimpleProto3" has incompatible type "Literal['outer_enum']"; expected "Literal['OuterMessage3', b'OuterMessage3', '_an_optional_string', b'_an_optional_string', 'a_oneof', b'a_oneof', 'a_oneof_1', b'a_oneof_1', 'a_oneof_2', b'a_oneof_2', 'an_optional_string', b'an_optional_string', 'b_oneof', b'b_oneof', 'b_oneof_1', b'b_oneof_1', 'b_oneof_2', b'b_oneof_2', 'bool', b'bool', 'inner_enum_in_oneof', b'inner_enum_in_oneof', 'outer_enum_in_oneof', b'outer_enum_in_oneof', 'outer_message', b'outer_message', 'outer_message_in_oneof', b'outer_message_in_oneof']" [arg-type] -test_negative/negative.py:71: error: Argument 1 to "HasField" of "SimpleProto3" has incompatible type "Literal['a_repeated_string']"; expected "Literal['OuterMessage3', b'OuterMessage3', '_an_optional_string', b'_an_optional_string', 'a_oneof', b'a_oneof', 'a_oneof_1', b'a_oneof_1', 'a_oneof_2', b'a_oneof_2', 'an_optional_string', b'an_optional_string', 'b_oneof', b'b_oneof', 'b_oneof_1', b'b_oneof_1', 'b_oneof_2', b'b_oneof_2', 'bool', b'bool', 'inner_enum_in_oneof', b'inner_enum_in_oneof', 'outer_enum_in_oneof', b'outer_enum_in_oneof', 'outer_message', b'outer_message', 'outer_message_in_oneof', b'outer_message_in_oneof']" [arg-type] -test_negative/negative.py:74: error: Argument 1 to "ClearField" of "Simple1" has incompatible type "Literal['garbage']"; expected "Literal['a_boolean', b'a_boolean', 'a_enum', b'a_enum', 'a_external_enum', b'a_external_enum', 'a_inner', b'a_inner', 'a_nested', b'a_nested', 'a_oneof', b'a_oneof', 'a_oneof_1', b'a_oneof_1', 'a_oneof_2', b'a_oneof_2', 'a_repeated_string', b'a_repeated_string', 'a_string', b'a_string', 'a_uint32', b'a_uint32', 'email', b'email', 'email_by_uid', b'email_by_uid', 'inner_enum', b'inner_enum', 'inner_enum_in_oneof', b'inner_enum_in_oneof', 'inner_message', b'inner_message', 'nested_enum', b'nested_enum', 'nested_message', b'nested_message', 'no_package', b'no_package', 'outer_enum_in_oneof', b'outer_enum_in_oneof', 'outer_message_in_oneof', b'outer_message_in_oneof', 'rep_inner_enum', b'rep_inner_enum', 'rep_inner_message', b'rep_inner_message', 'user_id', b'user_id']" [arg-type] -test_negative/negative.py:77: error: Argument 1 to "ClearField" of "SimpleProto3" has incompatible type "Literal['garbage']"; expected "Literal['OuterEnum', b'OuterEnum', 'OuterMessage3', b'OuterMessage3', '_an_optional_string', b'_an_optional_string', 'a_oneof', b'a_oneof', 'a_oneof_1', b'a_oneof_1', 'a_oneof_2', b'a_oneof_2', 'a_outer_enum', b'a_outer_enum', 'a_repeated_string', b'a_repeated_string', 'a_string', b'a_string', 'an_optional_string', b'an_optional_string', 'b_oneof', b'b_oneof', 'b_oneof_1', b'b_oneof_1', 'b_oneof_2', b'b_oneof_2', 'bool', b'bool', 'email', b'email', 'email_by_uid', b'email_by_uid', 'inner_enum', b'inner_enum', 'inner_enum_in_oneof', b'inner_enum_in_oneof', 'map_message', b'map_message', 'map_scalar', b'map_scalar', 'outer_enum_in_oneof', b'outer_enum_in_oneof', 'outer_message', b'outer_message', 'outer_message_in_oneof', b'outer_message_in_oneof', 'user_id', b'user_id']" [arg-type] -test_negative/negative.py:80: error: Argument 1 to "WhichOneof" of "Simple1" has incompatible type "Literal['garbage']"; expected "Literal['a_oneof', b'a_oneof']" [arg-type] -test_negative/negative.py:82: error: Incompatible types in assignment (expression has type "Literal['a_oneof_1', 'a_oneof_2', 'outer_message_in_oneof', 'outer_enum_in_oneof', 'inner_enum_in_oneof'] | None", variable has type "int") [assignment] -test_negative/negative.py:87: error: Argument 1 to "HasField" of "Simple2" has incompatible type "Literal['a_oneof_1', 'a_oneof_2', 'outer_message_in_oneof', 'outer_enum_in_oneof', 'inner_enum_in_oneof']"; expected "Literal['a_string', b'a_string']" [arg-type] -test_negative/negative.py:91: error: Incompatible types in assignment (expression has type "Literal['a_oneof_1', 'a_oneof_2', 'outer_message_in_oneof', 'outer_enum_in_oneof', 'inner_enum_in_oneof'] | None", variable has type "str") [assignment] -test_negative/negative.py:94: error: No overload variant of "WhichOneof" of "SimpleProto3" matches argument type "str" [call-overload] -test_negative/negative.py:94: note: Possible overload variants: -test_negative/negative.py:94: note: def WhichOneof(self, oneof_group: Literal['_an_optional_string', b'_an_optional_string']) -> Literal['an_optional_string'] | None -test_negative/negative.py:94: note: def WhichOneof(self, oneof_group: Literal['a_oneof', b'a_oneof']) -> Literal['a_oneof_1', 'a_oneof_2', 'outer_message_in_oneof', 'outer_enum_in_oneof', 'inner_enum_in_oneof'] | None -test_negative/negative.py:94: note: def WhichOneof(self, oneof_group: Literal['b_oneof', b'b_oneof']) -> Literal['b_oneof_1', 'b_oneof_2'] | None -test_negative/negative.py:96: error: Incompatible types in assignment (expression has type "Literal['a_oneof_1', 'a_oneof_2', 'outer_message_in_oneof', 'outer_enum_in_oneof', 'inner_enum_in_oneof'] | None", variable has type "int") [assignment] -test_negative/negative.py:100: error: Argument 1 to "HasField" of "Simple2" has incompatible type "Literal['a_oneof_1', 'a_oneof_2', 'outer_message_in_oneof', 'outer_enum_in_oneof', 'inner_enum_in_oneof']"; expected "Literal['a_string', b'a_string']" [arg-type] -test_negative/negative.py:104: error: Incompatible types in assignment (expression has type "_ExtensionFieldDescriptor[Simple1, Extensions1]", variable has type "int") [assignment] -test_negative/negative.py:105: error: "type[Extensions1]" has no attribute "bad" [attr-defined] -test_negative/negative.py:107: error: "Extensions1" has no attribute "foo" [attr-defined] -test_negative/negative.py:108: error: Incompatible types in assignment (expression has type "Extensions2", variable has type "Extensions1") [assignment] -test_negative/negative.py:112: error: Invalid index type "str" for "_ExtensionDict[Simple1]"; expected type "_ExtensionFieldDescriptor[Simple1, Never]" [index] -test_negative/negative.py:113: error: Invalid index type "_ExtensionFieldDescriptor[Simple2, SeparateFileExtension]" for "_ExtensionDict[Simple1]"; expected type "_ExtensionFieldDescriptor[Simple1, SeparateFileExtension]" [index] -test_negative/negative.py:114: error: Unsupported operand types for in ("_ExtensionFieldDescriptor[Simple2, SeparateFileExtension]" and "_ExtensionDict[Simple1]") [operator] -test_negative/negative.py:115: error: Argument 1 to "__delitem__" of "_ExtensionDict" has incompatible type "_ExtensionFieldDescriptor[Simple2, SeparateFileExtension]"; expected "_ExtensionFieldDescriptor[Simple1, SeparateFileExtension]" [arg-type] -test_negative/negative.py:116: error: Argument 1 to "HasExtension" of "Message" has incompatible type "_ExtensionFieldDescriptor[Simple2, SeparateFileExtension]"; expected "_ExtensionFieldDescriptor[Simple1, Any]" [arg-type] -test_negative/negative.py:117: error: Argument 1 to "ClearExtension" of "Message" has incompatible type "_ExtensionFieldDescriptor[Simple1, Extensions1]"; expected "_ExtensionFieldDescriptor[Simple2, Any]" [arg-type] -test_negative/negative.py:121: error: Incompatible types in assignment (expression has type "int", variable has type "_ExtensionFieldDescriptor[Simple1, Any]") [assignment] -test_negative/negative.py:125: error: Incompatible types in assignment (expression has type "Literal['b_oneof_1', 'b_oneof_2'] | None", variable has type "Literal['a_oneof_1', 'a_oneof_2', 'outer_message_in_oneof', 'outer_enum_in_oneof', 'inner_enum_in_oneof'] | None") [assignment] -test_negative/negative.py:128: error: "Descriptor" has no attribute "Garbage" [attr-defined] +test_negative/negative.py:46: error: "Simple1" has no attribute "SerializeToStringg" [attr-defined] +test_negative/negative.py:49: error: Argument 1 to "ParseFromString" of "Message" has incompatible type "Simple1"; expected "bytes" [arg-type] +test_negative/negative.py:52: error: Argument 1 to "CopyFrom" of "Message" has incompatible type "bytes"; expected "Simple1" [arg-type] +test_negative/negative.py:56: error: Argument 1 to "extend" of "list" has incompatible type "RepeatedScalarFieldContainer[str]"; expected "Iterable[int]" [arg-type] +test_negative/negative.py:58: error: Argument "foo" to "TestMessage" has incompatible type "int"; expected "str" [arg-type] +test_negative/negative.py:61: error: Incompatible types in assignment (expression has type "int", variable has type "ValueType") [assignment] +test_negative/negative.py:64: error: Argument 1 to "HasField" of "Simple1" has incompatible type "Literal['garbage']"; expected "Literal['a_boolean', b'a_boolean', 'a_enum', b'a_enum', 'a_external_enum', b'a_external_enum', 'a_inner', b'a_inner', 'a_nested', b'a_nested', 'a_oneof', b'a_oneof', 'a_oneof_1', b'a_oneof_1', 'a_oneof_2', b'a_oneof_2', 'a_string', b'a_string', 'a_uint32', b'a_uint32', 'email', b'email', 'inner_enum', b'inner_enum', 'inner_enum_in_oneof', b'inner_enum_in_oneof', 'inner_message', b'inner_message', 'nested_enum', b'nested_enum', 'nested_message', b'nested_message', 'no_package', b'no_package', 'outer_enum_in_oneof', b'outer_enum_in_oneof', 'outer_message_in_oneof', b'outer_message_in_oneof', 'user_id', b'user_id']" [arg-type] +test_negative/negative.py:65: error: Argument 1 to "HasField" of "Simple1" has incompatible type "Literal['a_repeated_string']"; expected "Literal['a_boolean', b'a_boolean', 'a_enum', b'a_enum', 'a_external_enum', b'a_external_enum', 'a_inner', b'a_inner', 'a_nested', b'a_nested', 'a_oneof', b'a_oneof', 'a_oneof_1', b'a_oneof_1', 'a_oneof_2', b'a_oneof_2', 'a_string', b'a_string', 'a_uint32', b'a_uint32', 'email', b'email', 'inner_enum', b'inner_enum', 'inner_enum_in_oneof', b'inner_enum_in_oneof', 'inner_message', b'inner_message', 'nested_enum', b'nested_enum', 'nested_message', b'nested_message', 'no_package', b'no_package', 'outer_enum_in_oneof', b'outer_enum_in_oneof', 'outer_message_in_oneof', b'outer_message_in_oneof', 'user_id', b'user_id']" [arg-type] +test_negative/negative.py:69: error: Argument 1 to "HasField" of "SimpleProto3" has incompatible type "Literal['garbage']"; expected "Literal['OuterMessage3', b'OuterMessage3', '_an_optional_string', b'_an_optional_string', 'a_oneof', b'a_oneof', 'a_oneof_1', b'a_oneof_1', 'a_oneof_2', b'a_oneof_2', 'an_optional_string', b'an_optional_string', 'b_oneof', b'b_oneof', 'b_oneof_1', b'b_oneof_1', 'b_oneof_2', b'b_oneof_2', 'bool', b'bool', 'inner_enum_in_oneof', b'inner_enum_in_oneof', 'outer_enum_in_oneof', b'outer_enum_in_oneof', 'outer_message', b'outer_message', 'outer_message_in_oneof', b'outer_message_in_oneof']" [arg-type] +test_negative/negative.py:70: error: Argument 1 to "HasField" of "SimpleProto3" has incompatible type "Literal['a_string']"; expected "Literal['OuterMessage3', b'OuterMessage3', '_an_optional_string', b'_an_optional_string', 'a_oneof', b'a_oneof', 'a_oneof_1', b'a_oneof_1', 'a_oneof_2', b'a_oneof_2', 'an_optional_string', b'an_optional_string', 'b_oneof', b'b_oneof', 'b_oneof_1', b'b_oneof_1', 'b_oneof_2', b'b_oneof_2', 'bool', b'bool', 'inner_enum_in_oneof', b'inner_enum_in_oneof', 'outer_enum_in_oneof', b'outer_enum_in_oneof', 'outer_message', b'outer_message', 'outer_message_in_oneof', b'outer_message_in_oneof']" [arg-type] +test_negative/negative.py:71: error: Argument 1 to "HasField" of "SimpleProto3" has incompatible type "Literal['outer_enum']"; expected "Literal['OuterMessage3', b'OuterMessage3', '_an_optional_string', b'_an_optional_string', 'a_oneof', b'a_oneof', 'a_oneof_1', b'a_oneof_1', 'a_oneof_2', b'a_oneof_2', 'an_optional_string', b'an_optional_string', 'b_oneof', b'b_oneof', 'b_oneof_1', b'b_oneof_1', 'b_oneof_2', b'b_oneof_2', 'bool', b'bool', 'inner_enum_in_oneof', b'inner_enum_in_oneof', 'outer_enum_in_oneof', b'outer_enum_in_oneof', 'outer_message', b'outer_message', 'outer_message_in_oneof', b'outer_message_in_oneof']" [arg-type] +test_negative/negative.py:72: error: Argument 1 to "HasField" of "SimpleProto3" has incompatible type "Literal['a_repeated_string']"; expected "Literal['OuterMessage3', b'OuterMessage3', '_an_optional_string', b'_an_optional_string', 'a_oneof', b'a_oneof', 'a_oneof_1', b'a_oneof_1', 'a_oneof_2', b'a_oneof_2', 'an_optional_string', b'an_optional_string', 'b_oneof', b'b_oneof', 'b_oneof_1', b'b_oneof_1', 'b_oneof_2', b'b_oneof_2', 'bool', b'bool', 'inner_enum_in_oneof', b'inner_enum_in_oneof', 'outer_enum_in_oneof', b'outer_enum_in_oneof', 'outer_message', b'outer_message', 'outer_message_in_oneof', b'outer_message_in_oneof']" [arg-type] +test_negative/negative.py:75: error: Argument 1 to "ClearField" of "Simple1" has incompatible type "Literal['garbage']"; expected "Literal['a_boolean', b'a_boolean', 'a_enum', b'a_enum', 'a_external_enum', b'a_external_enum', 'a_inner', b'a_inner', 'a_nested', b'a_nested', 'a_oneof', b'a_oneof', 'a_oneof_1', b'a_oneof_1', 'a_oneof_2', b'a_oneof_2', 'a_repeated_string', b'a_repeated_string', 'a_string', b'a_string', 'a_uint32', b'a_uint32', 'email', b'email', 'email_by_uid', b'email_by_uid', 'inner_enum', b'inner_enum', 'inner_enum_in_oneof', b'inner_enum_in_oneof', 'inner_message', b'inner_message', 'nested_enum', b'nested_enum', 'nested_message', b'nested_message', 'no_package', b'no_package', 'outer_enum_in_oneof', b'outer_enum_in_oneof', 'outer_message_in_oneof', b'outer_message_in_oneof', 'rep_inner_enum', b'rep_inner_enum', 'rep_inner_message', b'rep_inner_message', 'user_id', b'user_id']" [arg-type] +test_negative/negative.py:78: error: Argument 1 to "ClearField" of "SimpleProto3" has incompatible type "Literal['garbage']"; expected "Literal['OuterEnum', b'OuterEnum', 'OuterMessage3', b'OuterMessage3', '_an_optional_string', b'_an_optional_string', 'a_oneof', b'a_oneof', 'a_oneof_1', b'a_oneof_1', 'a_oneof_2', b'a_oneof_2', 'a_outer_enum', b'a_outer_enum', 'a_repeated_string', b'a_repeated_string', 'a_string', b'a_string', 'an_optional_string', b'an_optional_string', 'b_oneof', b'b_oneof', 'b_oneof_1', b'b_oneof_1', 'b_oneof_2', b'b_oneof_2', 'bool', b'bool', 'email', b'email', 'email_by_uid', b'email_by_uid', 'inner_enum', b'inner_enum', 'inner_enum_in_oneof', b'inner_enum_in_oneof', 'map_message', b'map_message', 'map_scalar', b'map_scalar', 'outer_enum_in_oneof', b'outer_enum_in_oneof', 'outer_message', b'outer_message', 'outer_message_in_oneof', b'outer_message_in_oneof', 'user_id', b'user_id']" [arg-type] +test_negative/negative.py:81: error: Argument 1 to "WhichOneof" of "Simple1" has incompatible type "Literal['garbage']"; expected "Literal['a_oneof', b'a_oneof']" [arg-type] +test_negative/negative.py:83: error: Incompatible types in assignment (expression has type "Literal['a_oneof_1', 'a_oneof_2', 'outer_message_in_oneof', 'outer_enum_in_oneof', 'inner_enum_in_oneof'] | None", variable has type "int") [assignment] +test_negative/negative.py:88: error: Argument 1 to "HasField" of "Simple2" has incompatible type "Literal['a_oneof_1', 'a_oneof_2', 'outer_message_in_oneof', 'outer_enum_in_oneof', 'inner_enum_in_oneof']"; expected "Literal['a_string', b'a_string']" [arg-type] +test_negative/negative.py:92: error: Incompatible types in assignment (expression has type "Literal['a_oneof_1', 'a_oneof_2', 'outer_message_in_oneof', 'outer_enum_in_oneof', 'inner_enum_in_oneof'] | None", variable has type "str") [assignment] +test_negative/negative.py:95: error: No overload variant of "WhichOneof" of "SimpleProto3" matches argument type "str" [call-overload] +test_negative/negative.py:95: note: Possible overload variants: +test_negative/negative.py:95: note: def WhichOneof(self, oneof_group: Literal['_an_optional_string', b'_an_optional_string']) -> Literal['an_optional_string'] | None +test_negative/negative.py:95: note: def WhichOneof(self, oneof_group: Literal['a_oneof', b'a_oneof']) -> Literal['a_oneof_1', 'a_oneof_2', 'outer_message_in_oneof', 'outer_enum_in_oneof', 'inner_enum_in_oneof'] | None +test_negative/negative.py:95: note: def WhichOneof(self, oneof_group: Literal['b_oneof', b'b_oneof']) -> Literal['b_oneof_1', 'b_oneof_2'] | None +test_negative/negative.py:97: error: Incompatible types in assignment (expression has type "Literal['a_oneof_1', 'a_oneof_2', 'outer_message_in_oneof', 'outer_enum_in_oneof', 'inner_enum_in_oneof'] | None", variable has type "int") [assignment] +test_negative/negative.py:101: error: Argument 1 to "HasField" of "Simple2" has incompatible type "Literal['a_oneof_1', 'a_oneof_2', 'outer_message_in_oneof', 'outer_enum_in_oneof', 'inner_enum_in_oneof']"; expected "Literal['a_string', b'a_string']" [arg-type] +test_negative/negative.py:105: error: Incompatible types in assignment (expression has type "_ExtensionFieldDescriptor[Simple1, Extensions1]", variable has type "int") [assignment] +test_negative/negative.py:106: error: "type[Extensions1]" has no attribute "bad" [attr-defined] +test_negative/negative.py:108: error: "Extensions1" has no attribute "foo" [attr-defined] +test_negative/negative.py:109: error: Incompatible types in assignment (expression has type "Extensions2", variable has type "Extensions1") [assignment] +test_negative/negative.py:113: error: Invalid index type "str" for "_ExtensionDict[Simple1]"; expected type "_ExtensionFieldDescriptor[Simple1, Never]" [index] +test_negative/negative.py:114: error: Invalid index type "_ExtensionFieldDescriptor[Simple2, SeparateFileExtension]" for "_ExtensionDict[Simple1]"; expected type "_ExtensionFieldDescriptor[Simple1, SeparateFileExtension]" [index] +test_negative/negative.py:115: error: Unsupported operand types for in ("_ExtensionFieldDescriptor[Simple2, SeparateFileExtension]" and "_ExtensionDict[Simple1]") [operator] +test_negative/negative.py:116: error: Argument 1 to "__delitem__" of "_ExtensionDict" has incompatible type "_ExtensionFieldDescriptor[Simple2, SeparateFileExtension]"; expected "_ExtensionFieldDescriptor[Simple1, SeparateFileExtension]" [arg-type] +test_negative/negative.py:117: error: Argument 1 to "HasExtension" of "Message" has incompatible type "_ExtensionFieldDescriptor[Simple2, SeparateFileExtension]"; expected "_ExtensionFieldDescriptor[Simple1, Any]" [arg-type] +test_negative/negative.py:118: error: Argument 1 to "ClearExtension" of "Message" has incompatible type "_ExtensionFieldDescriptor[Simple1, Extensions1]"; expected "_ExtensionFieldDescriptor[Simple2, Any]" [arg-type] +test_negative/negative.py:122: error: Incompatible types in assignment (expression has type "int", variable has type "_ExtensionFieldDescriptor[Simple1, Any]") [assignment] +test_negative/negative.py:126: error: Incompatible types in assignment (expression has type "Literal['b_oneof_1', 'b_oneof_2'] | None", variable has type "Literal['a_oneof_1', 'a_oneof_2', 'outer_message_in_oneof', 'outer_enum_in_oneof', 'inner_enum_in_oneof'] | None") [assignment] test_negative/negative.py:129: error: "Descriptor" has no attribute "Garbage" [attr-defined] -test_negative/negative.py:132: error: "EnumDescriptor" has no attribute "Garbage" [attr-defined] -test_negative/negative.py:135: error: "FileDescriptor" has no attribute "Garbage" [attr-defined] -test_negative/negative.py:142: error: "ValueType" has no attribute "FOO" [attr-defined] -test_negative/negative.py:146: error: Argument 1 to "Name" of "_EnumTypeWrapper" has incompatible type "int"; expected "ValueType" [arg-type] -test_negative/negative.py:148: error: Argument 1 to "Name" of "_EnumTypeWrapper" has incompatible type "testproto.test3_pb2.SimpleProto3._InnerEnum.ValueType"; expected "testproto.test3_pb2._OuterEnum.ValueType" [arg-type] -test_negative/negative.py:150: error: Argument 1 to "Name" of "_EnumTypeWrapper" has incompatible type "testproto.test3_pb2.SimpleProto3._InnerEnum.ValueType"; expected "testproto.test3_pb2._OuterEnum.ValueType" [arg-type] -test_negative/negative.py:152: error: Argument 1 to "Name" of "_EnumTypeWrapper" has incompatible type "testproto.test3_pb2.SimpleProto3._InnerEnum.ValueType"; expected "testproto.test3_pb2._OuterEnum.ValueType" [arg-type] -test_negative/negative.py:156: error: "ScalarMap[int, str]" has no attribute "get_or_create" [attr-defined] -test_negative/negative.py:158: error: No overload variant of "get" of "ScalarMap" matches argument type "str" [call-overload] -test_negative/negative.py:158: note: Possible overload variants: -test_negative/negative.py:158: note: def get(self, key: int, default: None = ...) -> str | None -test_negative/negative.py:158: note: def get(self, key: int, default: str) -> str -test_negative/negative.py:158: note: def [_T] get(self, key: int, default: _T) -> str | _T -test_negative/negative.py:159: error: No overload variant of "get" of "MessageMap" matches argument type "str" [call-overload] +test_negative/negative.py:130: error: "Descriptor" has no attribute "Garbage" [attr-defined] +test_negative/negative.py:133: error: "EnumDescriptor" has no attribute "Garbage" [attr-defined] +test_negative/negative.py:136: error: "FileDescriptor" has no attribute "Garbage" [attr-defined] +test_negative/negative.py:143: error: "ValueType" has no attribute "FOO" [attr-defined] +test_negative/negative.py:147: error: Argument 1 to "Name" of "_EnumTypeWrapper" has incompatible type "int"; expected "ValueType" [arg-type] +test_negative/negative.py:149: error: Argument 1 to "Name" of "_EnumTypeWrapper" has incompatible type "testproto.test3_pb2.SimpleProto3._InnerEnum.ValueType"; expected "testproto.test3_pb2._OuterEnum.ValueType" [arg-type] +test_negative/negative.py:151: error: Argument 1 to "Name" of "_EnumTypeWrapper" has incompatible type "testproto.test3_pb2.SimpleProto3._InnerEnum.ValueType"; expected "testproto.test3_pb2._OuterEnum.ValueType" [arg-type] +test_negative/negative.py:153: error: Argument 1 to "Name" of "_EnumTypeWrapper" has incompatible type "testproto.test3_pb2.SimpleProto3._InnerEnum.ValueType"; expected "testproto.test3_pb2._OuterEnum.ValueType" [arg-type] +test_negative/negative.py:157: error: "ScalarMap[int, str]" has no attribute "get_or_create" [attr-defined] +test_negative/negative.py:159: error: No overload variant of "get" of "ScalarMap" matches argument type "str" [call-overload] test_negative/negative.py:159: note: Possible overload variants: -test_negative/negative.py:159: note: def get(self, key: int, default: None = ...) -> OuterMessage3 | None -test_negative/negative.py:159: note: def get(self, key: int, default: OuterMessage3) -> OuterMessage3 -test_negative/negative.py:159: note: def [_T] get(self, key: int, default: _T) -> OuterMessage3 | _T -test_negative/negative.py:162: error: Incompatible types in assignment (expression has type "str | None", variable has type "int") [assignment] -test_negative/negative.py:163: error: Incompatible types in assignment (expression has type "OuterMessage3 | None", variable has type "int") [assignment] -test_negative/negative.py:165: error: Dict entry 0 has incompatible type "str": "int"; expected "int": "str" [dict-item] -test_negative/negative.py:165: error: Dict entry 0 has incompatible type "str": "str"; expected "int": "OuterMessage3" [dict-item] -test_negative/negative.py:169: error: Incompatible types in assignment (expression has type "int", variable has type "UserId") [assignment] -test_negative/negative.py:170: error: Incompatible types in assignment (expression has type "str", variable has type "Email") [assignment] -test_negative/negative.py:171: error: Invalid index type "int" for "ScalarMap[UserId, Email]"; expected type "UserId" [index] -test_negative/negative.py:171: error: Incompatible types in assignment (expression has type "str", target has type "Email") [assignment] +test_negative/negative.py:159: note: def get(self, key: int, default: None = ...) -> str | None +test_negative/negative.py:159: note: def get(self, key: int, default: str) -> str +test_negative/negative.py:159: note: def [_T] get(self, key: int, default: _T) -> str | _T +test_negative/negative.py:160: error: No overload variant of "get" of "MessageMap" matches argument type "str" [call-overload] +test_negative/negative.py:160: note: Possible overload variants: +test_negative/negative.py:160: note: def get(self, key: int, default: None = ...) -> OuterMessage3 | None +test_negative/negative.py:160: note: def get(self, key: int, default: OuterMessage3) -> OuterMessage3 +test_negative/negative.py:160: note: def [_T] get(self, key: int, default: _T) -> OuterMessage3 | _T +test_negative/negative.py:163: error: Incompatible types in assignment (expression has type "str | None", variable has type "int") [assignment] +test_negative/negative.py:164: error: Incompatible types in assignment (expression has type "OuterMessage3 | None", variable has type "int") [assignment] +test_negative/negative.py:166: error: Dict entry 0 has incompatible type "str": "int"; expected "int": "str" [dict-item] +test_negative/negative.py:166: error: Dict entry 0 has incompatible type "str": "str"; expected "int": "OuterMessage3" [dict-item] +test_negative/negative.py:170: error: Incompatible types in assignment (expression has type "int", variable has type "UserId") [assignment] +test_negative/negative.py:171: error: Incompatible types in assignment (expression has type "str", variable has type "Email") [assignment] +test_negative/negative.py:172: error: Invalid index type "int" for "ScalarMap[UserId, Email]"; expected type "UserId" [index] test_negative/negative.py:172: error: Incompatible types in assignment (expression has type "str", target has type "Email") [assignment] -test_negative/negative.py:173: error: Invalid index type "int" for "ScalarMap[UserId, Email]"; expected type "UserId" [index] -test_negative/negative.py:175: error: Argument "user_id" to "Simple1" has incompatible type "int"; expected "UserId | None" [arg-type] -test_negative/negative.py:176: error: Argument "email" to "Simple1" has incompatible type "str"; expected "Email | None" [arg-type] -test_negative/negative.py:177: error: Dict entry 0 has incompatible type "int": "str"; expected "UserId": "Email" [dict-item] -test_negative/negative.py:181: error: Module "testproto.reexport_pb2" has no attribute "Inner" [attr-defined] -test_negative/negative.py:185: error: Argument "a_string" to "OuterMessage3" has incompatible type "None"; expected "str" [arg-type] -test_negative/negative.py:190: error: Property "a_repeated_string" defined in "Simple1" is read-only [misc] -test_negative/negative.py:191: error: Property "rep_inner_enum" defined in "Simple1" is read-only [misc] -test_negative/negative.py:196: error: "_r_None" has no attribute "invalid"; maybe "valid"? [attr-defined] -test_negative/negative.py:200: error: Incompatible types in assignment (expression has type "ValueType", variable has type "str") [assignment] -test_negative/negative.py:204: error: All overload variants of "DummyServiceStub" require at least one argument [call-overload] -test_negative/negative.py:204: note: Possible overload variants: -test_negative/negative.py:204: note: def __new__(cls, channel: Channel) -> DummyServiceStub -test_negative/negative.py:204: note: def __new__(cls, channel: Channel) -> DummyServiceAsyncStub -test_negative/negative.py:211: error: "DummyReply" has no attribute "not_exists" [attr-defined] -test_negative/negative.py:212: error: "DummyReply" has no attribute "__iter__" (not iterable) [attr-defined] -test_negative/negative.py:217: error: "DummyReply" has no attribute "not_exists" [attr-defined] -test_negative/negative.py:219: error: "_CallIterator[DummyReply]" has no attribute "value" [attr-defined] -test_negative/negative.py:226: error: Argument 1 to "__call__" of "StreamUnaryMultiCallable" has incompatible type "DummyRequest"; expected "Iterator[DummyRequest]" [arg-type] -test_negative/negative.py:228: error: "DummyReply" has no attribute "__iter__" (not iterable) [attr-defined] -test_negative/negative.py:228: error: Argument 1 to "__call__" of "StreamUnaryMultiCallable" has incompatible type "DummyRequest"; expected "Iterator[DummyRequest]" [arg-type] -test_negative/negative.py:231: error: Argument 1 to "__call__" of "StreamStreamMultiCallable" has incompatible type "DummyRequest"; expected "Iterator[DummyRequest]" [arg-type] -test_negative/negative.py:235: error: "DummyReply" has no attribute "not_exists" [attr-defined] -test_negative/negative.py:272: error: Return type "Iterator[DummyReply]" of "UnaryUnary" incompatible with return type "DummyReply | Awaitable[DummyReply]" in supertype "testproto.grpc.dummy_pb2_grpc.DummyServiceServicer" [override] -test_negative/negative.py:274: error: Argument 1 of "UnaryUnary" is incompatible with supertype "testproto.grpc.dummy_pb2_grpc.DummyServiceServicer"; supertype defines the argument type as "DummyRequest" [override] -test_negative/negative.py:274: note: This violates the Liskov substitution principle -test_negative/negative.py:274: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#incompatible-overrides -test_negative/negative.py:280: error: Return type "DummyReply" of "UnaryStream" incompatible with return type "Iterator[DummyReply] | AsyncIterator[DummyReply]" in supertype "testproto.grpc.dummy_pb2_grpc.DummyServiceServicer" [override] -test_negative/negative.py:282: error: Argument 1 of "UnaryStream" is incompatible with supertype "testproto.grpc.dummy_pb2_grpc.DummyServiceServicer"; supertype defines the argument type as "DummyRequest" [override] -test_negative/negative.py:282: note: This violates the Liskov substitution principle -test_negative/negative.py:282: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#incompatible-overrides -test_negative/negative.py:289: error: Return type "Iterator[DummyReply]" of "StreamUnary" incompatible with return type "DummyReply | Awaitable[DummyReply]" in supertype "testproto.grpc.dummy_pb2_grpc.DummyServiceServicer" [override] -test_negative/negative.py:291: error: Argument 1 of "StreamUnary" is incompatible with supertype "testproto.grpc.dummy_pb2_grpc.DummyServiceServicer"; supertype defines the argument type as "_MaybeAsyncIterator[DummyRequest]" [override] -test_negative/negative.py:291: note: This violates the Liskov substitution principle -test_negative/negative.py:291: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#incompatible-overrides -test_negative/negative.py:320: error: class testproto.grpc.dummy_pb2_grpc.DeprecatedServiceAsyncStub is deprecated: This service is deprecated [deprecated] -test_negative/negative.py:332: error: Argument "implicit_singular" to "Editions2024Test" has incompatible type "None"; expected "str" [arg-type] -test_negative/negative.py:334: error: Argument 1 to "HasField" of "Editions2024Test" has incompatible type "Literal['implicit_singular']"; expected "Literal['default_singular', b'default_singular', 'explicit_singular', b'explicit_singular', 'legacy', b'legacy', 'message_field', b'message_field']" [arg-type] -test_negative/negative.py:345: error: Cannot instantiate abstract class "IncompleteServicer" with abstract attributes "StreamStream", "StreamUnary", "UnaryStream" and "UnaryUnary" [abstract] -test_negative/negative.py:352: error: Argument 2 to "test_hasfield_alias" has incompatible type "Literal['not_a_field']"; expected "Literal['default_singular', b'default_singular', 'explicit_singular', b'explicit_singular', 'legacy', b'legacy', 'message_field', b'message_field']" [arg-type] -test_negative/negative.py:359: error: Argument 2 to "test_clearfield_alias" has incompatible type "Literal['not_a_field']"; expected "Literal['default_singular', b'default_singular', 'explicit_singular', b'explicit_singular', 'implicit_singular', b'implicit_singular', 'legacy', b'legacy', 'message_field', b'message_field']" [arg-type] -test_negative/negative.py:369: error: Argument 2 to "test_whichoneof_alias" has incompatible type "Literal['not_a_oneof']"; expected "Literal['a_oneof', b'a_oneof']" [arg-type] -test_negative/negative.py:372: error: All overload variants of "DummyServiceStub" require at least one argument [call-overload] -test_negative/negative.py:372: note: Possible overload variants: -test_negative/negative.py:372: note: def __new__(cls, channel: Channel) -> DummyServiceStub -test_negative/negative.py:372: note: def __new__(cls, channel: Channel) -> DummyServiceAsyncStub -test_negative/negative.py:373: error: No overload variant of "DummyServiceStub" matches argument type "str" [call-overload] -test_negative/negative.py:373: note: Possible overload variants: -test_negative/negative.py:373: note: def __new__(cls, channel: Channel) -> DummyServiceStub -test_negative/negative.py:373: note: def __new__(cls, channel: Channel) -> DummyServiceAsyncStub -Found 105 errors in 4 files (checked 4 source files) +test_negative/negative.py:173: error: Incompatible types in assignment (expression has type "str", target has type "Email") [assignment] +test_negative/negative.py:174: error: Invalid index type "int" for "ScalarMap[UserId, Email]"; expected type "UserId" [index] +test_negative/negative.py:176: error: Argument "user_id" to "Simple1" has incompatible type "int"; expected "UserId | None" [arg-type] +test_negative/negative.py:177: error: Argument "email" to "Simple1" has incompatible type "str"; expected "Email | None" [arg-type] +test_negative/negative.py:178: error: Dict entry 0 has incompatible type "int": "str"; expected "UserId": "Email" [dict-item] +test_negative/negative.py:182: error: Module "testproto.reexport_pb2" has no attribute "Inner" [attr-defined] +test_negative/negative.py:186: error: Argument "a_string" to "OuterMessage3" has incompatible type "None"; expected "str" [arg-type] +test_negative/negative.py:191: error: Property "a_repeated_string" defined in "Simple1" is read-only [misc] +test_negative/negative.py:192: error: Property "rep_inner_enum" defined in "Simple1" is read-only [misc] +test_negative/negative.py:197: error: "_r_None" has no attribute "invalid"; maybe "valid"? [attr-defined] +test_negative/negative.py:201: error: Incompatible types in assignment (expression has type "ValueType", variable has type "str") [assignment] +test_negative/negative.py:205: error: function testproto.test_pb2.DeprecatedMessage.deprecated_field is deprecated: This field has been marked as deprecated using proto field options. [deprecated] +test_negative/negative.py:207: error: All overload variants of "DummyServiceStub" require at least one argument [call-overload] +test_negative/negative.py:207: note: Possible overload variants: +test_negative/negative.py:207: note: def __new__(cls, channel: Channel) -> DummyServiceStub +test_negative/negative.py:207: note: def __new__(cls, channel: Channel) -> DummyServiceAsyncStub +test_negative/negative.py:214: error: "DummyReply" has no attribute "not_exists" [attr-defined] +test_negative/negative.py:215: error: "DummyReply" has no attribute "__iter__" (not iterable) [attr-defined] +test_negative/negative.py:220: error: "DummyReply" has no attribute "not_exists" [attr-defined] +test_negative/negative.py:222: error: "_CallIterator[DummyReply]" has no attribute "value" [attr-defined] +test_negative/negative.py:229: error: Argument 1 to "__call__" of "StreamUnaryMultiCallable" has incompatible type "DummyRequest"; expected "Iterator[DummyRequest]" [arg-type] +test_negative/negative.py:231: error: "DummyReply" has no attribute "__iter__" (not iterable) [attr-defined] +test_negative/negative.py:231: error: Argument 1 to "__call__" of "StreamUnaryMultiCallable" has incompatible type "DummyRequest"; expected "Iterator[DummyRequest]" [arg-type] +test_negative/negative.py:234: error: Argument 1 to "__call__" of "StreamStreamMultiCallable" has incompatible type "DummyRequest"; expected "Iterator[DummyRequest]" [arg-type] +test_negative/negative.py:238: error: "DummyReply" has no attribute "not_exists" [attr-defined] +test_negative/negative.py:275: error: Return type "Iterator[DummyReply]" of "UnaryUnary" incompatible with return type "DummyReply | Awaitable[DummyReply]" in supertype "testproto.grpc.dummy_pb2_grpc.DummyServiceServicer" [override] +test_negative/negative.py:277: error: Argument 1 of "UnaryUnary" is incompatible with supertype "testproto.grpc.dummy_pb2_grpc.DummyServiceServicer"; supertype defines the argument type as "DummyRequest" [override] +test_negative/negative.py:277: note: This violates the Liskov substitution principle +test_negative/negative.py:277: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#incompatible-overrides +test_negative/negative.py:283: error: Return type "DummyReply" of "UnaryStream" incompatible with return type "Iterator[DummyReply] | AsyncIterator[DummyReply]" in supertype "testproto.grpc.dummy_pb2_grpc.DummyServiceServicer" [override] +test_negative/negative.py:285: error: Argument 1 of "UnaryStream" is incompatible with supertype "testproto.grpc.dummy_pb2_grpc.DummyServiceServicer"; supertype defines the argument type as "DummyRequest" [override] +test_negative/negative.py:285: note: This violates the Liskov substitution principle +test_negative/negative.py:285: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#incompatible-overrides +test_negative/negative.py:292: error: Return type "Iterator[DummyReply]" of "StreamUnary" incompatible with return type "DummyReply | Awaitable[DummyReply]" in supertype "testproto.grpc.dummy_pb2_grpc.DummyServiceServicer" [override] +test_negative/negative.py:294: error: Argument 1 of "StreamUnary" is incompatible with supertype "testproto.grpc.dummy_pb2_grpc.DummyServiceServicer"; supertype defines the argument type as "_MaybeAsyncIterator[DummyRequest]" [override] +test_negative/negative.py:294: note: This violates the Liskov substitution principle +test_negative/negative.py:294: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#incompatible-overrides +test_negative/negative.py:328: error: function testproto.grpc.dummy_pb2_grpc.DeprecatedServiceStub.DeprecatedMethod is deprecated: This method has been marked as deprecated using proto method options. [deprecated] +test_negative/negative.py:329: error: function testproto.grpc.dummy_pb2_grpc.DeprecatedServiceStub.DeprecatedMethodNotDeprecatedRequest is deprecated: Method is deprecated, but request message is not [deprecated] +test_negative/negative.py:330: error: class testproto.grpc.dummy_pb2_grpc.DeprecatedServiceAsyncStub is deprecated: This service is deprecated [deprecated] +test_negative/negative.py:333: error: function testproto.test_pb2._DeprecatedEnumEnumTypeWrapper.DEPRECATED_ONE is deprecated: This enum value has been marked as deprecated using proto enum value options. [deprecated] +test_negative/negative.py:334: error: function testproto.test_pb2._DeprecatedEnumEnumTypeWrapper.DEPRECATED_TWO is deprecated: This enum value has been marked as deprecated using proto enum value options. [deprecated] +test_negative/negative.py:344: error: Argument "implicit_singular" to "Editions2024Test" has incompatible type "None"; expected "str" [arg-type] +test_negative/negative.py:346: error: Argument 1 to "HasField" of "Editions2024Test" has incompatible type "Literal['implicit_singular']"; expected "Literal['default_singular', b'default_singular', 'explicit_singular', b'explicit_singular', 'legacy', b'legacy', 'message_field', b'message_field']" [arg-type] +test_negative/negative.py:357: error: Cannot instantiate abstract class "IncompleteServicer" with abstract attributes "StreamStream", "StreamUnary", "UnaryStream" and "UnaryUnary" [abstract] +test_negative/negative.py:364: error: Argument 2 to "test_hasfield_alias" has incompatible type "Literal['not_a_field']"; expected "Literal['default_singular', b'default_singular', 'explicit_singular', b'explicit_singular', 'legacy', b'legacy', 'message_field', b'message_field']" [arg-type] +test_negative/negative.py:371: error: Argument 2 to "test_clearfield_alias" has incompatible type "Literal['not_a_field']"; expected "Literal['default_singular', b'default_singular', 'explicit_singular', b'explicit_singular', 'implicit_singular', b'implicit_singular', 'legacy', b'legacy', 'message_field', b'message_field']" [arg-type] +test_negative/negative.py:372: error: Property "message_field" defined in "Editions2024Test" is read-only [misc] +test_negative/negative.py:383: error: Argument 2 to "test_whichoneof_alias" has incompatible type "Literal['not_a_oneof']"; expected "Literal['a_oneof', b'a_oneof']" [arg-type] +test_negative/negative.py:386: error: All overload variants of "DummyServiceStub" require at least one argument [call-overload] +test_negative/negative.py:386: note: Possible overload variants: +test_negative/negative.py:386: note: def __new__(cls, channel: Channel) -> DummyServiceStub +test_negative/negative.py:386: note: def __new__(cls, channel: Channel) -> DummyServiceAsyncStub +test_negative/negative.py:387: error: No overload variant of "DummyServiceStub" matches argument type "str" [call-overload] +test_negative/negative.py:387: note: Possible overload variants: +test_negative/negative.py:387: note: def __new__(cls, channel: Channel) -> DummyServiceStub +test_negative/negative.py:387: note: def __new__(cls, channel: Channel) -> DummyServiceAsyncStub +Found 114 errors in 4 files (checked 4 source files) diff --git a/test_negative/output.expected.3.11.omit_linenos b/test_negative/output.expected.3.11.omit_linenos index b32a0a1e..abe41b67 100644 --- a/test_negative/output.expected.3.11.omit_linenos +++ b/test_negative/output.expected.3.11.omit_linenos @@ -1,10 +1,14 @@ test/generated/testproto/grpc/dummy_pb2.pyi: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] test/generated/testproto/grpc/dummy_pb2_grpc.pyi: error: class testproto.grpc.dummy_pb2_grpc.DeprecatedServiceAsyncStub is deprecated: This service is deprecated [deprecated] test/generated/testproto/grpc/dummy_pb2_grpc.pyi: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] +test/generated/testproto/grpc/dummy_pb2_grpc.pyi: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] test/generated/testproto/grpc/dummy_pb2_grpc.pyi: error: class testproto.grpc.dummy_pb2_grpc.DeprecatedServiceStub is deprecated: This service is deprecated [deprecated] test/generated/testproto/grpc/dummy_pb2_grpc.pyi: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] test/generated/testproto/grpc/dummy_pb2_grpc.pyi: note: Error code "deprecated" not covered by "type: ignore" comment test/generated/testproto/grpc/dummy_pb2_grpc.pyi: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] +test/generated/testproto/grpc/dummy_pb2_grpc.pyi: note: Error code "deprecated" not covered by "type: ignore" comment +test/generated/testproto/grpc/dummy_pb2_grpc.pyi: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] +test/generated/testproto/grpc/dummy_pb2_grpc.pyi: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] test/generated/testproto/grpc/dummy_pb2_grpc.pyi: error: class testproto.grpc.dummy_pb2_grpc.DeprecatedServiceServicer is deprecated: This service is deprecated [deprecated] test/generated/testproto/test_pb2.pyi: error: class testproto.test_pb2.DeprecatedEnum is deprecated: This enum is deprecated 2 lines of comments @@ -99,6 +103,7 @@ test_negative/negative.py: error: Property "a_repeated_string" defined in "Simpl test_negative/negative.py: error: Property "rep_inner_enum" defined in "Simple1" is read-only [misc] test_negative/negative.py: error: "_r_None" has no attribute "invalid"; maybe "valid"? [attr-defined] test_negative/negative.py: error: Incompatible types in assignment (expression has type "ValueType", variable has type "str") [assignment] +test_negative/negative.py: error: function testproto.test_pb2.DeprecatedMessage.deprecated_field is deprecated: This field has been marked as deprecated using proto field options. [deprecated] test_negative/negative.py: error: All overload variants of "DummyServiceStub" require at least one argument [call-overload] test_negative/negative.py: note: Possible overload variants: test_negative/negative.py: note: def __new__(cls, channel: Channel) -> DummyServiceStub @@ -124,12 +129,17 @@ test_negative/negative.py: error: Return type "Iterator[DummyReply]" of "StreamU test_negative/negative.py: error: Argument 1 of "StreamUnary" is incompatible with supertype "testproto.grpc.dummy_pb2_grpc.DummyServiceServicer"; supertype defines the argument type as "_MaybeAsyncIterator[DummyRequest]" [override] test_negative/negative.py: note: This violates the Liskov substitution principle test_negative/negative.py: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#incompatible-overrides +test_negative/negative.py: error: function testproto.grpc.dummy_pb2_grpc.DeprecatedServiceStub.DeprecatedMethod is deprecated: This method has been marked as deprecated using proto method options. [deprecated] +test_negative/negative.py: error: function testproto.grpc.dummy_pb2_grpc.DeprecatedServiceStub.DeprecatedMethodNotDeprecatedRequest is deprecated: Method is deprecated, but request message is not [deprecated] test_negative/negative.py: error: class testproto.grpc.dummy_pb2_grpc.DeprecatedServiceAsyncStub is deprecated: This service is deprecated [deprecated] +test_negative/negative.py: error: function testproto.test_pb2._DeprecatedEnumEnumTypeWrapper.DEPRECATED_ONE is deprecated: This enum value has been marked as deprecated using proto enum value options. [deprecated] +test_negative/negative.py: error: function testproto.test_pb2._DeprecatedEnumEnumTypeWrapper.DEPRECATED_TWO is deprecated: This enum value has been marked as deprecated using proto enum value options. [deprecated] test_negative/negative.py: error: Argument "implicit_singular" to "Editions2024Test" has incompatible type "None"; expected "str" [arg-type] test_negative/negative.py: error: Argument 1 to "HasField" of "Editions2024Test" has incompatible type "Literal['implicit_singular']"; expected "Literal['default_singular', b'default_singular', 'explicit_singular', b'explicit_singular', 'legacy', b'legacy', 'message_field', b'message_field']" [arg-type] test_negative/negative.py: error: Cannot instantiate abstract class "IncompleteServicer" with abstract attributes "StreamStream", "StreamUnary", "UnaryStream" and "UnaryUnary" [abstract] test_negative/negative.py: error: Argument 2 to "test_hasfield_alias" has incompatible type "Literal['not_a_field']"; expected "Literal['default_singular', b'default_singular', 'explicit_singular', b'explicit_singular', 'legacy', b'legacy', 'message_field', b'message_field']" [arg-type] test_negative/negative.py: error: Argument 2 to "test_clearfield_alias" has incompatible type "Literal['not_a_field']"; expected "Literal['default_singular', b'default_singular', 'explicit_singular', b'explicit_singular', 'implicit_singular', b'implicit_singular', 'legacy', b'legacy', 'message_field', b'message_field']" [arg-type] +test_negative/negative.py: error: Property "message_field" defined in "Editions2024Test" is read-only [misc] test_negative/negative.py: error: Argument 2 to "test_whichoneof_alias" has incompatible type "Literal['not_a_oneof']"; expected "Literal['a_oneof', b'a_oneof']" [arg-type] test_negative/negative.py: error: All overload variants of "DummyServiceStub" require at least one argument [call-overload] test_negative/negative.py: note: Possible overload variants: @@ -139,4 +149,4 @@ test_negative/negative.py: error: No overload variant of "DummyServiceStub" matc test_negative/negative.py: note: Possible overload variants: test_negative/negative.py: note: def __new__(cls, channel: Channel) -> DummyServiceStub test_negative/negative.py: note: def __new__(cls, channel: Channel) -> DummyServiceAsyncStub -Found 105 errors in 4 files (checked 4 source files) +Found 114 errors in 4 files (checked 4 source files) diff --git a/test_negative/output.expected.3.12 b/test_negative/output.expected.3.12 index f60b9d96..d7341476 100644 --- a/test_negative/output.expected.3.12 +++ b/test_negative/output.expected.3.12 @@ -1,18 +1,22 @@ -test/generated/testproto/grpc/dummy_pb2.pyi:71: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] +test/generated/testproto/grpc/dummy_pb2.pyi:76: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] test/generated/testproto/grpc/dummy_pb2_grpc.pyi:103: error: class testproto.grpc.dummy_pb2_grpc.DeprecatedServiceAsyncStub is deprecated: This service is deprecated [deprecated] -test/generated/testproto/grpc/dummy_pb2_grpc.pyi:104: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] -test/generated/testproto/grpc/dummy_pb2_grpc.pyi:111: error: class testproto.grpc.dummy_pb2_grpc.DeprecatedServiceStub is deprecated: This service is deprecated [deprecated] -test/generated/testproto/grpc/dummy_pb2_grpc.pyi:115: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] -test/generated/testproto/grpc/dummy_pb2_grpc.pyi:115: note: Error code "deprecated" not covered by "type: ignore" comment -test/generated/testproto/grpc/dummy_pb2_grpc.pyi:127: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] -test/generated/testproto/grpc/dummy_pb2_grpc.pyi:141: error: class testproto.grpc.dummy_pb2_grpc.DeprecatedServiceServicer is deprecated: This service is deprecated [deprecated] -test/generated/testproto/test_pb2.pyi:88: error: class testproto.test_pb2.DeprecatedEnum is deprecated: This enum is deprecated +test/generated/testproto/grpc/dummy_pb2_grpc.pyi:106: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] +test/generated/testproto/grpc/dummy_pb2_grpc.pyi:114: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] +test/generated/testproto/grpc/dummy_pb2_grpc.pyi:118: error: class testproto.grpc.dummy_pb2_grpc.DeprecatedServiceStub is deprecated: This service is deprecated [deprecated] +test/generated/testproto/grpc/dummy_pb2_grpc.pyi:124: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] +test/generated/testproto/grpc/dummy_pb2_grpc.pyi:124: note: Error code "deprecated" not covered by "type: ignore" comment +test/generated/testproto/grpc/dummy_pb2_grpc.pyi:132: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] +test/generated/testproto/grpc/dummy_pb2_grpc.pyi:132: note: Error code "deprecated" not covered by "type: ignore" comment +test/generated/testproto/grpc/dummy_pb2_grpc.pyi:141: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] +test/generated/testproto/grpc/dummy_pb2_grpc.pyi:157: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] +test/generated/testproto/grpc/dummy_pb2_grpc.pyi:162: error: class testproto.grpc.dummy_pb2_grpc.DeprecatedServiceServicer is deprecated: This service is deprecated [deprecated] +test/generated/testproto/test_pb2.pyi:96: error: class testproto.test_pb2.DeprecatedEnum is deprecated: This enum is deprecated 2 lines of comments "Quotes in comments" and 'single quotes' Trailing comment [deprecated] -test/generated/testproto/test_pb2.pyi:446: error: class testproto.test_pb2.DeprecatedMessage is deprecated: This message is deprecated [deprecated] -test/generated/testproto/test_pb2.pyi:465: error: class testproto.test_pb2.DeprecatedMessageBadComment is deprecated: This message has been marked as deprecated using proto message options. [deprecated] +test/generated/testproto/test_pb2.pyi:474: error: class testproto.test_pb2.DeprecatedMessage is deprecated: This message is deprecated [deprecated] +test/generated/testproto/test_pb2.pyi:493: error: class testproto.test_pb2.DeprecatedMessageBadComment is deprecated: This message has been marked as deprecated using proto message options. [deprecated] test_negative/negative.py:16: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] test_negative/negative.py:21: error: class testproto.grpc.dummy_pb2_grpc.DeprecatedServiceServicer is deprecated: This service is deprecated [deprecated] test_negative/negative.py:21: error: class testproto.grpc.dummy_pb2_grpc.DeprecatedServiceStub is deprecated: This service is deprecated [deprecated] @@ -23,120 +27,126 @@ test_negative/negative.py:30: error: class testproto.test_pb2.DeprecatedEnum is and 'single quotes' Trailing comment [deprecated] test_negative/negative.py:31: error: class testproto.test_pb2.DeprecatedMessage is deprecated: This message is deprecated [deprecated] -test_negative/negative.py:45: error: "Simple1" has no attribute "SerializeToStringg" [attr-defined] -test_negative/negative.py:48: error: Argument 1 to "ParseFromString" of "Message" has incompatible type "Simple1"; expected "bytes" [arg-type] -test_negative/negative.py:51: error: Argument 1 to "CopyFrom" of "Message" has incompatible type "bytes"; expected "Simple1" [arg-type] -test_negative/negative.py:55: error: Argument 1 to "extend" of "list" has incompatible type "RepeatedScalarFieldContainer[str]"; expected "Iterable[int]" [arg-type] -test_negative/negative.py:57: error: Argument "foo" to "TestMessage" has incompatible type "int"; expected "str" [arg-type] -test_negative/negative.py:60: error: Incompatible types in assignment (expression has type "int", variable has type "ValueType") [assignment] -test_negative/negative.py:63: error: Argument 1 to "HasField" of "Simple1" has incompatible type "Literal['garbage']"; expected "Literal['a_boolean', b'a_boolean', 'a_enum', b'a_enum', 'a_external_enum', b'a_external_enum', 'a_inner', b'a_inner', 'a_nested', b'a_nested', 'a_oneof', b'a_oneof', 'a_oneof_1', b'a_oneof_1', 'a_oneof_2', b'a_oneof_2', 'a_string', b'a_string', 'a_uint32', b'a_uint32', 'email', b'email', 'inner_enum', b'inner_enum', 'inner_enum_in_oneof', b'inner_enum_in_oneof', 'inner_message', b'inner_message', 'nested_enum', b'nested_enum', 'nested_message', b'nested_message', 'no_package', b'no_package', 'outer_enum_in_oneof', b'outer_enum_in_oneof', 'outer_message_in_oneof', b'outer_message_in_oneof', 'user_id', b'user_id']" [arg-type] -test_negative/negative.py:64: error: Argument 1 to "HasField" of "Simple1" has incompatible type "Literal['a_repeated_string']"; expected "Literal['a_boolean', b'a_boolean', 'a_enum', b'a_enum', 'a_external_enum', b'a_external_enum', 'a_inner', b'a_inner', 'a_nested', b'a_nested', 'a_oneof', b'a_oneof', 'a_oneof_1', b'a_oneof_1', 'a_oneof_2', b'a_oneof_2', 'a_string', b'a_string', 'a_uint32', b'a_uint32', 'email', b'email', 'inner_enum', b'inner_enum', 'inner_enum_in_oneof', b'inner_enum_in_oneof', 'inner_message', b'inner_message', 'nested_enum', b'nested_enum', 'nested_message', b'nested_message', 'no_package', b'no_package', 'outer_enum_in_oneof', b'outer_enum_in_oneof', 'outer_message_in_oneof', b'outer_message_in_oneof', 'user_id', b'user_id']" [arg-type] -test_negative/negative.py:68: error: Argument 1 to "HasField" of "SimpleProto3" has incompatible type "Literal['garbage']"; expected "Literal['OuterMessage3', b'OuterMessage3', '_an_optional_string', b'_an_optional_string', 'a_oneof', b'a_oneof', 'a_oneof_1', b'a_oneof_1', 'a_oneof_2', b'a_oneof_2', 'an_optional_string', b'an_optional_string', 'b_oneof', b'b_oneof', 'b_oneof_1', b'b_oneof_1', 'b_oneof_2', b'b_oneof_2', 'bool', b'bool', 'inner_enum_in_oneof', b'inner_enum_in_oneof', 'outer_enum_in_oneof', b'outer_enum_in_oneof', 'outer_message', b'outer_message', 'outer_message_in_oneof', b'outer_message_in_oneof']" [arg-type] -test_negative/negative.py:69: error: Argument 1 to "HasField" of "SimpleProto3" has incompatible type "Literal['a_string']"; expected "Literal['OuterMessage3', b'OuterMessage3', '_an_optional_string', b'_an_optional_string', 'a_oneof', b'a_oneof', 'a_oneof_1', b'a_oneof_1', 'a_oneof_2', b'a_oneof_2', 'an_optional_string', b'an_optional_string', 'b_oneof', b'b_oneof', 'b_oneof_1', b'b_oneof_1', 'b_oneof_2', b'b_oneof_2', 'bool', b'bool', 'inner_enum_in_oneof', b'inner_enum_in_oneof', 'outer_enum_in_oneof', b'outer_enum_in_oneof', 'outer_message', b'outer_message', 'outer_message_in_oneof', b'outer_message_in_oneof']" [arg-type] -test_negative/negative.py:70: error: Argument 1 to "HasField" of "SimpleProto3" has incompatible type "Literal['outer_enum']"; expected "Literal['OuterMessage3', b'OuterMessage3', '_an_optional_string', b'_an_optional_string', 'a_oneof', b'a_oneof', 'a_oneof_1', b'a_oneof_1', 'a_oneof_2', b'a_oneof_2', 'an_optional_string', b'an_optional_string', 'b_oneof', b'b_oneof', 'b_oneof_1', b'b_oneof_1', 'b_oneof_2', b'b_oneof_2', 'bool', b'bool', 'inner_enum_in_oneof', b'inner_enum_in_oneof', 'outer_enum_in_oneof', b'outer_enum_in_oneof', 'outer_message', b'outer_message', 'outer_message_in_oneof', b'outer_message_in_oneof']" [arg-type] -test_negative/negative.py:71: error: Argument 1 to "HasField" of "SimpleProto3" has incompatible type "Literal['a_repeated_string']"; expected "Literal['OuterMessage3', b'OuterMessage3', '_an_optional_string', b'_an_optional_string', 'a_oneof', b'a_oneof', 'a_oneof_1', b'a_oneof_1', 'a_oneof_2', b'a_oneof_2', 'an_optional_string', b'an_optional_string', 'b_oneof', b'b_oneof', 'b_oneof_1', b'b_oneof_1', 'b_oneof_2', b'b_oneof_2', 'bool', b'bool', 'inner_enum_in_oneof', b'inner_enum_in_oneof', 'outer_enum_in_oneof', b'outer_enum_in_oneof', 'outer_message', b'outer_message', 'outer_message_in_oneof', b'outer_message_in_oneof']" [arg-type] -test_negative/negative.py:74: error: Argument 1 to "ClearField" of "Simple1" has incompatible type "Literal['garbage']"; expected "Literal['a_boolean', b'a_boolean', 'a_enum', b'a_enum', 'a_external_enum', b'a_external_enum', 'a_inner', b'a_inner', 'a_nested', b'a_nested', 'a_oneof', b'a_oneof', 'a_oneof_1', b'a_oneof_1', 'a_oneof_2', b'a_oneof_2', 'a_repeated_string', b'a_repeated_string', 'a_string', b'a_string', 'a_uint32', b'a_uint32', 'email', b'email', 'email_by_uid', b'email_by_uid', 'inner_enum', b'inner_enum', 'inner_enum_in_oneof', b'inner_enum_in_oneof', 'inner_message', b'inner_message', 'nested_enum', b'nested_enum', 'nested_message', b'nested_message', 'no_package', b'no_package', 'outer_enum_in_oneof', b'outer_enum_in_oneof', 'outer_message_in_oneof', b'outer_message_in_oneof', 'rep_inner_enum', b'rep_inner_enum', 'rep_inner_message', b'rep_inner_message', 'user_id', b'user_id']" [arg-type] -test_negative/negative.py:77: error: Argument 1 to "ClearField" of "SimpleProto3" has incompatible type "Literal['garbage']"; expected "Literal['OuterEnum', b'OuterEnum', 'OuterMessage3', b'OuterMessage3', '_an_optional_string', b'_an_optional_string', 'a_oneof', b'a_oneof', 'a_oneof_1', b'a_oneof_1', 'a_oneof_2', b'a_oneof_2', 'a_outer_enum', b'a_outer_enum', 'a_repeated_string', b'a_repeated_string', 'a_string', b'a_string', 'an_optional_string', b'an_optional_string', 'b_oneof', b'b_oneof', 'b_oneof_1', b'b_oneof_1', 'b_oneof_2', b'b_oneof_2', 'bool', b'bool', 'email', b'email', 'email_by_uid', b'email_by_uid', 'inner_enum', b'inner_enum', 'inner_enum_in_oneof', b'inner_enum_in_oneof', 'map_message', b'map_message', 'map_scalar', b'map_scalar', 'outer_enum_in_oneof', b'outer_enum_in_oneof', 'outer_message', b'outer_message', 'outer_message_in_oneof', b'outer_message_in_oneof', 'user_id', b'user_id']" [arg-type] -test_negative/negative.py:80: error: Argument 1 to "WhichOneof" of "Simple1" has incompatible type "Literal['garbage']"; expected "Literal['a_oneof', b'a_oneof']" [arg-type] -test_negative/negative.py:82: error: Incompatible types in assignment (expression has type "Literal['a_oneof_1', 'a_oneof_2', 'outer_message_in_oneof', 'outer_enum_in_oneof', 'inner_enum_in_oneof'] | None", variable has type "int") [assignment] -test_negative/negative.py:87: error: Argument 1 to "HasField" of "Simple2" has incompatible type "Literal['a_oneof_1', 'a_oneof_2', 'outer_message_in_oneof', 'outer_enum_in_oneof', 'inner_enum_in_oneof']"; expected "Literal['a_string', b'a_string']" [arg-type] -test_negative/negative.py:91: error: Incompatible types in assignment (expression has type "Literal['a_oneof_1', 'a_oneof_2', 'outer_message_in_oneof', 'outer_enum_in_oneof', 'inner_enum_in_oneof'] | None", variable has type "str") [assignment] -test_negative/negative.py:94: error: No overload variant of "WhichOneof" of "SimpleProto3" matches argument type "str" [call-overload] -test_negative/negative.py:94: note: Possible overload variants: -test_negative/negative.py:94: note: def WhichOneof(self, oneof_group: Literal['_an_optional_string', b'_an_optional_string']) -> Literal['an_optional_string'] | None -test_negative/negative.py:94: note: def WhichOneof(self, oneof_group: Literal['a_oneof', b'a_oneof']) -> Literal['a_oneof_1', 'a_oneof_2', 'outer_message_in_oneof', 'outer_enum_in_oneof', 'inner_enum_in_oneof'] | None -test_negative/negative.py:94: note: def WhichOneof(self, oneof_group: Literal['b_oneof', b'b_oneof']) -> Literal['b_oneof_1', 'b_oneof_2'] | None -test_negative/negative.py:96: error: Incompatible types in assignment (expression has type "Literal['a_oneof_1', 'a_oneof_2', 'outer_message_in_oneof', 'outer_enum_in_oneof', 'inner_enum_in_oneof'] | None", variable has type "int") [assignment] -test_negative/negative.py:100: error: Argument 1 to "HasField" of "Simple2" has incompatible type "Literal['a_oneof_1', 'a_oneof_2', 'outer_message_in_oneof', 'outer_enum_in_oneof', 'inner_enum_in_oneof']"; expected "Literal['a_string', b'a_string']" [arg-type] -test_negative/negative.py:104: error: Incompatible types in assignment (expression has type "_ExtensionFieldDescriptor[Simple1, Extensions1]", variable has type "int") [assignment] -test_negative/negative.py:105: error: "type[Extensions1]" has no attribute "bad" [attr-defined] -test_negative/negative.py:107: error: "Extensions1" has no attribute "foo" [attr-defined] -test_negative/negative.py:108: error: Incompatible types in assignment (expression has type "Extensions2", variable has type "Extensions1") [assignment] -test_negative/negative.py:112: error: Invalid index type "str" for "_ExtensionDict[Simple1]"; expected type "_ExtensionFieldDescriptor[Simple1, Never]" [index] -test_negative/negative.py:113: error: Invalid index type "_ExtensionFieldDescriptor[Simple2, SeparateFileExtension]" for "_ExtensionDict[Simple1]"; expected type "_ExtensionFieldDescriptor[Simple1, SeparateFileExtension]" [index] -test_negative/negative.py:114: error: Unsupported operand types for in ("_ExtensionFieldDescriptor[Simple2, SeparateFileExtension]" and "_ExtensionDict[Simple1]") [operator] -test_negative/negative.py:115: error: Argument 1 to "__delitem__" of "_ExtensionDict" has incompatible type "_ExtensionFieldDescriptor[Simple2, SeparateFileExtension]"; expected "_ExtensionFieldDescriptor[Simple1, SeparateFileExtension]" [arg-type] -test_negative/negative.py:116: error: Argument 1 to "HasExtension" of "Message" has incompatible type "_ExtensionFieldDescriptor[Simple2, SeparateFileExtension]"; expected "_ExtensionFieldDescriptor[Simple1, Any]" [arg-type] -test_negative/negative.py:117: error: Argument 1 to "ClearExtension" of "Message" has incompatible type "_ExtensionFieldDescriptor[Simple1, Extensions1]"; expected "_ExtensionFieldDescriptor[Simple2, Any]" [arg-type] -test_negative/negative.py:121: error: Incompatible types in assignment (expression has type "int", variable has type "_ExtensionFieldDescriptor[Simple1, Any]") [assignment] -test_negative/negative.py:125: error: Incompatible types in assignment (expression has type "Literal['b_oneof_1', 'b_oneof_2'] | None", variable has type "Literal['a_oneof_1', 'a_oneof_2', 'outer_message_in_oneof', 'outer_enum_in_oneof', 'inner_enum_in_oneof'] | None") [assignment] -test_negative/negative.py:128: error: "Descriptor" has no attribute "Garbage" [attr-defined] +test_negative/negative.py:46: error: "Simple1" has no attribute "SerializeToStringg" [attr-defined] +test_negative/negative.py:49: error: Argument 1 to "ParseFromString" of "Message" has incompatible type "Simple1"; expected "bytes" [arg-type] +test_negative/negative.py:52: error: Argument 1 to "CopyFrom" of "Message" has incompatible type "bytes"; expected "Simple1" [arg-type] +test_negative/negative.py:56: error: Argument 1 to "extend" of "list" has incompatible type "RepeatedScalarFieldContainer[str]"; expected "Iterable[int]" [arg-type] +test_negative/negative.py:58: error: Argument "foo" to "TestMessage" has incompatible type "int"; expected "str" [arg-type] +test_negative/negative.py:61: error: Incompatible types in assignment (expression has type "int", variable has type "ValueType") [assignment] +test_negative/negative.py:64: error: Argument 1 to "HasField" of "Simple1" has incompatible type "Literal['garbage']"; expected "Literal['a_boolean', b'a_boolean', 'a_enum', b'a_enum', 'a_external_enum', b'a_external_enum', 'a_inner', b'a_inner', 'a_nested', b'a_nested', 'a_oneof', b'a_oneof', 'a_oneof_1', b'a_oneof_1', 'a_oneof_2', b'a_oneof_2', 'a_string', b'a_string', 'a_uint32', b'a_uint32', 'email', b'email', 'inner_enum', b'inner_enum', 'inner_enum_in_oneof', b'inner_enum_in_oneof', 'inner_message', b'inner_message', 'nested_enum', b'nested_enum', 'nested_message', b'nested_message', 'no_package', b'no_package', 'outer_enum_in_oneof', b'outer_enum_in_oneof', 'outer_message_in_oneof', b'outer_message_in_oneof', 'user_id', b'user_id']" [arg-type] +test_negative/negative.py:65: error: Argument 1 to "HasField" of "Simple1" has incompatible type "Literal['a_repeated_string']"; expected "Literal['a_boolean', b'a_boolean', 'a_enum', b'a_enum', 'a_external_enum', b'a_external_enum', 'a_inner', b'a_inner', 'a_nested', b'a_nested', 'a_oneof', b'a_oneof', 'a_oneof_1', b'a_oneof_1', 'a_oneof_2', b'a_oneof_2', 'a_string', b'a_string', 'a_uint32', b'a_uint32', 'email', b'email', 'inner_enum', b'inner_enum', 'inner_enum_in_oneof', b'inner_enum_in_oneof', 'inner_message', b'inner_message', 'nested_enum', b'nested_enum', 'nested_message', b'nested_message', 'no_package', b'no_package', 'outer_enum_in_oneof', b'outer_enum_in_oneof', 'outer_message_in_oneof', b'outer_message_in_oneof', 'user_id', b'user_id']" [arg-type] +test_negative/negative.py:69: error: Argument 1 to "HasField" of "SimpleProto3" has incompatible type "Literal['garbage']"; expected "Literal['OuterMessage3', b'OuterMessage3', '_an_optional_string', b'_an_optional_string', 'a_oneof', b'a_oneof', 'a_oneof_1', b'a_oneof_1', 'a_oneof_2', b'a_oneof_2', 'an_optional_string', b'an_optional_string', 'b_oneof', b'b_oneof', 'b_oneof_1', b'b_oneof_1', 'b_oneof_2', b'b_oneof_2', 'bool', b'bool', 'inner_enum_in_oneof', b'inner_enum_in_oneof', 'outer_enum_in_oneof', b'outer_enum_in_oneof', 'outer_message', b'outer_message', 'outer_message_in_oneof', b'outer_message_in_oneof']" [arg-type] +test_negative/negative.py:70: error: Argument 1 to "HasField" of "SimpleProto3" has incompatible type "Literal['a_string']"; expected "Literal['OuterMessage3', b'OuterMessage3', '_an_optional_string', b'_an_optional_string', 'a_oneof', b'a_oneof', 'a_oneof_1', b'a_oneof_1', 'a_oneof_2', b'a_oneof_2', 'an_optional_string', b'an_optional_string', 'b_oneof', b'b_oneof', 'b_oneof_1', b'b_oneof_1', 'b_oneof_2', b'b_oneof_2', 'bool', b'bool', 'inner_enum_in_oneof', b'inner_enum_in_oneof', 'outer_enum_in_oneof', b'outer_enum_in_oneof', 'outer_message', b'outer_message', 'outer_message_in_oneof', b'outer_message_in_oneof']" [arg-type] +test_negative/negative.py:71: error: Argument 1 to "HasField" of "SimpleProto3" has incompatible type "Literal['outer_enum']"; expected "Literal['OuterMessage3', b'OuterMessage3', '_an_optional_string', b'_an_optional_string', 'a_oneof', b'a_oneof', 'a_oneof_1', b'a_oneof_1', 'a_oneof_2', b'a_oneof_2', 'an_optional_string', b'an_optional_string', 'b_oneof', b'b_oneof', 'b_oneof_1', b'b_oneof_1', 'b_oneof_2', b'b_oneof_2', 'bool', b'bool', 'inner_enum_in_oneof', b'inner_enum_in_oneof', 'outer_enum_in_oneof', b'outer_enum_in_oneof', 'outer_message', b'outer_message', 'outer_message_in_oneof', b'outer_message_in_oneof']" [arg-type] +test_negative/negative.py:72: error: Argument 1 to "HasField" of "SimpleProto3" has incompatible type "Literal['a_repeated_string']"; expected "Literal['OuterMessage3', b'OuterMessage3', '_an_optional_string', b'_an_optional_string', 'a_oneof', b'a_oneof', 'a_oneof_1', b'a_oneof_1', 'a_oneof_2', b'a_oneof_2', 'an_optional_string', b'an_optional_string', 'b_oneof', b'b_oneof', 'b_oneof_1', b'b_oneof_1', 'b_oneof_2', b'b_oneof_2', 'bool', b'bool', 'inner_enum_in_oneof', b'inner_enum_in_oneof', 'outer_enum_in_oneof', b'outer_enum_in_oneof', 'outer_message', b'outer_message', 'outer_message_in_oneof', b'outer_message_in_oneof']" [arg-type] +test_negative/negative.py:75: error: Argument 1 to "ClearField" of "Simple1" has incompatible type "Literal['garbage']"; expected "Literal['a_boolean', b'a_boolean', 'a_enum', b'a_enum', 'a_external_enum', b'a_external_enum', 'a_inner', b'a_inner', 'a_nested', b'a_nested', 'a_oneof', b'a_oneof', 'a_oneof_1', b'a_oneof_1', 'a_oneof_2', b'a_oneof_2', 'a_repeated_string', b'a_repeated_string', 'a_string', b'a_string', 'a_uint32', b'a_uint32', 'email', b'email', 'email_by_uid', b'email_by_uid', 'inner_enum', b'inner_enum', 'inner_enum_in_oneof', b'inner_enum_in_oneof', 'inner_message', b'inner_message', 'nested_enum', b'nested_enum', 'nested_message', b'nested_message', 'no_package', b'no_package', 'outer_enum_in_oneof', b'outer_enum_in_oneof', 'outer_message_in_oneof', b'outer_message_in_oneof', 'rep_inner_enum', b'rep_inner_enum', 'rep_inner_message', b'rep_inner_message', 'user_id', b'user_id']" [arg-type] +test_negative/negative.py:78: error: Argument 1 to "ClearField" of "SimpleProto3" has incompatible type "Literal['garbage']"; expected "Literal['OuterEnum', b'OuterEnum', 'OuterMessage3', b'OuterMessage3', '_an_optional_string', b'_an_optional_string', 'a_oneof', b'a_oneof', 'a_oneof_1', b'a_oneof_1', 'a_oneof_2', b'a_oneof_2', 'a_outer_enum', b'a_outer_enum', 'a_repeated_string', b'a_repeated_string', 'a_string', b'a_string', 'an_optional_string', b'an_optional_string', 'b_oneof', b'b_oneof', 'b_oneof_1', b'b_oneof_1', 'b_oneof_2', b'b_oneof_2', 'bool', b'bool', 'email', b'email', 'email_by_uid', b'email_by_uid', 'inner_enum', b'inner_enum', 'inner_enum_in_oneof', b'inner_enum_in_oneof', 'map_message', b'map_message', 'map_scalar', b'map_scalar', 'outer_enum_in_oneof', b'outer_enum_in_oneof', 'outer_message', b'outer_message', 'outer_message_in_oneof', b'outer_message_in_oneof', 'user_id', b'user_id']" [arg-type] +test_negative/negative.py:81: error: Argument 1 to "WhichOneof" of "Simple1" has incompatible type "Literal['garbage']"; expected "Literal['a_oneof', b'a_oneof']" [arg-type] +test_negative/negative.py:83: error: Incompatible types in assignment (expression has type "Literal['a_oneof_1', 'a_oneof_2', 'outer_message_in_oneof', 'outer_enum_in_oneof', 'inner_enum_in_oneof'] | None", variable has type "int") [assignment] +test_negative/negative.py:88: error: Argument 1 to "HasField" of "Simple2" has incompatible type "Literal['a_oneof_1', 'a_oneof_2', 'outer_message_in_oneof', 'outer_enum_in_oneof', 'inner_enum_in_oneof']"; expected "Literal['a_string', b'a_string']" [arg-type] +test_negative/negative.py:92: error: Incompatible types in assignment (expression has type "Literal['a_oneof_1', 'a_oneof_2', 'outer_message_in_oneof', 'outer_enum_in_oneof', 'inner_enum_in_oneof'] | None", variable has type "str") [assignment] +test_negative/negative.py:95: error: No overload variant of "WhichOneof" of "SimpleProto3" matches argument type "str" [call-overload] +test_negative/negative.py:95: note: Possible overload variants: +test_negative/negative.py:95: note: def WhichOneof(self, oneof_group: Literal['_an_optional_string', b'_an_optional_string']) -> Literal['an_optional_string'] | None +test_negative/negative.py:95: note: def WhichOneof(self, oneof_group: Literal['a_oneof', b'a_oneof']) -> Literal['a_oneof_1', 'a_oneof_2', 'outer_message_in_oneof', 'outer_enum_in_oneof', 'inner_enum_in_oneof'] | None +test_negative/negative.py:95: note: def WhichOneof(self, oneof_group: Literal['b_oneof', b'b_oneof']) -> Literal['b_oneof_1', 'b_oneof_2'] | None +test_negative/negative.py:97: error: Incompatible types in assignment (expression has type "Literal['a_oneof_1', 'a_oneof_2', 'outer_message_in_oneof', 'outer_enum_in_oneof', 'inner_enum_in_oneof'] | None", variable has type "int") [assignment] +test_negative/negative.py:101: error: Argument 1 to "HasField" of "Simple2" has incompatible type "Literal['a_oneof_1', 'a_oneof_2', 'outer_message_in_oneof', 'outer_enum_in_oneof', 'inner_enum_in_oneof']"; expected "Literal['a_string', b'a_string']" [arg-type] +test_negative/negative.py:105: error: Incompatible types in assignment (expression has type "_ExtensionFieldDescriptor[Simple1, Extensions1]", variable has type "int") [assignment] +test_negative/negative.py:106: error: "type[Extensions1]" has no attribute "bad" [attr-defined] +test_negative/negative.py:108: error: "Extensions1" has no attribute "foo" [attr-defined] +test_negative/negative.py:109: error: Incompatible types in assignment (expression has type "Extensions2", variable has type "Extensions1") [assignment] +test_negative/negative.py:113: error: Invalid index type "str" for "_ExtensionDict[Simple1]"; expected type "_ExtensionFieldDescriptor[Simple1, Never]" [index] +test_negative/negative.py:114: error: Invalid index type "_ExtensionFieldDescriptor[Simple2, SeparateFileExtension]" for "_ExtensionDict[Simple1]"; expected type "_ExtensionFieldDescriptor[Simple1, SeparateFileExtension]" [index] +test_negative/negative.py:115: error: Unsupported operand types for in ("_ExtensionFieldDescriptor[Simple2, SeparateFileExtension]" and "_ExtensionDict[Simple1]") [operator] +test_negative/negative.py:116: error: Argument 1 to "__delitem__" of "_ExtensionDict" has incompatible type "_ExtensionFieldDescriptor[Simple2, SeparateFileExtension]"; expected "_ExtensionFieldDescriptor[Simple1, SeparateFileExtension]" [arg-type] +test_negative/negative.py:117: error: Argument 1 to "HasExtension" of "Message" has incompatible type "_ExtensionFieldDescriptor[Simple2, SeparateFileExtension]"; expected "_ExtensionFieldDescriptor[Simple1, Any]" [arg-type] +test_negative/negative.py:118: error: Argument 1 to "ClearExtension" of "Message" has incompatible type "_ExtensionFieldDescriptor[Simple1, Extensions1]"; expected "_ExtensionFieldDescriptor[Simple2, Any]" [arg-type] +test_negative/negative.py:122: error: Incompatible types in assignment (expression has type "int", variable has type "_ExtensionFieldDescriptor[Simple1, Any]") [assignment] +test_negative/negative.py:126: error: Incompatible types in assignment (expression has type "Literal['b_oneof_1', 'b_oneof_2'] | None", variable has type "Literal['a_oneof_1', 'a_oneof_2', 'outer_message_in_oneof', 'outer_enum_in_oneof', 'inner_enum_in_oneof'] | None") [assignment] test_negative/negative.py:129: error: "Descriptor" has no attribute "Garbage" [attr-defined] -test_negative/negative.py:132: error: "EnumDescriptor" has no attribute "Garbage" [attr-defined] -test_negative/negative.py:135: error: "FileDescriptor" has no attribute "Garbage" [attr-defined] -test_negative/negative.py:142: error: "ValueType" has no attribute "FOO" [attr-defined] -test_negative/negative.py:146: error: Argument 1 to "Name" of "_EnumTypeWrapper" has incompatible type "int"; expected "ValueType" [arg-type] -test_negative/negative.py:148: error: Argument 1 to "Name" of "_EnumTypeWrapper" has incompatible type "testproto.test3_pb2.SimpleProto3._InnerEnum.ValueType"; expected "testproto.test3_pb2._OuterEnum.ValueType" [arg-type] -test_negative/negative.py:150: error: Argument 1 to "Name" of "_EnumTypeWrapper" has incompatible type "testproto.test3_pb2.SimpleProto3._InnerEnum.ValueType"; expected "testproto.test3_pb2._OuterEnum.ValueType" [arg-type] -test_negative/negative.py:152: error: Argument 1 to "Name" of "_EnumTypeWrapper" has incompatible type "testproto.test3_pb2.SimpleProto3._InnerEnum.ValueType"; expected "testproto.test3_pb2._OuterEnum.ValueType" [arg-type] -test_negative/negative.py:156: error: "ScalarMap[int, str]" has no attribute "get_or_create" [attr-defined] -test_negative/negative.py:158: error: No overload variant of "get" of "ScalarMap" matches argument type "str" [call-overload] -test_negative/negative.py:158: note: Possible overload variants: -test_negative/negative.py:158: note: def get(self, key: int, default: None = ...) -> str | None -test_negative/negative.py:158: note: def get(self, key: int, default: str) -> str -test_negative/negative.py:158: note: def [_T] get(self, key: int, default: _T) -> str | _T -test_negative/negative.py:159: error: No overload variant of "get" of "MessageMap" matches argument type "str" [call-overload] +test_negative/negative.py:130: error: "Descriptor" has no attribute "Garbage" [attr-defined] +test_negative/negative.py:133: error: "EnumDescriptor" has no attribute "Garbage" [attr-defined] +test_negative/negative.py:136: error: "FileDescriptor" has no attribute "Garbage" [attr-defined] +test_negative/negative.py:143: error: "ValueType" has no attribute "FOO" [attr-defined] +test_negative/negative.py:147: error: Argument 1 to "Name" of "_EnumTypeWrapper" has incompatible type "int"; expected "ValueType" [arg-type] +test_negative/negative.py:149: error: Argument 1 to "Name" of "_EnumTypeWrapper" has incompatible type "testproto.test3_pb2.SimpleProto3._InnerEnum.ValueType"; expected "testproto.test3_pb2._OuterEnum.ValueType" [arg-type] +test_negative/negative.py:151: error: Argument 1 to "Name" of "_EnumTypeWrapper" has incompatible type "testproto.test3_pb2.SimpleProto3._InnerEnum.ValueType"; expected "testproto.test3_pb2._OuterEnum.ValueType" [arg-type] +test_negative/negative.py:153: error: Argument 1 to "Name" of "_EnumTypeWrapper" has incompatible type "testproto.test3_pb2.SimpleProto3._InnerEnum.ValueType"; expected "testproto.test3_pb2._OuterEnum.ValueType" [arg-type] +test_negative/negative.py:157: error: "ScalarMap[int, str]" has no attribute "get_or_create" [attr-defined] +test_negative/negative.py:159: error: No overload variant of "get" of "ScalarMap" matches argument type "str" [call-overload] test_negative/negative.py:159: note: Possible overload variants: -test_negative/negative.py:159: note: def get(self, key: int, default: None = ...) -> OuterMessage3 | None -test_negative/negative.py:159: note: def get(self, key: int, default: OuterMessage3) -> OuterMessage3 -test_negative/negative.py:159: note: def [_T] get(self, key: int, default: _T) -> OuterMessage3 | _T -test_negative/negative.py:162: error: Incompatible types in assignment (expression has type "str | None", variable has type "int") [assignment] -test_negative/negative.py:163: error: Incompatible types in assignment (expression has type "OuterMessage3 | None", variable has type "int") [assignment] -test_negative/negative.py:165: error: Dict entry 0 has incompatible type "str": "int"; expected "int": "str" [dict-item] -test_negative/negative.py:165: error: Dict entry 0 has incompatible type "str": "str"; expected "int": "OuterMessage3" [dict-item] -test_negative/negative.py:169: error: Incompatible types in assignment (expression has type "int", variable has type "UserId") [assignment] -test_negative/negative.py:170: error: Incompatible types in assignment (expression has type "str", variable has type "Email") [assignment] -test_negative/negative.py:171: error: Invalid index type "int" for "ScalarMap[UserId, Email]"; expected type "UserId" [index] -test_negative/negative.py:171: error: Incompatible types in assignment (expression has type "str", target has type "Email") [assignment] +test_negative/negative.py:159: note: def get(self, key: int, default: None = ...) -> str | None +test_negative/negative.py:159: note: def get(self, key: int, default: str) -> str +test_negative/negative.py:159: note: def [_T] get(self, key: int, default: _T) -> str | _T +test_negative/negative.py:160: error: No overload variant of "get" of "MessageMap" matches argument type "str" [call-overload] +test_negative/negative.py:160: note: Possible overload variants: +test_negative/negative.py:160: note: def get(self, key: int, default: None = ...) -> OuterMessage3 | None +test_negative/negative.py:160: note: def get(self, key: int, default: OuterMessage3) -> OuterMessage3 +test_negative/negative.py:160: note: def [_T] get(self, key: int, default: _T) -> OuterMessage3 | _T +test_negative/negative.py:163: error: Incompatible types in assignment (expression has type "str | None", variable has type "int") [assignment] +test_negative/negative.py:164: error: Incompatible types in assignment (expression has type "OuterMessage3 | None", variable has type "int") [assignment] +test_negative/negative.py:166: error: Dict entry 0 has incompatible type "str": "int"; expected "int": "str" [dict-item] +test_negative/negative.py:166: error: Dict entry 0 has incompatible type "str": "str"; expected "int": "OuterMessage3" [dict-item] +test_negative/negative.py:170: error: Incompatible types in assignment (expression has type "int", variable has type "UserId") [assignment] +test_negative/negative.py:171: error: Incompatible types in assignment (expression has type "str", variable has type "Email") [assignment] +test_negative/negative.py:172: error: Invalid index type "int" for "ScalarMap[UserId, Email]"; expected type "UserId" [index] test_negative/negative.py:172: error: Incompatible types in assignment (expression has type "str", target has type "Email") [assignment] -test_negative/negative.py:173: error: Invalid index type "int" for "ScalarMap[UserId, Email]"; expected type "UserId" [index] -test_negative/negative.py:175: error: Argument "user_id" to "Simple1" has incompatible type "int"; expected "UserId | None" [arg-type] -test_negative/negative.py:176: error: Argument "email" to "Simple1" has incompatible type "str"; expected "Email | None" [arg-type] -test_negative/negative.py:177: error: Dict entry 0 has incompatible type "int": "str"; expected "UserId": "Email" [dict-item] -test_negative/negative.py:181: error: Module "testproto.reexport_pb2" has no attribute "Inner" [attr-defined] -test_negative/negative.py:185: error: Argument "a_string" to "OuterMessage3" has incompatible type "None"; expected "str" [arg-type] -test_negative/negative.py:190: error: Property "a_repeated_string" defined in "Simple1" is read-only [misc] -test_negative/negative.py:191: error: Property "rep_inner_enum" defined in "Simple1" is read-only [misc] -test_negative/negative.py:196: error: "_r_None" has no attribute "invalid"; maybe "valid"? [attr-defined] -test_negative/negative.py:200: error: Incompatible types in assignment (expression has type "ValueType", variable has type "str") [assignment] -test_negative/negative.py:204: error: All overload variants of "DummyServiceStub" require at least one argument [call-overload] -test_negative/negative.py:204: note: Possible overload variants: -test_negative/negative.py:204: note: def __new__(cls, channel: Channel) -> DummyServiceStub -test_negative/negative.py:204: note: def __new__(cls, channel: Channel) -> DummyServiceAsyncStub -test_negative/negative.py:211: error: "DummyReply" has no attribute "not_exists" [attr-defined] -test_negative/negative.py:212: error: "DummyReply" has no attribute "__iter__" (not iterable) [attr-defined] -test_negative/negative.py:217: error: "DummyReply" has no attribute "not_exists" [attr-defined] -test_negative/negative.py:219: error: "_CallIterator[DummyReply]" has no attribute "value" [attr-defined] -test_negative/negative.py:226: error: Argument 1 to "__call__" of "StreamUnaryMultiCallable" has incompatible type "DummyRequest"; expected "Iterator[DummyRequest]" [arg-type] -test_negative/negative.py:228: error: "DummyReply" has no attribute "__iter__" (not iterable) [attr-defined] -test_negative/negative.py:228: error: Argument 1 to "__call__" of "StreamUnaryMultiCallable" has incompatible type "DummyRequest"; expected "Iterator[DummyRequest]" [arg-type] -test_negative/negative.py:231: error: Argument 1 to "__call__" of "StreamStreamMultiCallable" has incompatible type "DummyRequest"; expected "Iterator[DummyRequest]" [arg-type] -test_negative/negative.py:235: error: "DummyReply" has no attribute "not_exists" [attr-defined] -test_negative/negative.py:272: error: Return type "Iterator[DummyReply]" of "UnaryUnary" incompatible with return type "DummyReply | Awaitable[DummyReply]" in supertype "testproto.grpc.dummy_pb2_grpc.DummyServiceServicer" [override] -test_negative/negative.py:274: error: Argument 1 of "UnaryUnary" is incompatible with supertype "testproto.grpc.dummy_pb2_grpc.DummyServiceServicer"; supertype defines the argument type as "DummyRequest" [override] -test_negative/negative.py:274: note: This violates the Liskov substitution principle -test_negative/negative.py:274: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#incompatible-overrides -test_negative/negative.py:280: error: Return type "DummyReply" of "UnaryStream" incompatible with return type "Iterator[DummyReply] | AsyncIterator[DummyReply]" in supertype "testproto.grpc.dummy_pb2_grpc.DummyServiceServicer" [override] -test_negative/negative.py:282: error: Argument 1 of "UnaryStream" is incompatible with supertype "testproto.grpc.dummy_pb2_grpc.DummyServiceServicer"; supertype defines the argument type as "DummyRequest" [override] -test_negative/negative.py:282: note: This violates the Liskov substitution principle -test_negative/negative.py:282: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#incompatible-overrides -test_negative/negative.py:289: error: Return type "Iterator[DummyReply]" of "StreamUnary" incompatible with return type "DummyReply | Awaitable[DummyReply]" in supertype "testproto.grpc.dummy_pb2_grpc.DummyServiceServicer" [override] -test_negative/negative.py:291: error: Argument 1 of "StreamUnary" is incompatible with supertype "testproto.grpc.dummy_pb2_grpc.DummyServiceServicer"; supertype defines the argument type as "_MaybeAsyncIterator[DummyRequest]" [override] -test_negative/negative.py:291: note: This violates the Liskov substitution principle -test_negative/negative.py:291: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#incompatible-overrides -test_negative/negative.py:320: error: class testproto.grpc.dummy_pb2_grpc.DeprecatedServiceAsyncStub is deprecated: This service is deprecated [deprecated] -test_negative/negative.py:332: error: Argument "implicit_singular" to "Editions2024Test" has incompatible type "None"; expected "str" [arg-type] -test_negative/negative.py:334: error: Argument 1 to "HasField" of "Editions2024Test" has incompatible type "Literal['implicit_singular']"; expected "Literal['default_singular', b'default_singular', 'explicit_singular', b'explicit_singular', 'legacy', b'legacy', 'message_field', b'message_field']" [arg-type] -test_negative/negative.py:345: error: Cannot instantiate abstract class "IncompleteServicer" with abstract attributes "StreamStream", "StreamUnary", "UnaryStream" and "UnaryUnary" [abstract] -test_negative/negative.py:352: error: Argument 2 to "test_hasfield_alias" has incompatible type "Literal['not_a_field']"; expected "Literal['default_singular', b'default_singular', 'explicit_singular', b'explicit_singular', 'legacy', b'legacy', 'message_field', b'message_field']" [arg-type] -test_negative/negative.py:359: error: Argument 2 to "test_clearfield_alias" has incompatible type "Literal['not_a_field']"; expected "Literal['default_singular', b'default_singular', 'explicit_singular', b'explicit_singular', 'implicit_singular', b'implicit_singular', 'legacy', b'legacy', 'message_field', b'message_field']" [arg-type] -test_negative/negative.py:369: error: Argument 2 to "test_whichoneof_alias" has incompatible type "Literal['not_a_oneof']"; expected "Literal['a_oneof', b'a_oneof']" [arg-type] -test_negative/negative.py:372: error: All overload variants of "DummyServiceStub" require at least one argument [call-overload] -test_negative/negative.py:372: note: Possible overload variants: -test_negative/negative.py:372: note: def __new__(cls, channel: Channel) -> DummyServiceStub -test_negative/negative.py:372: note: def __new__(cls, channel: Channel) -> DummyServiceAsyncStub -test_negative/negative.py:373: error: No overload variant of "DummyServiceStub" matches argument type "str" [call-overload] -test_negative/negative.py:373: note: Possible overload variants: -test_negative/negative.py:373: note: def __new__(cls, channel: Channel) -> DummyServiceStub -test_negative/negative.py:373: note: def __new__(cls, channel: Channel) -> DummyServiceAsyncStub -Found 105 errors in 4 files (checked 4 source files) +test_negative/negative.py:173: error: Incompatible types in assignment (expression has type "str", target has type "Email") [assignment] +test_negative/negative.py:174: error: Invalid index type "int" for "ScalarMap[UserId, Email]"; expected type "UserId" [index] +test_negative/negative.py:176: error: Argument "user_id" to "Simple1" has incompatible type "int"; expected "UserId | None" [arg-type] +test_negative/negative.py:177: error: Argument "email" to "Simple1" has incompatible type "str"; expected "Email | None" [arg-type] +test_negative/negative.py:178: error: Dict entry 0 has incompatible type "int": "str"; expected "UserId": "Email" [dict-item] +test_negative/negative.py:182: error: Module "testproto.reexport_pb2" has no attribute "Inner" [attr-defined] +test_negative/negative.py:186: error: Argument "a_string" to "OuterMessage3" has incompatible type "None"; expected "str" [arg-type] +test_negative/negative.py:191: error: Property "a_repeated_string" defined in "Simple1" is read-only [misc] +test_negative/negative.py:192: error: Property "rep_inner_enum" defined in "Simple1" is read-only [misc] +test_negative/negative.py:197: error: "_r_None" has no attribute "invalid"; maybe "valid"? [attr-defined] +test_negative/negative.py:201: error: Incompatible types in assignment (expression has type "ValueType", variable has type "str") [assignment] +test_negative/negative.py:205: error: function testproto.test_pb2.DeprecatedMessage.deprecated_field is deprecated: This field has been marked as deprecated using proto field options. [deprecated] +test_negative/negative.py:207: error: All overload variants of "DummyServiceStub" require at least one argument [call-overload] +test_negative/negative.py:207: note: Possible overload variants: +test_negative/negative.py:207: note: def __new__(cls, channel: Channel) -> DummyServiceStub +test_negative/negative.py:207: note: def __new__(cls, channel: Channel) -> DummyServiceAsyncStub +test_negative/negative.py:214: error: "DummyReply" has no attribute "not_exists" [attr-defined] +test_negative/negative.py:215: error: "DummyReply" has no attribute "__iter__" (not iterable) [attr-defined] +test_negative/negative.py:220: error: "DummyReply" has no attribute "not_exists" [attr-defined] +test_negative/negative.py:222: error: "_CallIterator[DummyReply]" has no attribute "value" [attr-defined] +test_negative/negative.py:229: error: Argument 1 to "__call__" of "StreamUnaryMultiCallable" has incompatible type "DummyRequest"; expected "Iterator[DummyRequest]" [arg-type] +test_negative/negative.py:231: error: "DummyReply" has no attribute "__iter__" (not iterable) [attr-defined] +test_negative/negative.py:231: error: Argument 1 to "__call__" of "StreamUnaryMultiCallable" has incompatible type "DummyRequest"; expected "Iterator[DummyRequest]" [arg-type] +test_negative/negative.py:234: error: Argument 1 to "__call__" of "StreamStreamMultiCallable" has incompatible type "DummyRequest"; expected "Iterator[DummyRequest]" [arg-type] +test_negative/negative.py:238: error: "DummyReply" has no attribute "not_exists" [attr-defined] +test_negative/negative.py:275: error: Return type "Iterator[DummyReply]" of "UnaryUnary" incompatible with return type "DummyReply | Awaitable[DummyReply]" in supertype "testproto.grpc.dummy_pb2_grpc.DummyServiceServicer" [override] +test_negative/negative.py:277: error: Argument 1 of "UnaryUnary" is incompatible with supertype "testproto.grpc.dummy_pb2_grpc.DummyServiceServicer"; supertype defines the argument type as "DummyRequest" [override] +test_negative/negative.py:277: note: This violates the Liskov substitution principle +test_negative/negative.py:277: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#incompatible-overrides +test_negative/negative.py:283: error: Return type "DummyReply" of "UnaryStream" incompatible with return type "Iterator[DummyReply] | AsyncIterator[DummyReply]" in supertype "testproto.grpc.dummy_pb2_grpc.DummyServiceServicer" [override] +test_negative/negative.py:285: error: Argument 1 of "UnaryStream" is incompatible with supertype "testproto.grpc.dummy_pb2_grpc.DummyServiceServicer"; supertype defines the argument type as "DummyRequest" [override] +test_negative/negative.py:285: note: This violates the Liskov substitution principle +test_negative/negative.py:285: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#incompatible-overrides +test_negative/negative.py:292: error: Return type "Iterator[DummyReply]" of "StreamUnary" incompatible with return type "DummyReply | Awaitable[DummyReply]" in supertype "testproto.grpc.dummy_pb2_grpc.DummyServiceServicer" [override] +test_negative/negative.py:294: error: Argument 1 of "StreamUnary" is incompatible with supertype "testproto.grpc.dummy_pb2_grpc.DummyServiceServicer"; supertype defines the argument type as "_MaybeAsyncIterator[DummyRequest]" [override] +test_negative/negative.py:294: note: This violates the Liskov substitution principle +test_negative/negative.py:294: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#incompatible-overrides +test_negative/negative.py:328: error: function testproto.grpc.dummy_pb2_grpc.DeprecatedServiceStub.DeprecatedMethod is deprecated: This method has been marked as deprecated using proto method options. [deprecated] +test_negative/negative.py:329: error: function testproto.grpc.dummy_pb2_grpc.DeprecatedServiceStub.DeprecatedMethodNotDeprecatedRequest is deprecated: Method is deprecated, but request message is not [deprecated] +test_negative/negative.py:330: error: class testproto.grpc.dummy_pb2_grpc.DeprecatedServiceAsyncStub is deprecated: This service is deprecated [deprecated] +test_negative/negative.py:333: error: function testproto.test_pb2._DeprecatedEnumEnumTypeWrapper.DEPRECATED_ONE is deprecated: This enum value has been marked as deprecated using proto enum value options. [deprecated] +test_negative/negative.py:334: error: function testproto.test_pb2._DeprecatedEnumEnumTypeWrapper.DEPRECATED_TWO is deprecated: This enum value has been marked as deprecated using proto enum value options. [deprecated] +test_negative/negative.py:344: error: Argument "implicit_singular" to "Editions2024Test" has incompatible type "None"; expected "str" [arg-type] +test_negative/negative.py:346: error: Argument 1 to "HasField" of "Editions2024Test" has incompatible type "Literal['implicit_singular']"; expected "Literal['default_singular', b'default_singular', 'explicit_singular', b'explicit_singular', 'legacy', b'legacy', 'message_field', b'message_field']" [arg-type] +test_negative/negative.py:357: error: Cannot instantiate abstract class "IncompleteServicer" with abstract attributes "StreamStream", "StreamUnary", "UnaryStream" and "UnaryUnary" [abstract] +test_negative/negative.py:364: error: Argument 2 to "test_hasfield_alias" has incompatible type "Literal['not_a_field']"; expected "Literal['default_singular', b'default_singular', 'explicit_singular', b'explicit_singular', 'legacy', b'legacy', 'message_field', b'message_field']" [arg-type] +test_negative/negative.py:371: error: Argument 2 to "test_clearfield_alias" has incompatible type "Literal['not_a_field']"; expected "Literal['default_singular', b'default_singular', 'explicit_singular', b'explicit_singular', 'implicit_singular', b'implicit_singular', 'legacy', b'legacy', 'message_field', b'message_field']" [arg-type] +test_negative/negative.py:372: error: Property "message_field" defined in "Editions2024Test" is read-only [misc] +test_negative/negative.py:383: error: Argument 2 to "test_whichoneof_alias" has incompatible type "Literal['not_a_oneof']"; expected "Literal['a_oneof', b'a_oneof']" [arg-type] +test_negative/negative.py:386: error: All overload variants of "DummyServiceStub" require at least one argument [call-overload] +test_negative/negative.py:386: note: Possible overload variants: +test_negative/negative.py:386: note: def __new__(cls, channel: Channel) -> DummyServiceStub +test_negative/negative.py:386: note: def __new__(cls, channel: Channel) -> DummyServiceAsyncStub +test_negative/negative.py:387: error: No overload variant of "DummyServiceStub" matches argument type "str" [call-overload] +test_negative/negative.py:387: note: Possible overload variants: +test_negative/negative.py:387: note: def __new__(cls, channel: Channel) -> DummyServiceStub +test_negative/negative.py:387: note: def __new__(cls, channel: Channel) -> DummyServiceAsyncStub +Found 114 errors in 4 files (checked 4 source files) diff --git a/test_negative/output.expected.3.12.omit_linenos b/test_negative/output.expected.3.12.omit_linenos index b32a0a1e..abe41b67 100644 --- a/test_negative/output.expected.3.12.omit_linenos +++ b/test_negative/output.expected.3.12.omit_linenos @@ -1,10 +1,14 @@ test/generated/testproto/grpc/dummy_pb2.pyi: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] test/generated/testproto/grpc/dummy_pb2_grpc.pyi: error: class testproto.grpc.dummy_pb2_grpc.DeprecatedServiceAsyncStub is deprecated: This service is deprecated [deprecated] test/generated/testproto/grpc/dummy_pb2_grpc.pyi: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] +test/generated/testproto/grpc/dummy_pb2_grpc.pyi: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] test/generated/testproto/grpc/dummy_pb2_grpc.pyi: error: class testproto.grpc.dummy_pb2_grpc.DeprecatedServiceStub is deprecated: This service is deprecated [deprecated] test/generated/testproto/grpc/dummy_pb2_grpc.pyi: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] test/generated/testproto/grpc/dummy_pb2_grpc.pyi: note: Error code "deprecated" not covered by "type: ignore" comment test/generated/testproto/grpc/dummy_pb2_grpc.pyi: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] +test/generated/testproto/grpc/dummy_pb2_grpc.pyi: note: Error code "deprecated" not covered by "type: ignore" comment +test/generated/testproto/grpc/dummy_pb2_grpc.pyi: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] +test/generated/testproto/grpc/dummy_pb2_grpc.pyi: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] test/generated/testproto/grpc/dummy_pb2_grpc.pyi: error: class testproto.grpc.dummy_pb2_grpc.DeprecatedServiceServicer is deprecated: This service is deprecated [deprecated] test/generated/testproto/test_pb2.pyi: error: class testproto.test_pb2.DeprecatedEnum is deprecated: This enum is deprecated 2 lines of comments @@ -99,6 +103,7 @@ test_negative/negative.py: error: Property "a_repeated_string" defined in "Simpl test_negative/negative.py: error: Property "rep_inner_enum" defined in "Simple1" is read-only [misc] test_negative/negative.py: error: "_r_None" has no attribute "invalid"; maybe "valid"? [attr-defined] test_negative/negative.py: error: Incompatible types in assignment (expression has type "ValueType", variable has type "str") [assignment] +test_negative/negative.py: error: function testproto.test_pb2.DeprecatedMessage.deprecated_field is deprecated: This field has been marked as deprecated using proto field options. [deprecated] test_negative/negative.py: error: All overload variants of "DummyServiceStub" require at least one argument [call-overload] test_negative/negative.py: note: Possible overload variants: test_negative/negative.py: note: def __new__(cls, channel: Channel) -> DummyServiceStub @@ -124,12 +129,17 @@ test_negative/negative.py: error: Return type "Iterator[DummyReply]" of "StreamU test_negative/negative.py: error: Argument 1 of "StreamUnary" is incompatible with supertype "testproto.grpc.dummy_pb2_grpc.DummyServiceServicer"; supertype defines the argument type as "_MaybeAsyncIterator[DummyRequest]" [override] test_negative/negative.py: note: This violates the Liskov substitution principle test_negative/negative.py: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#incompatible-overrides +test_negative/negative.py: error: function testproto.grpc.dummy_pb2_grpc.DeprecatedServiceStub.DeprecatedMethod is deprecated: This method has been marked as deprecated using proto method options. [deprecated] +test_negative/negative.py: error: function testproto.grpc.dummy_pb2_grpc.DeprecatedServiceStub.DeprecatedMethodNotDeprecatedRequest is deprecated: Method is deprecated, but request message is not [deprecated] test_negative/negative.py: error: class testproto.grpc.dummy_pb2_grpc.DeprecatedServiceAsyncStub is deprecated: This service is deprecated [deprecated] +test_negative/negative.py: error: function testproto.test_pb2._DeprecatedEnumEnumTypeWrapper.DEPRECATED_ONE is deprecated: This enum value has been marked as deprecated using proto enum value options. [deprecated] +test_negative/negative.py: error: function testproto.test_pb2._DeprecatedEnumEnumTypeWrapper.DEPRECATED_TWO is deprecated: This enum value has been marked as deprecated using proto enum value options. [deprecated] test_negative/negative.py: error: Argument "implicit_singular" to "Editions2024Test" has incompatible type "None"; expected "str" [arg-type] test_negative/negative.py: error: Argument 1 to "HasField" of "Editions2024Test" has incompatible type "Literal['implicit_singular']"; expected "Literal['default_singular', b'default_singular', 'explicit_singular', b'explicit_singular', 'legacy', b'legacy', 'message_field', b'message_field']" [arg-type] test_negative/negative.py: error: Cannot instantiate abstract class "IncompleteServicer" with abstract attributes "StreamStream", "StreamUnary", "UnaryStream" and "UnaryUnary" [abstract] test_negative/negative.py: error: Argument 2 to "test_hasfield_alias" has incompatible type "Literal['not_a_field']"; expected "Literal['default_singular', b'default_singular', 'explicit_singular', b'explicit_singular', 'legacy', b'legacy', 'message_field', b'message_field']" [arg-type] test_negative/negative.py: error: Argument 2 to "test_clearfield_alias" has incompatible type "Literal['not_a_field']"; expected "Literal['default_singular', b'default_singular', 'explicit_singular', b'explicit_singular', 'implicit_singular', b'implicit_singular', 'legacy', b'legacy', 'message_field', b'message_field']" [arg-type] +test_negative/negative.py: error: Property "message_field" defined in "Editions2024Test" is read-only [misc] test_negative/negative.py: error: Argument 2 to "test_whichoneof_alias" has incompatible type "Literal['not_a_oneof']"; expected "Literal['a_oneof', b'a_oneof']" [arg-type] test_negative/negative.py: error: All overload variants of "DummyServiceStub" require at least one argument [call-overload] test_negative/negative.py: note: Possible overload variants: @@ -139,4 +149,4 @@ test_negative/negative.py: error: No overload variant of "DummyServiceStub" matc test_negative/negative.py: note: Possible overload variants: test_negative/negative.py: note: def __new__(cls, channel: Channel) -> DummyServiceStub test_negative/negative.py: note: def __new__(cls, channel: Channel) -> DummyServiceAsyncStub -Found 105 errors in 4 files (checked 4 source files) +Found 114 errors in 4 files (checked 4 source files) diff --git a/test_negative/output.expected.3.13 b/test_negative/output.expected.3.13 index f60b9d96..d7341476 100644 --- a/test_negative/output.expected.3.13 +++ b/test_negative/output.expected.3.13 @@ -1,18 +1,22 @@ -test/generated/testproto/grpc/dummy_pb2.pyi:71: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] +test/generated/testproto/grpc/dummy_pb2.pyi:76: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] test/generated/testproto/grpc/dummy_pb2_grpc.pyi:103: error: class testproto.grpc.dummy_pb2_grpc.DeprecatedServiceAsyncStub is deprecated: This service is deprecated [deprecated] -test/generated/testproto/grpc/dummy_pb2_grpc.pyi:104: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] -test/generated/testproto/grpc/dummy_pb2_grpc.pyi:111: error: class testproto.grpc.dummy_pb2_grpc.DeprecatedServiceStub is deprecated: This service is deprecated [deprecated] -test/generated/testproto/grpc/dummy_pb2_grpc.pyi:115: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] -test/generated/testproto/grpc/dummy_pb2_grpc.pyi:115: note: Error code "deprecated" not covered by "type: ignore" comment -test/generated/testproto/grpc/dummy_pb2_grpc.pyi:127: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] -test/generated/testproto/grpc/dummy_pb2_grpc.pyi:141: error: class testproto.grpc.dummy_pb2_grpc.DeprecatedServiceServicer is deprecated: This service is deprecated [deprecated] -test/generated/testproto/test_pb2.pyi:88: error: class testproto.test_pb2.DeprecatedEnum is deprecated: This enum is deprecated +test/generated/testproto/grpc/dummy_pb2_grpc.pyi:106: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] +test/generated/testproto/grpc/dummy_pb2_grpc.pyi:114: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] +test/generated/testproto/grpc/dummy_pb2_grpc.pyi:118: error: class testproto.grpc.dummy_pb2_grpc.DeprecatedServiceStub is deprecated: This service is deprecated [deprecated] +test/generated/testproto/grpc/dummy_pb2_grpc.pyi:124: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] +test/generated/testproto/grpc/dummy_pb2_grpc.pyi:124: note: Error code "deprecated" not covered by "type: ignore" comment +test/generated/testproto/grpc/dummy_pb2_grpc.pyi:132: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] +test/generated/testproto/grpc/dummy_pb2_grpc.pyi:132: note: Error code "deprecated" not covered by "type: ignore" comment +test/generated/testproto/grpc/dummy_pb2_grpc.pyi:141: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] +test/generated/testproto/grpc/dummy_pb2_grpc.pyi:157: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] +test/generated/testproto/grpc/dummy_pb2_grpc.pyi:162: error: class testproto.grpc.dummy_pb2_grpc.DeprecatedServiceServicer is deprecated: This service is deprecated [deprecated] +test/generated/testproto/test_pb2.pyi:96: error: class testproto.test_pb2.DeprecatedEnum is deprecated: This enum is deprecated 2 lines of comments "Quotes in comments" and 'single quotes' Trailing comment [deprecated] -test/generated/testproto/test_pb2.pyi:446: error: class testproto.test_pb2.DeprecatedMessage is deprecated: This message is deprecated [deprecated] -test/generated/testproto/test_pb2.pyi:465: error: class testproto.test_pb2.DeprecatedMessageBadComment is deprecated: This message has been marked as deprecated using proto message options. [deprecated] +test/generated/testproto/test_pb2.pyi:474: error: class testproto.test_pb2.DeprecatedMessage is deprecated: This message is deprecated [deprecated] +test/generated/testproto/test_pb2.pyi:493: error: class testproto.test_pb2.DeprecatedMessageBadComment is deprecated: This message has been marked as deprecated using proto message options. [deprecated] test_negative/negative.py:16: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] test_negative/negative.py:21: error: class testproto.grpc.dummy_pb2_grpc.DeprecatedServiceServicer is deprecated: This service is deprecated [deprecated] test_negative/negative.py:21: error: class testproto.grpc.dummy_pb2_grpc.DeprecatedServiceStub is deprecated: This service is deprecated [deprecated] @@ -23,120 +27,126 @@ test_negative/negative.py:30: error: class testproto.test_pb2.DeprecatedEnum is and 'single quotes' Trailing comment [deprecated] test_negative/negative.py:31: error: class testproto.test_pb2.DeprecatedMessage is deprecated: This message is deprecated [deprecated] -test_negative/negative.py:45: error: "Simple1" has no attribute "SerializeToStringg" [attr-defined] -test_negative/negative.py:48: error: Argument 1 to "ParseFromString" of "Message" has incompatible type "Simple1"; expected "bytes" [arg-type] -test_negative/negative.py:51: error: Argument 1 to "CopyFrom" of "Message" has incompatible type "bytes"; expected "Simple1" [arg-type] -test_negative/negative.py:55: error: Argument 1 to "extend" of "list" has incompatible type "RepeatedScalarFieldContainer[str]"; expected "Iterable[int]" [arg-type] -test_negative/negative.py:57: error: Argument "foo" to "TestMessage" has incompatible type "int"; expected "str" [arg-type] -test_negative/negative.py:60: error: Incompatible types in assignment (expression has type "int", variable has type "ValueType") [assignment] -test_negative/negative.py:63: error: Argument 1 to "HasField" of "Simple1" has incompatible type "Literal['garbage']"; expected "Literal['a_boolean', b'a_boolean', 'a_enum', b'a_enum', 'a_external_enum', b'a_external_enum', 'a_inner', b'a_inner', 'a_nested', b'a_nested', 'a_oneof', b'a_oneof', 'a_oneof_1', b'a_oneof_1', 'a_oneof_2', b'a_oneof_2', 'a_string', b'a_string', 'a_uint32', b'a_uint32', 'email', b'email', 'inner_enum', b'inner_enum', 'inner_enum_in_oneof', b'inner_enum_in_oneof', 'inner_message', b'inner_message', 'nested_enum', b'nested_enum', 'nested_message', b'nested_message', 'no_package', b'no_package', 'outer_enum_in_oneof', b'outer_enum_in_oneof', 'outer_message_in_oneof', b'outer_message_in_oneof', 'user_id', b'user_id']" [arg-type] -test_negative/negative.py:64: error: Argument 1 to "HasField" of "Simple1" has incompatible type "Literal['a_repeated_string']"; expected "Literal['a_boolean', b'a_boolean', 'a_enum', b'a_enum', 'a_external_enum', b'a_external_enum', 'a_inner', b'a_inner', 'a_nested', b'a_nested', 'a_oneof', b'a_oneof', 'a_oneof_1', b'a_oneof_1', 'a_oneof_2', b'a_oneof_2', 'a_string', b'a_string', 'a_uint32', b'a_uint32', 'email', b'email', 'inner_enum', b'inner_enum', 'inner_enum_in_oneof', b'inner_enum_in_oneof', 'inner_message', b'inner_message', 'nested_enum', b'nested_enum', 'nested_message', b'nested_message', 'no_package', b'no_package', 'outer_enum_in_oneof', b'outer_enum_in_oneof', 'outer_message_in_oneof', b'outer_message_in_oneof', 'user_id', b'user_id']" [arg-type] -test_negative/negative.py:68: error: Argument 1 to "HasField" of "SimpleProto3" has incompatible type "Literal['garbage']"; expected "Literal['OuterMessage3', b'OuterMessage3', '_an_optional_string', b'_an_optional_string', 'a_oneof', b'a_oneof', 'a_oneof_1', b'a_oneof_1', 'a_oneof_2', b'a_oneof_2', 'an_optional_string', b'an_optional_string', 'b_oneof', b'b_oneof', 'b_oneof_1', b'b_oneof_1', 'b_oneof_2', b'b_oneof_2', 'bool', b'bool', 'inner_enum_in_oneof', b'inner_enum_in_oneof', 'outer_enum_in_oneof', b'outer_enum_in_oneof', 'outer_message', b'outer_message', 'outer_message_in_oneof', b'outer_message_in_oneof']" [arg-type] -test_negative/negative.py:69: error: Argument 1 to "HasField" of "SimpleProto3" has incompatible type "Literal['a_string']"; expected "Literal['OuterMessage3', b'OuterMessage3', '_an_optional_string', b'_an_optional_string', 'a_oneof', b'a_oneof', 'a_oneof_1', b'a_oneof_1', 'a_oneof_2', b'a_oneof_2', 'an_optional_string', b'an_optional_string', 'b_oneof', b'b_oneof', 'b_oneof_1', b'b_oneof_1', 'b_oneof_2', b'b_oneof_2', 'bool', b'bool', 'inner_enum_in_oneof', b'inner_enum_in_oneof', 'outer_enum_in_oneof', b'outer_enum_in_oneof', 'outer_message', b'outer_message', 'outer_message_in_oneof', b'outer_message_in_oneof']" [arg-type] -test_negative/negative.py:70: error: Argument 1 to "HasField" of "SimpleProto3" has incompatible type "Literal['outer_enum']"; expected "Literal['OuterMessage3', b'OuterMessage3', '_an_optional_string', b'_an_optional_string', 'a_oneof', b'a_oneof', 'a_oneof_1', b'a_oneof_1', 'a_oneof_2', b'a_oneof_2', 'an_optional_string', b'an_optional_string', 'b_oneof', b'b_oneof', 'b_oneof_1', b'b_oneof_1', 'b_oneof_2', b'b_oneof_2', 'bool', b'bool', 'inner_enum_in_oneof', b'inner_enum_in_oneof', 'outer_enum_in_oneof', b'outer_enum_in_oneof', 'outer_message', b'outer_message', 'outer_message_in_oneof', b'outer_message_in_oneof']" [arg-type] -test_negative/negative.py:71: error: Argument 1 to "HasField" of "SimpleProto3" has incompatible type "Literal['a_repeated_string']"; expected "Literal['OuterMessage3', b'OuterMessage3', '_an_optional_string', b'_an_optional_string', 'a_oneof', b'a_oneof', 'a_oneof_1', b'a_oneof_1', 'a_oneof_2', b'a_oneof_2', 'an_optional_string', b'an_optional_string', 'b_oneof', b'b_oneof', 'b_oneof_1', b'b_oneof_1', 'b_oneof_2', b'b_oneof_2', 'bool', b'bool', 'inner_enum_in_oneof', b'inner_enum_in_oneof', 'outer_enum_in_oneof', b'outer_enum_in_oneof', 'outer_message', b'outer_message', 'outer_message_in_oneof', b'outer_message_in_oneof']" [arg-type] -test_negative/negative.py:74: error: Argument 1 to "ClearField" of "Simple1" has incompatible type "Literal['garbage']"; expected "Literal['a_boolean', b'a_boolean', 'a_enum', b'a_enum', 'a_external_enum', b'a_external_enum', 'a_inner', b'a_inner', 'a_nested', b'a_nested', 'a_oneof', b'a_oneof', 'a_oneof_1', b'a_oneof_1', 'a_oneof_2', b'a_oneof_2', 'a_repeated_string', b'a_repeated_string', 'a_string', b'a_string', 'a_uint32', b'a_uint32', 'email', b'email', 'email_by_uid', b'email_by_uid', 'inner_enum', b'inner_enum', 'inner_enum_in_oneof', b'inner_enum_in_oneof', 'inner_message', b'inner_message', 'nested_enum', b'nested_enum', 'nested_message', b'nested_message', 'no_package', b'no_package', 'outer_enum_in_oneof', b'outer_enum_in_oneof', 'outer_message_in_oneof', b'outer_message_in_oneof', 'rep_inner_enum', b'rep_inner_enum', 'rep_inner_message', b'rep_inner_message', 'user_id', b'user_id']" [arg-type] -test_negative/negative.py:77: error: Argument 1 to "ClearField" of "SimpleProto3" has incompatible type "Literal['garbage']"; expected "Literal['OuterEnum', b'OuterEnum', 'OuterMessage3', b'OuterMessage3', '_an_optional_string', b'_an_optional_string', 'a_oneof', b'a_oneof', 'a_oneof_1', b'a_oneof_1', 'a_oneof_2', b'a_oneof_2', 'a_outer_enum', b'a_outer_enum', 'a_repeated_string', b'a_repeated_string', 'a_string', b'a_string', 'an_optional_string', b'an_optional_string', 'b_oneof', b'b_oneof', 'b_oneof_1', b'b_oneof_1', 'b_oneof_2', b'b_oneof_2', 'bool', b'bool', 'email', b'email', 'email_by_uid', b'email_by_uid', 'inner_enum', b'inner_enum', 'inner_enum_in_oneof', b'inner_enum_in_oneof', 'map_message', b'map_message', 'map_scalar', b'map_scalar', 'outer_enum_in_oneof', b'outer_enum_in_oneof', 'outer_message', b'outer_message', 'outer_message_in_oneof', b'outer_message_in_oneof', 'user_id', b'user_id']" [arg-type] -test_negative/negative.py:80: error: Argument 1 to "WhichOneof" of "Simple1" has incompatible type "Literal['garbage']"; expected "Literal['a_oneof', b'a_oneof']" [arg-type] -test_negative/negative.py:82: error: Incompatible types in assignment (expression has type "Literal['a_oneof_1', 'a_oneof_2', 'outer_message_in_oneof', 'outer_enum_in_oneof', 'inner_enum_in_oneof'] | None", variable has type "int") [assignment] -test_negative/negative.py:87: error: Argument 1 to "HasField" of "Simple2" has incompatible type "Literal['a_oneof_1', 'a_oneof_2', 'outer_message_in_oneof', 'outer_enum_in_oneof', 'inner_enum_in_oneof']"; expected "Literal['a_string', b'a_string']" [arg-type] -test_negative/negative.py:91: error: Incompatible types in assignment (expression has type "Literal['a_oneof_1', 'a_oneof_2', 'outer_message_in_oneof', 'outer_enum_in_oneof', 'inner_enum_in_oneof'] | None", variable has type "str") [assignment] -test_negative/negative.py:94: error: No overload variant of "WhichOneof" of "SimpleProto3" matches argument type "str" [call-overload] -test_negative/negative.py:94: note: Possible overload variants: -test_negative/negative.py:94: note: def WhichOneof(self, oneof_group: Literal['_an_optional_string', b'_an_optional_string']) -> Literal['an_optional_string'] | None -test_negative/negative.py:94: note: def WhichOneof(self, oneof_group: Literal['a_oneof', b'a_oneof']) -> Literal['a_oneof_1', 'a_oneof_2', 'outer_message_in_oneof', 'outer_enum_in_oneof', 'inner_enum_in_oneof'] | None -test_negative/negative.py:94: note: def WhichOneof(self, oneof_group: Literal['b_oneof', b'b_oneof']) -> Literal['b_oneof_1', 'b_oneof_2'] | None -test_negative/negative.py:96: error: Incompatible types in assignment (expression has type "Literal['a_oneof_1', 'a_oneof_2', 'outer_message_in_oneof', 'outer_enum_in_oneof', 'inner_enum_in_oneof'] | None", variable has type "int") [assignment] -test_negative/negative.py:100: error: Argument 1 to "HasField" of "Simple2" has incompatible type "Literal['a_oneof_1', 'a_oneof_2', 'outer_message_in_oneof', 'outer_enum_in_oneof', 'inner_enum_in_oneof']"; expected "Literal['a_string', b'a_string']" [arg-type] -test_negative/negative.py:104: error: Incompatible types in assignment (expression has type "_ExtensionFieldDescriptor[Simple1, Extensions1]", variable has type "int") [assignment] -test_negative/negative.py:105: error: "type[Extensions1]" has no attribute "bad" [attr-defined] -test_negative/negative.py:107: error: "Extensions1" has no attribute "foo" [attr-defined] -test_negative/negative.py:108: error: Incompatible types in assignment (expression has type "Extensions2", variable has type "Extensions1") [assignment] -test_negative/negative.py:112: error: Invalid index type "str" for "_ExtensionDict[Simple1]"; expected type "_ExtensionFieldDescriptor[Simple1, Never]" [index] -test_negative/negative.py:113: error: Invalid index type "_ExtensionFieldDescriptor[Simple2, SeparateFileExtension]" for "_ExtensionDict[Simple1]"; expected type "_ExtensionFieldDescriptor[Simple1, SeparateFileExtension]" [index] -test_negative/negative.py:114: error: Unsupported operand types for in ("_ExtensionFieldDescriptor[Simple2, SeparateFileExtension]" and "_ExtensionDict[Simple1]") [operator] -test_negative/negative.py:115: error: Argument 1 to "__delitem__" of "_ExtensionDict" has incompatible type "_ExtensionFieldDescriptor[Simple2, SeparateFileExtension]"; expected "_ExtensionFieldDescriptor[Simple1, SeparateFileExtension]" [arg-type] -test_negative/negative.py:116: error: Argument 1 to "HasExtension" of "Message" has incompatible type "_ExtensionFieldDescriptor[Simple2, SeparateFileExtension]"; expected "_ExtensionFieldDescriptor[Simple1, Any]" [arg-type] -test_negative/negative.py:117: error: Argument 1 to "ClearExtension" of "Message" has incompatible type "_ExtensionFieldDescriptor[Simple1, Extensions1]"; expected "_ExtensionFieldDescriptor[Simple2, Any]" [arg-type] -test_negative/negative.py:121: error: Incompatible types in assignment (expression has type "int", variable has type "_ExtensionFieldDescriptor[Simple1, Any]") [assignment] -test_negative/negative.py:125: error: Incompatible types in assignment (expression has type "Literal['b_oneof_1', 'b_oneof_2'] | None", variable has type "Literal['a_oneof_1', 'a_oneof_2', 'outer_message_in_oneof', 'outer_enum_in_oneof', 'inner_enum_in_oneof'] | None") [assignment] -test_negative/negative.py:128: error: "Descriptor" has no attribute "Garbage" [attr-defined] +test_negative/negative.py:46: error: "Simple1" has no attribute "SerializeToStringg" [attr-defined] +test_negative/negative.py:49: error: Argument 1 to "ParseFromString" of "Message" has incompatible type "Simple1"; expected "bytes" [arg-type] +test_negative/negative.py:52: error: Argument 1 to "CopyFrom" of "Message" has incompatible type "bytes"; expected "Simple1" [arg-type] +test_negative/negative.py:56: error: Argument 1 to "extend" of "list" has incompatible type "RepeatedScalarFieldContainer[str]"; expected "Iterable[int]" [arg-type] +test_negative/negative.py:58: error: Argument "foo" to "TestMessage" has incompatible type "int"; expected "str" [arg-type] +test_negative/negative.py:61: error: Incompatible types in assignment (expression has type "int", variable has type "ValueType") [assignment] +test_negative/negative.py:64: error: Argument 1 to "HasField" of "Simple1" has incompatible type "Literal['garbage']"; expected "Literal['a_boolean', b'a_boolean', 'a_enum', b'a_enum', 'a_external_enum', b'a_external_enum', 'a_inner', b'a_inner', 'a_nested', b'a_nested', 'a_oneof', b'a_oneof', 'a_oneof_1', b'a_oneof_1', 'a_oneof_2', b'a_oneof_2', 'a_string', b'a_string', 'a_uint32', b'a_uint32', 'email', b'email', 'inner_enum', b'inner_enum', 'inner_enum_in_oneof', b'inner_enum_in_oneof', 'inner_message', b'inner_message', 'nested_enum', b'nested_enum', 'nested_message', b'nested_message', 'no_package', b'no_package', 'outer_enum_in_oneof', b'outer_enum_in_oneof', 'outer_message_in_oneof', b'outer_message_in_oneof', 'user_id', b'user_id']" [arg-type] +test_negative/negative.py:65: error: Argument 1 to "HasField" of "Simple1" has incompatible type "Literal['a_repeated_string']"; expected "Literal['a_boolean', b'a_boolean', 'a_enum', b'a_enum', 'a_external_enum', b'a_external_enum', 'a_inner', b'a_inner', 'a_nested', b'a_nested', 'a_oneof', b'a_oneof', 'a_oneof_1', b'a_oneof_1', 'a_oneof_2', b'a_oneof_2', 'a_string', b'a_string', 'a_uint32', b'a_uint32', 'email', b'email', 'inner_enum', b'inner_enum', 'inner_enum_in_oneof', b'inner_enum_in_oneof', 'inner_message', b'inner_message', 'nested_enum', b'nested_enum', 'nested_message', b'nested_message', 'no_package', b'no_package', 'outer_enum_in_oneof', b'outer_enum_in_oneof', 'outer_message_in_oneof', b'outer_message_in_oneof', 'user_id', b'user_id']" [arg-type] +test_negative/negative.py:69: error: Argument 1 to "HasField" of "SimpleProto3" has incompatible type "Literal['garbage']"; expected "Literal['OuterMessage3', b'OuterMessage3', '_an_optional_string', b'_an_optional_string', 'a_oneof', b'a_oneof', 'a_oneof_1', b'a_oneof_1', 'a_oneof_2', b'a_oneof_2', 'an_optional_string', b'an_optional_string', 'b_oneof', b'b_oneof', 'b_oneof_1', b'b_oneof_1', 'b_oneof_2', b'b_oneof_2', 'bool', b'bool', 'inner_enum_in_oneof', b'inner_enum_in_oneof', 'outer_enum_in_oneof', b'outer_enum_in_oneof', 'outer_message', b'outer_message', 'outer_message_in_oneof', b'outer_message_in_oneof']" [arg-type] +test_negative/negative.py:70: error: Argument 1 to "HasField" of "SimpleProto3" has incompatible type "Literal['a_string']"; expected "Literal['OuterMessage3', b'OuterMessage3', '_an_optional_string', b'_an_optional_string', 'a_oneof', b'a_oneof', 'a_oneof_1', b'a_oneof_1', 'a_oneof_2', b'a_oneof_2', 'an_optional_string', b'an_optional_string', 'b_oneof', b'b_oneof', 'b_oneof_1', b'b_oneof_1', 'b_oneof_2', b'b_oneof_2', 'bool', b'bool', 'inner_enum_in_oneof', b'inner_enum_in_oneof', 'outer_enum_in_oneof', b'outer_enum_in_oneof', 'outer_message', b'outer_message', 'outer_message_in_oneof', b'outer_message_in_oneof']" [arg-type] +test_negative/negative.py:71: error: Argument 1 to "HasField" of "SimpleProto3" has incompatible type "Literal['outer_enum']"; expected "Literal['OuterMessage3', b'OuterMessage3', '_an_optional_string', b'_an_optional_string', 'a_oneof', b'a_oneof', 'a_oneof_1', b'a_oneof_1', 'a_oneof_2', b'a_oneof_2', 'an_optional_string', b'an_optional_string', 'b_oneof', b'b_oneof', 'b_oneof_1', b'b_oneof_1', 'b_oneof_2', b'b_oneof_2', 'bool', b'bool', 'inner_enum_in_oneof', b'inner_enum_in_oneof', 'outer_enum_in_oneof', b'outer_enum_in_oneof', 'outer_message', b'outer_message', 'outer_message_in_oneof', b'outer_message_in_oneof']" [arg-type] +test_negative/negative.py:72: error: Argument 1 to "HasField" of "SimpleProto3" has incompatible type "Literal['a_repeated_string']"; expected "Literal['OuterMessage3', b'OuterMessage3', '_an_optional_string', b'_an_optional_string', 'a_oneof', b'a_oneof', 'a_oneof_1', b'a_oneof_1', 'a_oneof_2', b'a_oneof_2', 'an_optional_string', b'an_optional_string', 'b_oneof', b'b_oneof', 'b_oneof_1', b'b_oneof_1', 'b_oneof_2', b'b_oneof_2', 'bool', b'bool', 'inner_enum_in_oneof', b'inner_enum_in_oneof', 'outer_enum_in_oneof', b'outer_enum_in_oneof', 'outer_message', b'outer_message', 'outer_message_in_oneof', b'outer_message_in_oneof']" [arg-type] +test_negative/negative.py:75: error: Argument 1 to "ClearField" of "Simple1" has incompatible type "Literal['garbage']"; expected "Literal['a_boolean', b'a_boolean', 'a_enum', b'a_enum', 'a_external_enum', b'a_external_enum', 'a_inner', b'a_inner', 'a_nested', b'a_nested', 'a_oneof', b'a_oneof', 'a_oneof_1', b'a_oneof_1', 'a_oneof_2', b'a_oneof_2', 'a_repeated_string', b'a_repeated_string', 'a_string', b'a_string', 'a_uint32', b'a_uint32', 'email', b'email', 'email_by_uid', b'email_by_uid', 'inner_enum', b'inner_enum', 'inner_enum_in_oneof', b'inner_enum_in_oneof', 'inner_message', b'inner_message', 'nested_enum', b'nested_enum', 'nested_message', b'nested_message', 'no_package', b'no_package', 'outer_enum_in_oneof', b'outer_enum_in_oneof', 'outer_message_in_oneof', b'outer_message_in_oneof', 'rep_inner_enum', b'rep_inner_enum', 'rep_inner_message', b'rep_inner_message', 'user_id', b'user_id']" [arg-type] +test_negative/negative.py:78: error: Argument 1 to "ClearField" of "SimpleProto3" has incompatible type "Literal['garbage']"; expected "Literal['OuterEnum', b'OuterEnum', 'OuterMessage3', b'OuterMessage3', '_an_optional_string', b'_an_optional_string', 'a_oneof', b'a_oneof', 'a_oneof_1', b'a_oneof_1', 'a_oneof_2', b'a_oneof_2', 'a_outer_enum', b'a_outer_enum', 'a_repeated_string', b'a_repeated_string', 'a_string', b'a_string', 'an_optional_string', b'an_optional_string', 'b_oneof', b'b_oneof', 'b_oneof_1', b'b_oneof_1', 'b_oneof_2', b'b_oneof_2', 'bool', b'bool', 'email', b'email', 'email_by_uid', b'email_by_uid', 'inner_enum', b'inner_enum', 'inner_enum_in_oneof', b'inner_enum_in_oneof', 'map_message', b'map_message', 'map_scalar', b'map_scalar', 'outer_enum_in_oneof', b'outer_enum_in_oneof', 'outer_message', b'outer_message', 'outer_message_in_oneof', b'outer_message_in_oneof', 'user_id', b'user_id']" [arg-type] +test_negative/negative.py:81: error: Argument 1 to "WhichOneof" of "Simple1" has incompatible type "Literal['garbage']"; expected "Literal['a_oneof', b'a_oneof']" [arg-type] +test_negative/negative.py:83: error: Incompatible types in assignment (expression has type "Literal['a_oneof_1', 'a_oneof_2', 'outer_message_in_oneof', 'outer_enum_in_oneof', 'inner_enum_in_oneof'] | None", variable has type "int") [assignment] +test_negative/negative.py:88: error: Argument 1 to "HasField" of "Simple2" has incompatible type "Literal['a_oneof_1', 'a_oneof_2', 'outer_message_in_oneof', 'outer_enum_in_oneof', 'inner_enum_in_oneof']"; expected "Literal['a_string', b'a_string']" [arg-type] +test_negative/negative.py:92: error: Incompatible types in assignment (expression has type "Literal['a_oneof_1', 'a_oneof_2', 'outer_message_in_oneof', 'outer_enum_in_oneof', 'inner_enum_in_oneof'] | None", variable has type "str") [assignment] +test_negative/negative.py:95: error: No overload variant of "WhichOneof" of "SimpleProto3" matches argument type "str" [call-overload] +test_negative/negative.py:95: note: Possible overload variants: +test_negative/negative.py:95: note: def WhichOneof(self, oneof_group: Literal['_an_optional_string', b'_an_optional_string']) -> Literal['an_optional_string'] | None +test_negative/negative.py:95: note: def WhichOneof(self, oneof_group: Literal['a_oneof', b'a_oneof']) -> Literal['a_oneof_1', 'a_oneof_2', 'outer_message_in_oneof', 'outer_enum_in_oneof', 'inner_enum_in_oneof'] | None +test_negative/negative.py:95: note: def WhichOneof(self, oneof_group: Literal['b_oneof', b'b_oneof']) -> Literal['b_oneof_1', 'b_oneof_2'] | None +test_negative/negative.py:97: error: Incompatible types in assignment (expression has type "Literal['a_oneof_1', 'a_oneof_2', 'outer_message_in_oneof', 'outer_enum_in_oneof', 'inner_enum_in_oneof'] | None", variable has type "int") [assignment] +test_negative/negative.py:101: error: Argument 1 to "HasField" of "Simple2" has incompatible type "Literal['a_oneof_1', 'a_oneof_2', 'outer_message_in_oneof', 'outer_enum_in_oneof', 'inner_enum_in_oneof']"; expected "Literal['a_string', b'a_string']" [arg-type] +test_negative/negative.py:105: error: Incompatible types in assignment (expression has type "_ExtensionFieldDescriptor[Simple1, Extensions1]", variable has type "int") [assignment] +test_negative/negative.py:106: error: "type[Extensions1]" has no attribute "bad" [attr-defined] +test_negative/negative.py:108: error: "Extensions1" has no attribute "foo" [attr-defined] +test_negative/negative.py:109: error: Incompatible types in assignment (expression has type "Extensions2", variable has type "Extensions1") [assignment] +test_negative/negative.py:113: error: Invalid index type "str" for "_ExtensionDict[Simple1]"; expected type "_ExtensionFieldDescriptor[Simple1, Never]" [index] +test_negative/negative.py:114: error: Invalid index type "_ExtensionFieldDescriptor[Simple2, SeparateFileExtension]" for "_ExtensionDict[Simple1]"; expected type "_ExtensionFieldDescriptor[Simple1, SeparateFileExtension]" [index] +test_negative/negative.py:115: error: Unsupported operand types for in ("_ExtensionFieldDescriptor[Simple2, SeparateFileExtension]" and "_ExtensionDict[Simple1]") [operator] +test_negative/negative.py:116: error: Argument 1 to "__delitem__" of "_ExtensionDict" has incompatible type "_ExtensionFieldDescriptor[Simple2, SeparateFileExtension]"; expected "_ExtensionFieldDescriptor[Simple1, SeparateFileExtension]" [arg-type] +test_negative/negative.py:117: error: Argument 1 to "HasExtension" of "Message" has incompatible type "_ExtensionFieldDescriptor[Simple2, SeparateFileExtension]"; expected "_ExtensionFieldDescriptor[Simple1, Any]" [arg-type] +test_negative/negative.py:118: error: Argument 1 to "ClearExtension" of "Message" has incompatible type "_ExtensionFieldDescriptor[Simple1, Extensions1]"; expected "_ExtensionFieldDescriptor[Simple2, Any]" [arg-type] +test_negative/negative.py:122: error: Incompatible types in assignment (expression has type "int", variable has type "_ExtensionFieldDescriptor[Simple1, Any]") [assignment] +test_negative/negative.py:126: error: Incompatible types in assignment (expression has type "Literal['b_oneof_1', 'b_oneof_2'] | None", variable has type "Literal['a_oneof_1', 'a_oneof_2', 'outer_message_in_oneof', 'outer_enum_in_oneof', 'inner_enum_in_oneof'] | None") [assignment] test_negative/negative.py:129: error: "Descriptor" has no attribute "Garbage" [attr-defined] -test_negative/negative.py:132: error: "EnumDescriptor" has no attribute "Garbage" [attr-defined] -test_negative/negative.py:135: error: "FileDescriptor" has no attribute "Garbage" [attr-defined] -test_negative/negative.py:142: error: "ValueType" has no attribute "FOO" [attr-defined] -test_negative/negative.py:146: error: Argument 1 to "Name" of "_EnumTypeWrapper" has incompatible type "int"; expected "ValueType" [arg-type] -test_negative/negative.py:148: error: Argument 1 to "Name" of "_EnumTypeWrapper" has incompatible type "testproto.test3_pb2.SimpleProto3._InnerEnum.ValueType"; expected "testproto.test3_pb2._OuterEnum.ValueType" [arg-type] -test_negative/negative.py:150: error: Argument 1 to "Name" of "_EnumTypeWrapper" has incompatible type "testproto.test3_pb2.SimpleProto3._InnerEnum.ValueType"; expected "testproto.test3_pb2._OuterEnum.ValueType" [arg-type] -test_negative/negative.py:152: error: Argument 1 to "Name" of "_EnumTypeWrapper" has incompatible type "testproto.test3_pb2.SimpleProto3._InnerEnum.ValueType"; expected "testproto.test3_pb2._OuterEnum.ValueType" [arg-type] -test_negative/negative.py:156: error: "ScalarMap[int, str]" has no attribute "get_or_create" [attr-defined] -test_negative/negative.py:158: error: No overload variant of "get" of "ScalarMap" matches argument type "str" [call-overload] -test_negative/negative.py:158: note: Possible overload variants: -test_negative/negative.py:158: note: def get(self, key: int, default: None = ...) -> str | None -test_negative/negative.py:158: note: def get(self, key: int, default: str) -> str -test_negative/negative.py:158: note: def [_T] get(self, key: int, default: _T) -> str | _T -test_negative/negative.py:159: error: No overload variant of "get" of "MessageMap" matches argument type "str" [call-overload] +test_negative/negative.py:130: error: "Descriptor" has no attribute "Garbage" [attr-defined] +test_negative/negative.py:133: error: "EnumDescriptor" has no attribute "Garbage" [attr-defined] +test_negative/negative.py:136: error: "FileDescriptor" has no attribute "Garbage" [attr-defined] +test_negative/negative.py:143: error: "ValueType" has no attribute "FOO" [attr-defined] +test_negative/negative.py:147: error: Argument 1 to "Name" of "_EnumTypeWrapper" has incompatible type "int"; expected "ValueType" [arg-type] +test_negative/negative.py:149: error: Argument 1 to "Name" of "_EnumTypeWrapper" has incompatible type "testproto.test3_pb2.SimpleProto3._InnerEnum.ValueType"; expected "testproto.test3_pb2._OuterEnum.ValueType" [arg-type] +test_negative/negative.py:151: error: Argument 1 to "Name" of "_EnumTypeWrapper" has incompatible type "testproto.test3_pb2.SimpleProto3._InnerEnum.ValueType"; expected "testproto.test3_pb2._OuterEnum.ValueType" [arg-type] +test_negative/negative.py:153: error: Argument 1 to "Name" of "_EnumTypeWrapper" has incompatible type "testproto.test3_pb2.SimpleProto3._InnerEnum.ValueType"; expected "testproto.test3_pb2._OuterEnum.ValueType" [arg-type] +test_negative/negative.py:157: error: "ScalarMap[int, str]" has no attribute "get_or_create" [attr-defined] +test_negative/negative.py:159: error: No overload variant of "get" of "ScalarMap" matches argument type "str" [call-overload] test_negative/negative.py:159: note: Possible overload variants: -test_negative/negative.py:159: note: def get(self, key: int, default: None = ...) -> OuterMessage3 | None -test_negative/negative.py:159: note: def get(self, key: int, default: OuterMessage3) -> OuterMessage3 -test_negative/negative.py:159: note: def [_T] get(self, key: int, default: _T) -> OuterMessage3 | _T -test_negative/negative.py:162: error: Incompatible types in assignment (expression has type "str | None", variable has type "int") [assignment] -test_negative/negative.py:163: error: Incompatible types in assignment (expression has type "OuterMessage3 | None", variable has type "int") [assignment] -test_negative/negative.py:165: error: Dict entry 0 has incompatible type "str": "int"; expected "int": "str" [dict-item] -test_negative/negative.py:165: error: Dict entry 0 has incompatible type "str": "str"; expected "int": "OuterMessage3" [dict-item] -test_negative/negative.py:169: error: Incompatible types in assignment (expression has type "int", variable has type "UserId") [assignment] -test_negative/negative.py:170: error: Incompatible types in assignment (expression has type "str", variable has type "Email") [assignment] -test_negative/negative.py:171: error: Invalid index type "int" for "ScalarMap[UserId, Email]"; expected type "UserId" [index] -test_negative/negative.py:171: error: Incompatible types in assignment (expression has type "str", target has type "Email") [assignment] +test_negative/negative.py:159: note: def get(self, key: int, default: None = ...) -> str | None +test_negative/negative.py:159: note: def get(self, key: int, default: str) -> str +test_negative/negative.py:159: note: def [_T] get(self, key: int, default: _T) -> str | _T +test_negative/negative.py:160: error: No overload variant of "get" of "MessageMap" matches argument type "str" [call-overload] +test_negative/negative.py:160: note: Possible overload variants: +test_negative/negative.py:160: note: def get(self, key: int, default: None = ...) -> OuterMessage3 | None +test_negative/negative.py:160: note: def get(self, key: int, default: OuterMessage3) -> OuterMessage3 +test_negative/negative.py:160: note: def [_T] get(self, key: int, default: _T) -> OuterMessage3 | _T +test_negative/negative.py:163: error: Incompatible types in assignment (expression has type "str | None", variable has type "int") [assignment] +test_negative/negative.py:164: error: Incompatible types in assignment (expression has type "OuterMessage3 | None", variable has type "int") [assignment] +test_negative/negative.py:166: error: Dict entry 0 has incompatible type "str": "int"; expected "int": "str" [dict-item] +test_negative/negative.py:166: error: Dict entry 0 has incompatible type "str": "str"; expected "int": "OuterMessage3" [dict-item] +test_negative/negative.py:170: error: Incompatible types in assignment (expression has type "int", variable has type "UserId") [assignment] +test_negative/negative.py:171: error: Incompatible types in assignment (expression has type "str", variable has type "Email") [assignment] +test_negative/negative.py:172: error: Invalid index type "int" for "ScalarMap[UserId, Email]"; expected type "UserId" [index] test_negative/negative.py:172: error: Incompatible types in assignment (expression has type "str", target has type "Email") [assignment] -test_negative/negative.py:173: error: Invalid index type "int" for "ScalarMap[UserId, Email]"; expected type "UserId" [index] -test_negative/negative.py:175: error: Argument "user_id" to "Simple1" has incompatible type "int"; expected "UserId | None" [arg-type] -test_negative/negative.py:176: error: Argument "email" to "Simple1" has incompatible type "str"; expected "Email | None" [arg-type] -test_negative/negative.py:177: error: Dict entry 0 has incompatible type "int": "str"; expected "UserId": "Email" [dict-item] -test_negative/negative.py:181: error: Module "testproto.reexport_pb2" has no attribute "Inner" [attr-defined] -test_negative/negative.py:185: error: Argument "a_string" to "OuterMessage3" has incompatible type "None"; expected "str" [arg-type] -test_negative/negative.py:190: error: Property "a_repeated_string" defined in "Simple1" is read-only [misc] -test_negative/negative.py:191: error: Property "rep_inner_enum" defined in "Simple1" is read-only [misc] -test_negative/negative.py:196: error: "_r_None" has no attribute "invalid"; maybe "valid"? [attr-defined] -test_negative/negative.py:200: error: Incompatible types in assignment (expression has type "ValueType", variable has type "str") [assignment] -test_negative/negative.py:204: error: All overload variants of "DummyServiceStub" require at least one argument [call-overload] -test_negative/negative.py:204: note: Possible overload variants: -test_negative/negative.py:204: note: def __new__(cls, channel: Channel) -> DummyServiceStub -test_negative/negative.py:204: note: def __new__(cls, channel: Channel) -> DummyServiceAsyncStub -test_negative/negative.py:211: error: "DummyReply" has no attribute "not_exists" [attr-defined] -test_negative/negative.py:212: error: "DummyReply" has no attribute "__iter__" (not iterable) [attr-defined] -test_negative/negative.py:217: error: "DummyReply" has no attribute "not_exists" [attr-defined] -test_negative/negative.py:219: error: "_CallIterator[DummyReply]" has no attribute "value" [attr-defined] -test_negative/negative.py:226: error: Argument 1 to "__call__" of "StreamUnaryMultiCallable" has incompatible type "DummyRequest"; expected "Iterator[DummyRequest]" [arg-type] -test_negative/negative.py:228: error: "DummyReply" has no attribute "__iter__" (not iterable) [attr-defined] -test_negative/negative.py:228: error: Argument 1 to "__call__" of "StreamUnaryMultiCallable" has incompatible type "DummyRequest"; expected "Iterator[DummyRequest]" [arg-type] -test_negative/negative.py:231: error: Argument 1 to "__call__" of "StreamStreamMultiCallable" has incompatible type "DummyRequest"; expected "Iterator[DummyRequest]" [arg-type] -test_negative/negative.py:235: error: "DummyReply" has no attribute "not_exists" [attr-defined] -test_negative/negative.py:272: error: Return type "Iterator[DummyReply]" of "UnaryUnary" incompatible with return type "DummyReply | Awaitable[DummyReply]" in supertype "testproto.grpc.dummy_pb2_grpc.DummyServiceServicer" [override] -test_negative/negative.py:274: error: Argument 1 of "UnaryUnary" is incompatible with supertype "testproto.grpc.dummy_pb2_grpc.DummyServiceServicer"; supertype defines the argument type as "DummyRequest" [override] -test_negative/negative.py:274: note: This violates the Liskov substitution principle -test_negative/negative.py:274: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#incompatible-overrides -test_negative/negative.py:280: error: Return type "DummyReply" of "UnaryStream" incompatible with return type "Iterator[DummyReply] | AsyncIterator[DummyReply]" in supertype "testproto.grpc.dummy_pb2_grpc.DummyServiceServicer" [override] -test_negative/negative.py:282: error: Argument 1 of "UnaryStream" is incompatible with supertype "testproto.grpc.dummy_pb2_grpc.DummyServiceServicer"; supertype defines the argument type as "DummyRequest" [override] -test_negative/negative.py:282: note: This violates the Liskov substitution principle -test_negative/negative.py:282: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#incompatible-overrides -test_negative/negative.py:289: error: Return type "Iterator[DummyReply]" of "StreamUnary" incompatible with return type "DummyReply | Awaitable[DummyReply]" in supertype "testproto.grpc.dummy_pb2_grpc.DummyServiceServicer" [override] -test_negative/negative.py:291: error: Argument 1 of "StreamUnary" is incompatible with supertype "testproto.grpc.dummy_pb2_grpc.DummyServiceServicer"; supertype defines the argument type as "_MaybeAsyncIterator[DummyRequest]" [override] -test_negative/negative.py:291: note: This violates the Liskov substitution principle -test_negative/negative.py:291: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#incompatible-overrides -test_negative/negative.py:320: error: class testproto.grpc.dummy_pb2_grpc.DeprecatedServiceAsyncStub is deprecated: This service is deprecated [deprecated] -test_negative/negative.py:332: error: Argument "implicit_singular" to "Editions2024Test" has incompatible type "None"; expected "str" [arg-type] -test_negative/negative.py:334: error: Argument 1 to "HasField" of "Editions2024Test" has incompatible type "Literal['implicit_singular']"; expected "Literal['default_singular', b'default_singular', 'explicit_singular', b'explicit_singular', 'legacy', b'legacy', 'message_field', b'message_field']" [arg-type] -test_negative/negative.py:345: error: Cannot instantiate abstract class "IncompleteServicer" with abstract attributes "StreamStream", "StreamUnary", "UnaryStream" and "UnaryUnary" [abstract] -test_negative/negative.py:352: error: Argument 2 to "test_hasfield_alias" has incompatible type "Literal['not_a_field']"; expected "Literal['default_singular', b'default_singular', 'explicit_singular', b'explicit_singular', 'legacy', b'legacy', 'message_field', b'message_field']" [arg-type] -test_negative/negative.py:359: error: Argument 2 to "test_clearfield_alias" has incompatible type "Literal['not_a_field']"; expected "Literal['default_singular', b'default_singular', 'explicit_singular', b'explicit_singular', 'implicit_singular', b'implicit_singular', 'legacy', b'legacy', 'message_field', b'message_field']" [arg-type] -test_negative/negative.py:369: error: Argument 2 to "test_whichoneof_alias" has incompatible type "Literal['not_a_oneof']"; expected "Literal['a_oneof', b'a_oneof']" [arg-type] -test_negative/negative.py:372: error: All overload variants of "DummyServiceStub" require at least one argument [call-overload] -test_negative/negative.py:372: note: Possible overload variants: -test_negative/negative.py:372: note: def __new__(cls, channel: Channel) -> DummyServiceStub -test_negative/negative.py:372: note: def __new__(cls, channel: Channel) -> DummyServiceAsyncStub -test_negative/negative.py:373: error: No overload variant of "DummyServiceStub" matches argument type "str" [call-overload] -test_negative/negative.py:373: note: Possible overload variants: -test_negative/negative.py:373: note: def __new__(cls, channel: Channel) -> DummyServiceStub -test_negative/negative.py:373: note: def __new__(cls, channel: Channel) -> DummyServiceAsyncStub -Found 105 errors in 4 files (checked 4 source files) +test_negative/negative.py:173: error: Incompatible types in assignment (expression has type "str", target has type "Email") [assignment] +test_negative/negative.py:174: error: Invalid index type "int" for "ScalarMap[UserId, Email]"; expected type "UserId" [index] +test_negative/negative.py:176: error: Argument "user_id" to "Simple1" has incompatible type "int"; expected "UserId | None" [arg-type] +test_negative/negative.py:177: error: Argument "email" to "Simple1" has incompatible type "str"; expected "Email | None" [arg-type] +test_negative/negative.py:178: error: Dict entry 0 has incompatible type "int": "str"; expected "UserId": "Email" [dict-item] +test_negative/negative.py:182: error: Module "testproto.reexport_pb2" has no attribute "Inner" [attr-defined] +test_negative/negative.py:186: error: Argument "a_string" to "OuterMessage3" has incompatible type "None"; expected "str" [arg-type] +test_negative/negative.py:191: error: Property "a_repeated_string" defined in "Simple1" is read-only [misc] +test_negative/negative.py:192: error: Property "rep_inner_enum" defined in "Simple1" is read-only [misc] +test_negative/negative.py:197: error: "_r_None" has no attribute "invalid"; maybe "valid"? [attr-defined] +test_negative/negative.py:201: error: Incompatible types in assignment (expression has type "ValueType", variable has type "str") [assignment] +test_negative/negative.py:205: error: function testproto.test_pb2.DeprecatedMessage.deprecated_field is deprecated: This field has been marked as deprecated using proto field options. [deprecated] +test_negative/negative.py:207: error: All overload variants of "DummyServiceStub" require at least one argument [call-overload] +test_negative/negative.py:207: note: Possible overload variants: +test_negative/negative.py:207: note: def __new__(cls, channel: Channel) -> DummyServiceStub +test_negative/negative.py:207: note: def __new__(cls, channel: Channel) -> DummyServiceAsyncStub +test_negative/negative.py:214: error: "DummyReply" has no attribute "not_exists" [attr-defined] +test_negative/negative.py:215: error: "DummyReply" has no attribute "__iter__" (not iterable) [attr-defined] +test_negative/negative.py:220: error: "DummyReply" has no attribute "not_exists" [attr-defined] +test_negative/negative.py:222: error: "_CallIterator[DummyReply]" has no attribute "value" [attr-defined] +test_negative/negative.py:229: error: Argument 1 to "__call__" of "StreamUnaryMultiCallable" has incompatible type "DummyRequest"; expected "Iterator[DummyRequest]" [arg-type] +test_negative/negative.py:231: error: "DummyReply" has no attribute "__iter__" (not iterable) [attr-defined] +test_negative/negative.py:231: error: Argument 1 to "__call__" of "StreamUnaryMultiCallable" has incompatible type "DummyRequest"; expected "Iterator[DummyRequest]" [arg-type] +test_negative/negative.py:234: error: Argument 1 to "__call__" of "StreamStreamMultiCallable" has incompatible type "DummyRequest"; expected "Iterator[DummyRequest]" [arg-type] +test_negative/negative.py:238: error: "DummyReply" has no attribute "not_exists" [attr-defined] +test_negative/negative.py:275: error: Return type "Iterator[DummyReply]" of "UnaryUnary" incompatible with return type "DummyReply | Awaitable[DummyReply]" in supertype "testproto.grpc.dummy_pb2_grpc.DummyServiceServicer" [override] +test_negative/negative.py:277: error: Argument 1 of "UnaryUnary" is incompatible with supertype "testproto.grpc.dummy_pb2_grpc.DummyServiceServicer"; supertype defines the argument type as "DummyRequest" [override] +test_negative/negative.py:277: note: This violates the Liskov substitution principle +test_negative/negative.py:277: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#incompatible-overrides +test_negative/negative.py:283: error: Return type "DummyReply" of "UnaryStream" incompatible with return type "Iterator[DummyReply] | AsyncIterator[DummyReply]" in supertype "testproto.grpc.dummy_pb2_grpc.DummyServiceServicer" [override] +test_negative/negative.py:285: error: Argument 1 of "UnaryStream" is incompatible with supertype "testproto.grpc.dummy_pb2_grpc.DummyServiceServicer"; supertype defines the argument type as "DummyRequest" [override] +test_negative/negative.py:285: note: This violates the Liskov substitution principle +test_negative/negative.py:285: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#incompatible-overrides +test_negative/negative.py:292: error: Return type "Iterator[DummyReply]" of "StreamUnary" incompatible with return type "DummyReply | Awaitable[DummyReply]" in supertype "testproto.grpc.dummy_pb2_grpc.DummyServiceServicer" [override] +test_negative/negative.py:294: error: Argument 1 of "StreamUnary" is incompatible with supertype "testproto.grpc.dummy_pb2_grpc.DummyServiceServicer"; supertype defines the argument type as "_MaybeAsyncIterator[DummyRequest]" [override] +test_negative/negative.py:294: note: This violates the Liskov substitution principle +test_negative/negative.py:294: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#incompatible-overrides +test_negative/negative.py:328: error: function testproto.grpc.dummy_pb2_grpc.DeprecatedServiceStub.DeprecatedMethod is deprecated: This method has been marked as deprecated using proto method options. [deprecated] +test_negative/negative.py:329: error: function testproto.grpc.dummy_pb2_grpc.DeprecatedServiceStub.DeprecatedMethodNotDeprecatedRequest is deprecated: Method is deprecated, but request message is not [deprecated] +test_negative/negative.py:330: error: class testproto.grpc.dummy_pb2_grpc.DeprecatedServiceAsyncStub is deprecated: This service is deprecated [deprecated] +test_negative/negative.py:333: error: function testproto.test_pb2._DeprecatedEnumEnumTypeWrapper.DEPRECATED_ONE is deprecated: This enum value has been marked as deprecated using proto enum value options. [deprecated] +test_negative/negative.py:334: error: function testproto.test_pb2._DeprecatedEnumEnumTypeWrapper.DEPRECATED_TWO is deprecated: This enum value has been marked as deprecated using proto enum value options. [deprecated] +test_negative/negative.py:344: error: Argument "implicit_singular" to "Editions2024Test" has incompatible type "None"; expected "str" [arg-type] +test_negative/negative.py:346: error: Argument 1 to "HasField" of "Editions2024Test" has incompatible type "Literal['implicit_singular']"; expected "Literal['default_singular', b'default_singular', 'explicit_singular', b'explicit_singular', 'legacy', b'legacy', 'message_field', b'message_field']" [arg-type] +test_negative/negative.py:357: error: Cannot instantiate abstract class "IncompleteServicer" with abstract attributes "StreamStream", "StreamUnary", "UnaryStream" and "UnaryUnary" [abstract] +test_negative/negative.py:364: error: Argument 2 to "test_hasfield_alias" has incompatible type "Literal['not_a_field']"; expected "Literal['default_singular', b'default_singular', 'explicit_singular', b'explicit_singular', 'legacy', b'legacy', 'message_field', b'message_field']" [arg-type] +test_negative/negative.py:371: error: Argument 2 to "test_clearfield_alias" has incompatible type "Literal['not_a_field']"; expected "Literal['default_singular', b'default_singular', 'explicit_singular', b'explicit_singular', 'implicit_singular', b'implicit_singular', 'legacy', b'legacy', 'message_field', b'message_field']" [arg-type] +test_negative/negative.py:372: error: Property "message_field" defined in "Editions2024Test" is read-only [misc] +test_negative/negative.py:383: error: Argument 2 to "test_whichoneof_alias" has incompatible type "Literal['not_a_oneof']"; expected "Literal['a_oneof', b'a_oneof']" [arg-type] +test_negative/negative.py:386: error: All overload variants of "DummyServiceStub" require at least one argument [call-overload] +test_negative/negative.py:386: note: Possible overload variants: +test_negative/negative.py:386: note: def __new__(cls, channel: Channel) -> DummyServiceStub +test_negative/negative.py:386: note: def __new__(cls, channel: Channel) -> DummyServiceAsyncStub +test_negative/negative.py:387: error: No overload variant of "DummyServiceStub" matches argument type "str" [call-overload] +test_negative/negative.py:387: note: Possible overload variants: +test_negative/negative.py:387: note: def __new__(cls, channel: Channel) -> DummyServiceStub +test_negative/negative.py:387: note: def __new__(cls, channel: Channel) -> DummyServiceAsyncStub +Found 114 errors in 4 files (checked 4 source files) diff --git a/test_negative/output.expected.3.13.omit_linenos b/test_negative/output.expected.3.13.omit_linenos index b32a0a1e..abe41b67 100644 --- a/test_negative/output.expected.3.13.omit_linenos +++ b/test_negative/output.expected.3.13.omit_linenos @@ -1,10 +1,14 @@ test/generated/testproto/grpc/dummy_pb2.pyi: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] test/generated/testproto/grpc/dummy_pb2_grpc.pyi: error: class testproto.grpc.dummy_pb2_grpc.DeprecatedServiceAsyncStub is deprecated: This service is deprecated [deprecated] test/generated/testproto/grpc/dummy_pb2_grpc.pyi: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] +test/generated/testproto/grpc/dummy_pb2_grpc.pyi: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] test/generated/testproto/grpc/dummy_pb2_grpc.pyi: error: class testproto.grpc.dummy_pb2_grpc.DeprecatedServiceStub is deprecated: This service is deprecated [deprecated] test/generated/testproto/grpc/dummy_pb2_grpc.pyi: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] test/generated/testproto/grpc/dummy_pb2_grpc.pyi: note: Error code "deprecated" not covered by "type: ignore" comment test/generated/testproto/grpc/dummy_pb2_grpc.pyi: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] +test/generated/testproto/grpc/dummy_pb2_grpc.pyi: note: Error code "deprecated" not covered by "type: ignore" comment +test/generated/testproto/grpc/dummy_pb2_grpc.pyi: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] +test/generated/testproto/grpc/dummy_pb2_grpc.pyi: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] test/generated/testproto/grpc/dummy_pb2_grpc.pyi: error: class testproto.grpc.dummy_pb2_grpc.DeprecatedServiceServicer is deprecated: This service is deprecated [deprecated] test/generated/testproto/test_pb2.pyi: error: class testproto.test_pb2.DeprecatedEnum is deprecated: This enum is deprecated 2 lines of comments @@ -99,6 +103,7 @@ test_negative/negative.py: error: Property "a_repeated_string" defined in "Simpl test_negative/negative.py: error: Property "rep_inner_enum" defined in "Simple1" is read-only [misc] test_negative/negative.py: error: "_r_None" has no attribute "invalid"; maybe "valid"? [attr-defined] test_negative/negative.py: error: Incompatible types in assignment (expression has type "ValueType", variable has type "str") [assignment] +test_negative/negative.py: error: function testproto.test_pb2.DeprecatedMessage.deprecated_field is deprecated: This field has been marked as deprecated using proto field options. [deprecated] test_negative/negative.py: error: All overload variants of "DummyServiceStub" require at least one argument [call-overload] test_negative/negative.py: note: Possible overload variants: test_negative/negative.py: note: def __new__(cls, channel: Channel) -> DummyServiceStub @@ -124,12 +129,17 @@ test_negative/negative.py: error: Return type "Iterator[DummyReply]" of "StreamU test_negative/negative.py: error: Argument 1 of "StreamUnary" is incompatible with supertype "testproto.grpc.dummy_pb2_grpc.DummyServiceServicer"; supertype defines the argument type as "_MaybeAsyncIterator[DummyRequest]" [override] test_negative/negative.py: note: This violates the Liskov substitution principle test_negative/negative.py: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#incompatible-overrides +test_negative/negative.py: error: function testproto.grpc.dummy_pb2_grpc.DeprecatedServiceStub.DeprecatedMethod is deprecated: This method has been marked as deprecated using proto method options. [deprecated] +test_negative/negative.py: error: function testproto.grpc.dummy_pb2_grpc.DeprecatedServiceStub.DeprecatedMethodNotDeprecatedRequest is deprecated: Method is deprecated, but request message is not [deprecated] test_negative/negative.py: error: class testproto.grpc.dummy_pb2_grpc.DeprecatedServiceAsyncStub is deprecated: This service is deprecated [deprecated] +test_negative/negative.py: error: function testproto.test_pb2._DeprecatedEnumEnumTypeWrapper.DEPRECATED_ONE is deprecated: This enum value has been marked as deprecated using proto enum value options. [deprecated] +test_negative/negative.py: error: function testproto.test_pb2._DeprecatedEnumEnumTypeWrapper.DEPRECATED_TWO is deprecated: This enum value has been marked as deprecated using proto enum value options. [deprecated] test_negative/negative.py: error: Argument "implicit_singular" to "Editions2024Test" has incompatible type "None"; expected "str" [arg-type] test_negative/negative.py: error: Argument 1 to "HasField" of "Editions2024Test" has incompatible type "Literal['implicit_singular']"; expected "Literal['default_singular', b'default_singular', 'explicit_singular', b'explicit_singular', 'legacy', b'legacy', 'message_field', b'message_field']" [arg-type] test_negative/negative.py: error: Cannot instantiate abstract class "IncompleteServicer" with abstract attributes "StreamStream", "StreamUnary", "UnaryStream" and "UnaryUnary" [abstract] test_negative/negative.py: error: Argument 2 to "test_hasfield_alias" has incompatible type "Literal['not_a_field']"; expected "Literal['default_singular', b'default_singular', 'explicit_singular', b'explicit_singular', 'legacy', b'legacy', 'message_field', b'message_field']" [arg-type] test_negative/negative.py: error: Argument 2 to "test_clearfield_alias" has incompatible type "Literal['not_a_field']"; expected "Literal['default_singular', b'default_singular', 'explicit_singular', b'explicit_singular', 'implicit_singular', b'implicit_singular', 'legacy', b'legacy', 'message_field', b'message_field']" [arg-type] +test_negative/negative.py: error: Property "message_field" defined in "Editions2024Test" is read-only [misc] test_negative/negative.py: error: Argument 2 to "test_whichoneof_alias" has incompatible type "Literal['not_a_oneof']"; expected "Literal['a_oneof', b'a_oneof']" [arg-type] test_negative/negative.py: error: All overload variants of "DummyServiceStub" require at least one argument [call-overload] test_negative/negative.py: note: Possible overload variants: @@ -139,4 +149,4 @@ test_negative/negative.py: error: No overload variant of "DummyServiceStub" matc test_negative/negative.py: note: Possible overload variants: test_negative/negative.py: note: def __new__(cls, channel: Channel) -> DummyServiceStub test_negative/negative.py: note: def __new__(cls, channel: Channel) -> DummyServiceAsyncStub -Found 105 errors in 4 files (checked 4 source files) +Found 114 errors in 4 files (checked 4 source files) diff --git a/test_negative/output.expected.3.14 b/test_negative/output.expected.3.14 index f60b9d96..d7341476 100644 --- a/test_negative/output.expected.3.14 +++ b/test_negative/output.expected.3.14 @@ -1,18 +1,22 @@ -test/generated/testproto/grpc/dummy_pb2.pyi:71: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] +test/generated/testproto/grpc/dummy_pb2.pyi:76: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] test/generated/testproto/grpc/dummy_pb2_grpc.pyi:103: error: class testproto.grpc.dummy_pb2_grpc.DeprecatedServiceAsyncStub is deprecated: This service is deprecated [deprecated] -test/generated/testproto/grpc/dummy_pb2_grpc.pyi:104: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] -test/generated/testproto/grpc/dummy_pb2_grpc.pyi:111: error: class testproto.grpc.dummy_pb2_grpc.DeprecatedServiceStub is deprecated: This service is deprecated [deprecated] -test/generated/testproto/grpc/dummy_pb2_grpc.pyi:115: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] -test/generated/testproto/grpc/dummy_pb2_grpc.pyi:115: note: Error code "deprecated" not covered by "type: ignore" comment -test/generated/testproto/grpc/dummy_pb2_grpc.pyi:127: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] -test/generated/testproto/grpc/dummy_pb2_grpc.pyi:141: error: class testproto.grpc.dummy_pb2_grpc.DeprecatedServiceServicer is deprecated: This service is deprecated [deprecated] -test/generated/testproto/test_pb2.pyi:88: error: class testproto.test_pb2.DeprecatedEnum is deprecated: This enum is deprecated +test/generated/testproto/grpc/dummy_pb2_grpc.pyi:106: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] +test/generated/testproto/grpc/dummy_pb2_grpc.pyi:114: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] +test/generated/testproto/grpc/dummy_pb2_grpc.pyi:118: error: class testproto.grpc.dummy_pb2_grpc.DeprecatedServiceStub is deprecated: This service is deprecated [deprecated] +test/generated/testproto/grpc/dummy_pb2_grpc.pyi:124: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] +test/generated/testproto/grpc/dummy_pb2_grpc.pyi:124: note: Error code "deprecated" not covered by "type: ignore" comment +test/generated/testproto/grpc/dummy_pb2_grpc.pyi:132: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] +test/generated/testproto/grpc/dummy_pb2_grpc.pyi:132: note: Error code "deprecated" not covered by "type: ignore" comment +test/generated/testproto/grpc/dummy_pb2_grpc.pyi:141: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] +test/generated/testproto/grpc/dummy_pb2_grpc.pyi:157: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] +test/generated/testproto/grpc/dummy_pb2_grpc.pyi:162: error: class testproto.grpc.dummy_pb2_grpc.DeprecatedServiceServicer is deprecated: This service is deprecated [deprecated] +test/generated/testproto/test_pb2.pyi:96: error: class testproto.test_pb2.DeprecatedEnum is deprecated: This enum is deprecated 2 lines of comments "Quotes in comments" and 'single quotes' Trailing comment [deprecated] -test/generated/testproto/test_pb2.pyi:446: error: class testproto.test_pb2.DeprecatedMessage is deprecated: This message is deprecated [deprecated] -test/generated/testproto/test_pb2.pyi:465: error: class testproto.test_pb2.DeprecatedMessageBadComment is deprecated: This message has been marked as deprecated using proto message options. [deprecated] +test/generated/testproto/test_pb2.pyi:474: error: class testproto.test_pb2.DeprecatedMessage is deprecated: This message is deprecated [deprecated] +test/generated/testproto/test_pb2.pyi:493: error: class testproto.test_pb2.DeprecatedMessageBadComment is deprecated: This message has been marked as deprecated using proto message options. [deprecated] test_negative/negative.py:16: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] test_negative/negative.py:21: error: class testproto.grpc.dummy_pb2_grpc.DeprecatedServiceServicer is deprecated: This service is deprecated [deprecated] test_negative/negative.py:21: error: class testproto.grpc.dummy_pb2_grpc.DeprecatedServiceStub is deprecated: This service is deprecated [deprecated] @@ -23,120 +27,126 @@ test_negative/negative.py:30: error: class testproto.test_pb2.DeprecatedEnum is and 'single quotes' Trailing comment [deprecated] test_negative/negative.py:31: error: class testproto.test_pb2.DeprecatedMessage is deprecated: This message is deprecated [deprecated] -test_negative/negative.py:45: error: "Simple1" has no attribute "SerializeToStringg" [attr-defined] -test_negative/negative.py:48: error: Argument 1 to "ParseFromString" of "Message" has incompatible type "Simple1"; expected "bytes" [arg-type] -test_negative/negative.py:51: error: Argument 1 to "CopyFrom" of "Message" has incompatible type "bytes"; expected "Simple1" [arg-type] -test_negative/negative.py:55: error: Argument 1 to "extend" of "list" has incompatible type "RepeatedScalarFieldContainer[str]"; expected "Iterable[int]" [arg-type] -test_negative/negative.py:57: error: Argument "foo" to "TestMessage" has incompatible type "int"; expected "str" [arg-type] -test_negative/negative.py:60: error: Incompatible types in assignment (expression has type "int", variable has type "ValueType") [assignment] -test_negative/negative.py:63: error: Argument 1 to "HasField" of "Simple1" has incompatible type "Literal['garbage']"; expected "Literal['a_boolean', b'a_boolean', 'a_enum', b'a_enum', 'a_external_enum', b'a_external_enum', 'a_inner', b'a_inner', 'a_nested', b'a_nested', 'a_oneof', b'a_oneof', 'a_oneof_1', b'a_oneof_1', 'a_oneof_2', b'a_oneof_2', 'a_string', b'a_string', 'a_uint32', b'a_uint32', 'email', b'email', 'inner_enum', b'inner_enum', 'inner_enum_in_oneof', b'inner_enum_in_oneof', 'inner_message', b'inner_message', 'nested_enum', b'nested_enum', 'nested_message', b'nested_message', 'no_package', b'no_package', 'outer_enum_in_oneof', b'outer_enum_in_oneof', 'outer_message_in_oneof', b'outer_message_in_oneof', 'user_id', b'user_id']" [arg-type] -test_negative/negative.py:64: error: Argument 1 to "HasField" of "Simple1" has incompatible type "Literal['a_repeated_string']"; expected "Literal['a_boolean', b'a_boolean', 'a_enum', b'a_enum', 'a_external_enum', b'a_external_enum', 'a_inner', b'a_inner', 'a_nested', b'a_nested', 'a_oneof', b'a_oneof', 'a_oneof_1', b'a_oneof_1', 'a_oneof_2', b'a_oneof_2', 'a_string', b'a_string', 'a_uint32', b'a_uint32', 'email', b'email', 'inner_enum', b'inner_enum', 'inner_enum_in_oneof', b'inner_enum_in_oneof', 'inner_message', b'inner_message', 'nested_enum', b'nested_enum', 'nested_message', b'nested_message', 'no_package', b'no_package', 'outer_enum_in_oneof', b'outer_enum_in_oneof', 'outer_message_in_oneof', b'outer_message_in_oneof', 'user_id', b'user_id']" [arg-type] -test_negative/negative.py:68: error: Argument 1 to "HasField" of "SimpleProto3" has incompatible type "Literal['garbage']"; expected "Literal['OuterMessage3', b'OuterMessage3', '_an_optional_string', b'_an_optional_string', 'a_oneof', b'a_oneof', 'a_oneof_1', b'a_oneof_1', 'a_oneof_2', b'a_oneof_2', 'an_optional_string', b'an_optional_string', 'b_oneof', b'b_oneof', 'b_oneof_1', b'b_oneof_1', 'b_oneof_2', b'b_oneof_2', 'bool', b'bool', 'inner_enum_in_oneof', b'inner_enum_in_oneof', 'outer_enum_in_oneof', b'outer_enum_in_oneof', 'outer_message', b'outer_message', 'outer_message_in_oneof', b'outer_message_in_oneof']" [arg-type] -test_negative/negative.py:69: error: Argument 1 to "HasField" of "SimpleProto3" has incompatible type "Literal['a_string']"; expected "Literal['OuterMessage3', b'OuterMessage3', '_an_optional_string', b'_an_optional_string', 'a_oneof', b'a_oneof', 'a_oneof_1', b'a_oneof_1', 'a_oneof_2', b'a_oneof_2', 'an_optional_string', b'an_optional_string', 'b_oneof', b'b_oneof', 'b_oneof_1', b'b_oneof_1', 'b_oneof_2', b'b_oneof_2', 'bool', b'bool', 'inner_enum_in_oneof', b'inner_enum_in_oneof', 'outer_enum_in_oneof', b'outer_enum_in_oneof', 'outer_message', b'outer_message', 'outer_message_in_oneof', b'outer_message_in_oneof']" [arg-type] -test_negative/negative.py:70: error: Argument 1 to "HasField" of "SimpleProto3" has incompatible type "Literal['outer_enum']"; expected "Literal['OuterMessage3', b'OuterMessage3', '_an_optional_string', b'_an_optional_string', 'a_oneof', b'a_oneof', 'a_oneof_1', b'a_oneof_1', 'a_oneof_2', b'a_oneof_2', 'an_optional_string', b'an_optional_string', 'b_oneof', b'b_oneof', 'b_oneof_1', b'b_oneof_1', 'b_oneof_2', b'b_oneof_2', 'bool', b'bool', 'inner_enum_in_oneof', b'inner_enum_in_oneof', 'outer_enum_in_oneof', b'outer_enum_in_oneof', 'outer_message', b'outer_message', 'outer_message_in_oneof', b'outer_message_in_oneof']" [arg-type] -test_negative/negative.py:71: error: Argument 1 to "HasField" of "SimpleProto3" has incompatible type "Literal['a_repeated_string']"; expected "Literal['OuterMessage3', b'OuterMessage3', '_an_optional_string', b'_an_optional_string', 'a_oneof', b'a_oneof', 'a_oneof_1', b'a_oneof_1', 'a_oneof_2', b'a_oneof_2', 'an_optional_string', b'an_optional_string', 'b_oneof', b'b_oneof', 'b_oneof_1', b'b_oneof_1', 'b_oneof_2', b'b_oneof_2', 'bool', b'bool', 'inner_enum_in_oneof', b'inner_enum_in_oneof', 'outer_enum_in_oneof', b'outer_enum_in_oneof', 'outer_message', b'outer_message', 'outer_message_in_oneof', b'outer_message_in_oneof']" [arg-type] -test_negative/negative.py:74: error: Argument 1 to "ClearField" of "Simple1" has incompatible type "Literal['garbage']"; expected "Literal['a_boolean', b'a_boolean', 'a_enum', b'a_enum', 'a_external_enum', b'a_external_enum', 'a_inner', b'a_inner', 'a_nested', b'a_nested', 'a_oneof', b'a_oneof', 'a_oneof_1', b'a_oneof_1', 'a_oneof_2', b'a_oneof_2', 'a_repeated_string', b'a_repeated_string', 'a_string', b'a_string', 'a_uint32', b'a_uint32', 'email', b'email', 'email_by_uid', b'email_by_uid', 'inner_enum', b'inner_enum', 'inner_enum_in_oneof', b'inner_enum_in_oneof', 'inner_message', b'inner_message', 'nested_enum', b'nested_enum', 'nested_message', b'nested_message', 'no_package', b'no_package', 'outer_enum_in_oneof', b'outer_enum_in_oneof', 'outer_message_in_oneof', b'outer_message_in_oneof', 'rep_inner_enum', b'rep_inner_enum', 'rep_inner_message', b'rep_inner_message', 'user_id', b'user_id']" [arg-type] -test_negative/negative.py:77: error: Argument 1 to "ClearField" of "SimpleProto3" has incompatible type "Literal['garbage']"; expected "Literal['OuterEnum', b'OuterEnum', 'OuterMessage3', b'OuterMessage3', '_an_optional_string', b'_an_optional_string', 'a_oneof', b'a_oneof', 'a_oneof_1', b'a_oneof_1', 'a_oneof_2', b'a_oneof_2', 'a_outer_enum', b'a_outer_enum', 'a_repeated_string', b'a_repeated_string', 'a_string', b'a_string', 'an_optional_string', b'an_optional_string', 'b_oneof', b'b_oneof', 'b_oneof_1', b'b_oneof_1', 'b_oneof_2', b'b_oneof_2', 'bool', b'bool', 'email', b'email', 'email_by_uid', b'email_by_uid', 'inner_enum', b'inner_enum', 'inner_enum_in_oneof', b'inner_enum_in_oneof', 'map_message', b'map_message', 'map_scalar', b'map_scalar', 'outer_enum_in_oneof', b'outer_enum_in_oneof', 'outer_message', b'outer_message', 'outer_message_in_oneof', b'outer_message_in_oneof', 'user_id', b'user_id']" [arg-type] -test_negative/negative.py:80: error: Argument 1 to "WhichOneof" of "Simple1" has incompatible type "Literal['garbage']"; expected "Literal['a_oneof', b'a_oneof']" [arg-type] -test_negative/negative.py:82: error: Incompatible types in assignment (expression has type "Literal['a_oneof_1', 'a_oneof_2', 'outer_message_in_oneof', 'outer_enum_in_oneof', 'inner_enum_in_oneof'] | None", variable has type "int") [assignment] -test_negative/negative.py:87: error: Argument 1 to "HasField" of "Simple2" has incompatible type "Literal['a_oneof_1', 'a_oneof_2', 'outer_message_in_oneof', 'outer_enum_in_oneof', 'inner_enum_in_oneof']"; expected "Literal['a_string', b'a_string']" [arg-type] -test_negative/negative.py:91: error: Incompatible types in assignment (expression has type "Literal['a_oneof_1', 'a_oneof_2', 'outer_message_in_oneof', 'outer_enum_in_oneof', 'inner_enum_in_oneof'] | None", variable has type "str") [assignment] -test_negative/negative.py:94: error: No overload variant of "WhichOneof" of "SimpleProto3" matches argument type "str" [call-overload] -test_negative/negative.py:94: note: Possible overload variants: -test_negative/negative.py:94: note: def WhichOneof(self, oneof_group: Literal['_an_optional_string', b'_an_optional_string']) -> Literal['an_optional_string'] | None -test_negative/negative.py:94: note: def WhichOneof(self, oneof_group: Literal['a_oneof', b'a_oneof']) -> Literal['a_oneof_1', 'a_oneof_2', 'outer_message_in_oneof', 'outer_enum_in_oneof', 'inner_enum_in_oneof'] | None -test_negative/negative.py:94: note: def WhichOneof(self, oneof_group: Literal['b_oneof', b'b_oneof']) -> Literal['b_oneof_1', 'b_oneof_2'] | None -test_negative/negative.py:96: error: Incompatible types in assignment (expression has type "Literal['a_oneof_1', 'a_oneof_2', 'outer_message_in_oneof', 'outer_enum_in_oneof', 'inner_enum_in_oneof'] | None", variable has type "int") [assignment] -test_negative/negative.py:100: error: Argument 1 to "HasField" of "Simple2" has incompatible type "Literal['a_oneof_1', 'a_oneof_2', 'outer_message_in_oneof', 'outer_enum_in_oneof', 'inner_enum_in_oneof']"; expected "Literal['a_string', b'a_string']" [arg-type] -test_negative/negative.py:104: error: Incompatible types in assignment (expression has type "_ExtensionFieldDescriptor[Simple1, Extensions1]", variable has type "int") [assignment] -test_negative/negative.py:105: error: "type[Extensions1]" has no attribute "bad" [attr-defined] -test_negative/negative.py:107: error: "Extensions1" has no attribute "foo" [attr-defined] -test_negative/negative.py:108: error: Incompatible types in assignment (expression has type "Extensions2", variable has type "Extensions1") [assignment] -test_negative/negative.py:112: error: Invalid index type "str" for "_ExtensionDict[Simple1]"; expected type "_ExtensionFieldDescriptor[Simple1, Never]" [index] -test_negative/negative.py:113: error: Invalid index type "_ExtensionFieldDescriptor[Simple2, SeparateFileExtension]" for "_ExtensionDict[Simple1]"; expected type "_ExtensionFieldDescriptor[Simple1, SeparateFileExtension]" [index] -test_negative/negative.py:114: error: Unsupported operand types for in ("_ExtensionFieldDescriptor[Simple2, SeparateFileExtension]" and "_ExtensionDict[Simple1]") [operator] -test_negative/negative.py:115: error: Argument 1 to "__delitem__" of "_ExtensionDict" has incompatible type "_ExtensionFieldDescriptor[Simple2, SeparateFileExtension]"; expected "_ExtensionFieldDescriptor[Simple1, SeparateFileExtension]" [arg-type] -test_negative/negative.py:116: error: Argument 1 to "HasExtension" of "Message" has incompatible type "_ExtensionFieldDescriptor[Simple2, SeparateFileExtension]"; expected "_ExtensionFieldDescriptor[Simple1, Any]" [arg-type] -test_negative/negative.py:117: error: Argument 1 to "ClearExtension" of "Message" has incompatible type "_ExtensionFieldDescriptor[Simple1, Extensions1]"; expected "_ExtensionFieldDescriptor[Simple2, Any]" [arg-type] -test_negative/negative.py:121: error: Incompatible types in assignment (expression has type "int", variable has type "_ExtensionFieldDescriptor[Simple1, Any]") [assignment] -test_negative/negative.py:125: error: Incompatible types in assignment (expression has type "Literal['b_oneof_1', 'b_oneof_2'] | None", variable has type "Literal['a_oneof_1', 'a_oneof_2', 'outer_message_in_oneof', 'outer_enum_in_oneof', 'inner_enum_in_oneof'] | None") [assignment] -test_negative/negative.py:128: error: "Descriptor" has no attribute "Garbage" [attr-defined] +test_negative/negative.py:46: error: "Simple1" has no attribute "SerializeToStringg" [attr-defined] +test_negative/negative.py:49: error: Argument 1 to "ParseFromString" of "Message" has incompatible type "Simple1"; expected "bytes" [arg-type] +test_negative/negative.py:52: error: Argument 1 to "CopyFrom" of "Message" has incompatible type "bytes"; expected "Simple1" [arg-type] +test_negative/negative.py:56: error: Argument 1 to "extend" of "list" has incompatible type "RepeatedScalarFieldContainer[str]"; expected "Iterable[int]" [arg-type] +test_negative/negative.py:58: error: Argument "foo" to "TestMessage" has incompatible type "int"; expected "str" [arg-type] +test_negative/negative.py:61: error: Incompatible types in assignment (expression has type "int", variable has type "ValueType") [assignment] +test_negative/negative.py:64: error: Argument 1 to "HasField" of "Simple1" has incompatible type "Literal['garbage']"; expected "Literal['a_boolean', b'a_boolean', 'a_enum', b'a_enum', 'a_external_enum', b'a_external_enum', 'a_inner', b'a_inner', 'a_nested', b'a_nested', 'a_oneof', b'a_oneof', 'a_oneof_1', b'a_oneof_1', 'a_oneof_2', b'a_oneof_2', 'a_string', b'a_string', 'a_uint32', b'a_uint32', 'email', b'email', 'inner_enum', b'inner_enum', 'inner_enum_in_oneof', b'inner_enum_in_oneof', 'inner_message', b'inner_message', 'nested_enum', b'nested_enum', 'nested_message', b'nested_message', 'no_package', b'no_package', 'outer_enum_in_oneof', b'outer_enum_in_oneof', 'outer_message_in_oneof', b'outer_message_in_oneof', 'user_id', b'user_id']" [arg-type] +test_negative/negative.py:65: error: Argument 1 to "HasField" of "Simple1" has incompatible type "Literal['a_repeated_string']"; expected "Literal['a_boolean', b'a_boolean', 'a_enum', b'a_enum', 'a_external_enum', b'a_external_enum', 'a_inner', b'a_inner', 'a_nested', b'a_nested', 'a_oneof', b'a_oneof', 'a_oneof_1', b'a_oneof_1', 'a_oneof_2', b'a_oneof_2', 'a_string', b'a_string', 'a_uint32', b'a_uint32', 'email', b'email', 'inner_enum', b'inner_enum', 'inner_enum_in_oneof', b'inner_enum_in_oneof', 'inner_message', b'inner_message', 'nested_enum', b'nested_enum', 'nested_message', b'nested_message', 'no_package', b'no_package', 'outer_enum_in_oneof', b'outer_enum_in_oneof', 'outer_message_in_oneof', b'outer_message_in_oneof', 'user_id', b'user_id']" [arg-type] +test_negative/negative.py:69: error: Argument 1 to "HasField" of "SimpleProto3" has incompatible type "Literal['garbage']"; expected "Literal['OuterMessage3', b'OuterMessage3', '_an_optional_string', b'_an_optional_string', 'a_oneof', b'a_oneof', 'a_oneof_1', b'a_oneof_1', 'a_oneof_2', b'a_oneof_2', 'an_optional_string', b'an_optional_string', 'b_oneof', b'b_oneof', 'b_oneof_1', b'b_oneof_1', 'b_oneof_2', b'b_oneof_2', 'bool', b'bool', 'inner_enum_in_oneof', b'inner_enum_in_oneof', 'outer_enum_in_oneof', b'outer_enum_in_oneof', 'outer_message', b'outer_message', 'outer_message_in_oneof', b'outer_message_in_oneof']" [arg-type] +test_negative/negative.py:70: error: Argument 1 to "HasField" of "SimpleProto3" has incompatible type "Literal['a_string']"; expected "Literal['OuterMessage3', b'OuterMessage3', '_an_optional_string', b'_an_optional_string', 'a_oneof', b'a_oneof', 'a_oneof_1', b'a_oneof_1', 'a_oneof_2', b'a_oneof_2', 'an_optional_string', b'an_optional_string', 'b_oneof', b'b_oneof', 'b_oneof_1', b'b_oneof_1', 'b_oneof_2', b'b_oneof_2', 'bool', b'bool', 'inner_enum_in_oneof', b'inner_enum_in_oneof', 'outer_enum_in_oneof', b'outer_enum_in_oneof', 'outer_message', b'outer_message', 'outer_message_in_oneof', b'outer_message_in_oneof']" [arg-type] +test_negative/negative.py:71: error: Argument 1 to "HasField" of "SimpleProto3" has incompatible type "Literal['outer_enum']"; expected "Literal['OuterMessage3', b'OuterMessage3', '_an_optional_string', b'_an_optional_string', 'a_oneof', b'a_oneof', 'a_oneof_1', b'a_oneof_1', 'a_oneof_2', b'a_oneof_2', 'an_optional_string', b'an_optional_string', 'b_oneof', b'b_oneof', 'b_oneof_1', b'b_oneof_1', 'b_oneof_2', b'b_oneof_2', 'bool', b'bool', 'inner_enum_in_oneof', b'inner_enum_in_oneof', 'outer_enum_in_oneof', b'outer_enum_in_oneof', 'outer_message', b'outer_message', 'outer_message_in_oneof', b'outer_message_in_oneof']" [arg-type] +test_negative/negative.py:72: error: Argument 1 to "HasField" of "SimpleProto3" has incompatible type "Literal['a_repeated_string']"; expected "Literal['OuterMessage3', b'OuterMessage3', '_an_optional_string', b'_an_optional_string', 'a_oneof', b'a_oneof', 'a_oneof_1', b'a_oneof_1', 'a_oneof_2', b'a_oneof_2', 'an_optional_string', b'an_optional_string', 'b_oneof', b'b_oneof', 'b_oneof_1', b'b_oneof_1', 'b_oneof_2', b'b_oneof_2', 'bool', b'bool', 'inner_enum_in_oneof', b'inner_enum_in_oneof', 'outer_enum_in_oneof', b'outer_enum_in_oneof', 'outer_message', b'outer_message', 'outer_message_in_oneof', b'outer_message_in_oneof']" [arg-type] +test_negative/negative.py:75: error: Argument 1 to "ClearField" of "Simple1" has incompatible type "Literal['garbage']"; expected "Literal['a_boolean', b'a_boolean', 'a_enum', b'a_enum', 'a_external_enum', b'a_external_enum', 'a_inner', b'a_inner', 'a_nested', b'a_nested', 'a_oneof', b'a_oneof', 'a_oneof_1', b'a_oneof_1', 'a_oneof_2', b'a_oneof_2', 'a_repeated_string', b'a_repeated_string', 'a_string', b'a_string', 'a_uint32', b'a_uint32', 'email', b'email', 'email_by_uid', b'email_by_uid', 'inner_enum', b'inner_enum', 'inner_enum_in_oneof', b'inner_enum_in_oneof', 'inner_message', b'inner_message', 'nested_enum', b'nested_enum', 'nested_message', b'nested_message', 'no_package', b'no_package', 'outer_enum_in_oneof', b'outer_enum_in_oneof', 'outer_message_in_oneof', b'outer_message_in_oneof', 'rep_inner_enum', b'rep_inner_enum', 'rep_inner_message', b'rep_inner_message', 'user_id', b'user_id']" [arg-type] +test_negative/negative.py:78: error: Argument 1 to "ClearField" of "SimpleProto3" has incompatible type "Literal['garbage']"; expected "Literal['OuterEnum', b'OuterEnum', 'OuterMessage3', b'OuterMessage3', '_an_optional_string', b'_an_optional_string', 'a_oneof', b'a_oneof', 'a_oneof_1', b'a_oneof_1', 'a_oneof_2', b'a_oneof_2', 'a_outer_enum', b'a_outer_enum', 'a_repeated_string', b'a_repeated_string', 'a_string', b'a_string', 'an_optional_string', b'an_optional_string', 'b_oneof', b'b_oneof', 'b_oneof_1', b'b_oneof_1', 'b_oneof_2', b'b_oneof_2', 'bool', b'bool', 'email', b'email', 'email_by_uid', b'email_by_uid', 'inner_enum', b'inner_enum', 'inner_enum_in_oneof', b'inner_enum_in_oneof', 'map_message', b'map_message', 'map_scalar', b'map_scalar', 'outer_enum_in_oneof', b'outer_enum_in_oneof', 'outer_message', b'outer_message', 'outer_message_in_oneof', b'outer_message_in_oneof', 'user_id', b'user_id']" [arg-type] +test_negative/negative.py:81: error: Argument 1 to "WhichOneof" of "Simple1" has incompatible type "Literal['garbage']"; expected "Literal['a_oneof', b'a_oneof']" [arg-type] +test_negative/negative.py:83: error: Incompatible types in assignment (expression has type "Literal['a_oneof_1', 'a_oneof_2', 'outer_message_in_oneof', 'outer_enum_in_oneof', 'inner_enum_in_oneof'] | None", variable has type "int") [assignment] +test_negative/negative.py:88: error: Argument 1 to "HasField" of "Simple2" has incompatible type "Literal['a_oneof_1', 'a_oneof_2', 'outer_message_in_oneof', 'outer_enum_in_oneof', 'inner_enum_in_oneof']"; expected "Literal['a_string', b'a_string']" [arg-type] +test_negative/negative.py:92: error: Incompatible types in assignment (expression has type "Literal['a_oneof_1', 'a_oneof_2', 'outer_message_in_oneof', 'outer_enum_in_oneof', 'inner_enum_in_oneof'] | None", variable has type "str") [assignment] +test_negative/negative.py:95: error: No overload variant of "WhichOneof" of "SimpleProto3" matches argument type "str" [call-overload] +test_negative/negative.py:95: note: Possible overload variants: +test_negative/negative.py:95: note: def WhichOneof(self, oneof_group: Literal['_an_optional_string', b'_an_optional_string']) -> Literal['an_optional_string'] | None +test_negative/negative.py:95: note: def WhichOneof(self, oneof_group: Literal['a_oneof', b'a_oneof']) -> Literal['a_oneof_1', 'a_oneof_2', 'outer_message_in_oneof', 'outer_enum_in_oneof', 'inner_enum_in_oneof'] | None +test_negative/negative.py:95: note: def WhichOneof(self, oneof_group: Literal['b_oneof', b'b_oneof']) -> Literal['b_oneof_1', 'b_oneof_2'] | None +test_negative/negative.py:97: error: Incompatible types in assignment (expression has type "Literal['a_oneof_1', 'a_oneof_2', 'outer_message_in_oneof', 'outer_enum_in_oneof', 'inner_enum_in_oneof'] | None", variable has type "int") [assignment] +test_negative/negative.py:101: error: Argument 1 to "HasField" of "Simple2" has incompatible type "Literal['a_oneof_1', 'a_oneof_2', 'outer_message_in_oneof', 'outer_enum_in_oneof', 'inner_enum_in_oneof']"; expected "Literal['a_string', b'a_string']" [arg-type] +test_negative/negative.py:105: error: Incompatible types in assignment (expression has type "_ExtensionFieldDescriptor[Simple1, Extensions1]", variable has type "int") [assignment] +test_negative/negative.py:106: error: "type[Extensions1]" has no attribute "bad" [attr-defined] +test_negative/negative.py:108: error: "Extensions1" has no attribute "foo" [attr-defined] +test_negative/negative.py:109: error: Incompatible types in assignment (expression has type "Extensions2", variable has type "Extensions1") [assignment] +test_negative/negative.py:113: error: Invalid index type "str" for "_ExtensionDict[Simple1]"; expected type "_ExtensionFieldDescriptor[Simple1, Never]" [index] +test_negative/negative.py:114: error: Invalid index type "_ExtensionFieldDescriptor[Simple2, SeparateFileExtension]" for "_ExtensionDict[Simple1]"; expected type "_ExtensionFieldDescriptor[Simple1, SeparateFileExtension]" [index] +test_negative/negative.py:115: error: Unsupported operand types for in ("_ExtensionFieldDescriptor[Simple2, SeparateFileExtension]" and "_ExtensionDict[Simple1]") [operator] +test_negative/negative.py:116: error: Argument 1 to "__delitem__" of "_ExtensionDict" has incompatible type "_ExtensionFieldDescriptor[Simple2, SeparateFileExtension]"; expected "_ExtensionFieldDescriptor[Simple1, SeparateFileExtension]" [arg-type] +test_negative/negative.py:117: error: Argument 1 to "HasExtension" of "Message" has incompatible type "_ExtensionFieldDescriptor[Simple2, SeparateFileExtension]"; expected "_ExtensionFieldDescriptor[Simple1, Any]" [arg-type] +test_negative/negative.py:118: error: Argument 1 to "ClearExtension" of "Message" has incompatible type "_ExtensionFieldDescriptor[Simple1, Extensions1]"; expected "_ExtensionFieldDescriptor[Simple2, Any]" [arg-type] +test_negative/negative.py:122: error: Incompatible types in assignment (expression has type "int", variable has type "_ExtensionFieldDescriptor[Simple1, Any]") [assignment] +test_negative/negative.py:126: error: Incompatible types in assignment (expression has type "Literal['b_oneof_1', 'b_oneof_2'] | None", variable has type "Literal['a_oneof_1', 'a_oneof_2', 'outer_message_in_oneof', 'outer_enum_in_oneof', 'inner_enum_in_oneof'] | None") [assignment] test_negative/negative.py:129: error: "Descriptor" has no attribute "Garbage" [attr-defined] -test_negative/negative.py:132: error: "EnumDescriptor" has no attribute "Garbage" [attr-defined] -test_negative/negative.py:135: error: "FileDescriptor" has no attribute "Garbage" [attr-defined] -test_negative/negative.py:142: error: "ValueType" has no attribute "FOO" [attr-defined] -test_negative/negative.py:146: error: Argument 1 to "Name" of "_EnumTypeWrapper" has incompatible type "int"; expected "ValueType" [arg-type] -test_negative/negative.py:148: error: Argument 1 to "Name" of "_EnumTypeWrapper" has incompatible type "testproto.test3_pb2.SimpleProto3._InnerEnum.ValueType"; expected "testproto.test3_pb2._OuterEnum.ValueType" [arg-type] -test_negative/negative.py:150: error: Argument 1 to "Name" of "_EnumTypeWrapper" has incompatible type "testproto.test3_pb2.SimpleProto3._InnerEnum.ValueType"; expected "testproto.test3_pb2._OuterEnum.ValueType" [arg-type] -test_negative/negative.py:152: error: Argument 1 to "Name" of "_EnumTypeWrapper" has incompatible type "testproto.test3_pb2.SimpleProto3._InnerEnum.ValueType"; expected "testproto.test3_pb2._OuterEnum.ValueType" [arg-type] -test_negative/negative.py:156: error: "ScalarMap[int, str]" has no attribute "get_or_create" [attr-defined] -test_negative/negative.py:158: error: No overload variant of "get" of "ScalarMap" matches argument type "str" [call-overload] -test_negative/negative.py:158: note: Possible overload variants: -test_negative/negative.py:158: note: def get(self, key: int, default: None = ...) -> str | None -test_negative/negative.py:158: note: def get(self, key: int, default: str) -> str -test_negative/negative.py:158: note: def [_T] get(self, key: int, default: _T) -> str | _T -test_negative/negative.py:159: error: No overload variant of "get" of "MessageMap" matches argument type "str" [call-overload] +test_negative/negative.py:130: error: "Descriptor" has no attribute "Garbage" [attr-defined] +test_negative/negative.py:133: error: "EnumDescriptor" has no attribute "Garbage" [attr-defined] +test_negative/negative.py:136: error: "FileDescriptor" has no attribute "Garbage" [attr-defined] +test_negative/negative.py:143: error: "ValueType" has no attribute "FOO" [attr-defined] +test_negative/negative.py:147: error: Argument 1 to "Name" of "_EnumTypeWrapper" has incompatible type "int"; expected "ValueType" [arg-type] +test_negative/negative.py:149: error: Argument 1 to "Name" of "_EnumTypeWrapper" has incompatible type "testproto.test3_pb2.SimpleProto3._InnerEnum.ValueType"; expected "testproto.test3_pb2._OuterEnum.ValueType" [arg-type] +test_negative/negative.py:151: error: Argument 1 to "Name" of "_EnumTypeWrapper" has incompatible type "testproto.test3_pb2.SimpleProto3._InnerEnum.ValueType"; expected "testproto.test3_pb2._OuterEnum.ValueType" [arg-type] +test_negative/negative.py:153: error: Argument 1 to "Name" of "_EnumTypeWrapper" has incompatible type "testproto.test3_pb2.SimpleProto3._InnerEnum.ValueType"; expected "testproto.test3_pb2._OuterEnum.ValueType" [arg-type] +test_negative/negative.py:157: error: "ScalarMap[int, str]" has no attribute "get_or_create" [attr-defined] +test_negative/negative.py:159: error: No overload variant of "get" of "ScalarMap" matches argument type "str" [call-overload] test_negative/negative.py:159: note: Possible overload variants: -test_negative/negative.py:159: note: def get(self, key: int, default: None = ...) -> OuterMessage3 | None -test_negative/negative.py:159: note: def get(self, key: int, default: OuterMessage3) -> OuterMessage3 -test_negative/negative.py:159: note: def [_T] get(self, key: int, default: _T) -> OuterMessage3 | _T -test_negative/negative.py:162: error: Incompatible types in assignment (expression has type "str | None", variable has type "int") [assignment] -test_negative/negative.py:163: error: Incompatible types in assignment (expression has type "OuterMessage3 | None", variable has type "int") [assignment] -test_negative/negative.py:165: error: Dict entry 0 has incompatible type "str": "int"; expected "int": "str" [dict-item] -test_negative/negative.py:165: error: Dict entry 0 has incompatible type "str": "str"; expected "int": "OuterMessage3" [dict-item] -test_negative/negative.py:169: error: Incompatible types in assignment (expression has type "int", variable has type "UserId") [assignment] -test_negative/negative.py:170: error: Incompatible types in assignment (expression has type "str", variable has type "Email") [assignment] -test_negative/negative.py:171: error: Invalid index type "int" for "ScalarMap[UserId, Email]"; expected type "UserId" [index] -test_negative/negative.py:171: error: Incompatible types in assignment (expression has type "str", target has type "Email") [assignment] +test_negative/negative.py:159: note: def get(self, key: int, default: None = ...) -> str | None +test_negative/negative.py:159: note: def get(self, key: int, default: str) -> str +test_negative/negative.py:159: note: def [_T] get(self, key: int, default: _T) -> str | _T +test_negative/negative.py:160: error: No overload variant of "get" of "MessageMap" matches argument type "str" [call-overload] +test_negative/negative.py:160: note: Possible overload variants: +test_negative/negative.py:160: note: def get(self, key: int, default: None = ...) -> OuterMessage3 | None +test_negative/negative.py:160: note: def get(self, key: int, default: OuterMessage3) -> OuterMessage3 +test_negative/negative.py:160: note: def [_T] get(self, key: int, default: _T) -> OuterMessage3 | _T +test_negative/negative.py:163: error: Incompatible types in assignment (expression has type "str | None", variable has type "int") [assignment] +test_negative/negative.py:164: error: Incompatible types in assignment (expression has type "OuterMessage3 | None", variable has type "int") [assignment] +test_negative/negative.py:166: error: Dict entry 0 has incompatible type "str": "int"; expected "int": "str" [dict-item] +test_negative/negative.py:166: error: Dict entry 0 has incompatible type "str": "str"; expected "int": "OuterMessage3" [dict-item] +test_negative/negative.py:170: error: Incompatible types in assignment (expression has type "int", variable has type "UserId") [assignment] +test_negative/negative.py:171: error: Incompatible types in assignment (expression has type "str", variable has type "Email") [assignment] +test_negative/negative.py:172: error: Invalid index type "int" for "ScalarMap[UserId, Email]"; expected type "UserId" [index] test_negative/negative.py:172: error: Incompatible types in assignment (expression has type "str", target has type "Email") [assignment] -test_negative/negative.py:173: error: Invalid index type "int" for "ScalarMap[UserId, Email]"; expected type "UserId" [index] -test_negative/negative.py:175: error: Argument "user_id" to "Simple1" has incompatible type "int"; expected "UserId | None" [arg-type] -test_negative/negative.py:176: error: Argument "email" to "Simple1" has incompatible type "str"; expected "Email | None" [arg-type] -test_negative/negative.py:177: error: Dict entry 0 has incompatible type "int": "str"; expected "UserId": "Email" [dict-item] -test_negative/negative.py:181: error: Module "testproto.reexport_pb2" has no attribute "Inner" [attr-defined] -test_negative/negative.py:185: error: Argument "a_string" to "OuterMessage3" has incompatible type "None"; expected "str" [arg-type] -test_negative/negative.py:190: error: Property "a_repeated_string" defined in "Simple1" is read-only [misc] -test_negative/negative.py:191: error: Property "rep_inner_enum" defined in "Simple1" is read-only [misc] -test_negative/negative.py:196: error: "_r_None" has no attribute "invalid"; maybe "valid"? [attr-defined] -test_negative/negative.py:200: error: Incompatible types in assignment (expression has type "ValueType", variable has type "str") [assignment] -test_negative/negative.py:204: error: All overload variants of "DummyServiceStub" require at least one argument [call-overload] -test_negative/negative.py:204: note: Possible overload variants: -test_negative/negative.py:204: note: def __new__(cls, channel: Channel) -> DummyServiceStub -test_negative/negative.py:204: note: def __new__(cls, channel: Channel) -> DummyServiceAsyncStub -test_negative/negative.py:211: error: "DummyReply" has no attribute "not_exists" [attr-defined] -test_negative/negative.py:212: error: "DummyReply" has no attribute "__iter__" (not iterable) [attr-defined] -test_negative/negative.py:217: error: "DummyReply" has no attribute "not_exists" [attr-defined] -test_negative/negative.py:219: error: "_CallIterator[DummyReply]" has no attribute "value" [attr-defined] -test_negative/negative.py:226: error: Argument 1 to "__call__" of "StreamUnaryMultiCallable" has incompatible type "DummyRequest"; expected "Iterator[DummyRequest]" [arg-type] -test_negative/negative.py:228: error: "DummyReply" has no attribute "__iter__" (not iterable) [attr-defined] -test_negative/negative.py:228: error: Argument 1 to "__call__" of "StreamUnaryMultiCallable" has incompatible type "DummyRequest"; expected "Iterator[DummyRequest]" [arg-type] -test_negative/negative.py:231: error: Argument 1 to "__call__" of "StreamStreamMultiCallable" has incompatible type "DummyRequest"; expected "Iterator[DummyRequest]" [arg-type] -test_negative/negative.py:235: error: "DummyReply" has no attribute "not_exists" [attr-defined] -test_negative/negative.py:272: error: Return type "Iterator[DummyReply]" of "UnaryUnary" incompatible with return type "DummyReply | Awaitable[DummyReply]" in supertype "testproto.grpc.dummy_pb2_grpc.DummyServiceServicer" [override] -test_negative/negative.py:274: error: Argument 1 of "UnaryUnary" is incompatible with supertype "testproto.grpc.dummy_pb2_grpc.DummyServiceServicer"; supertype defines the argument type as "DummyRequest" [override] -test_negative/negative.py:274: note: This violates the Liskov substitution principle -test_negative/negative.py:274: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#incompatible-overrides -test_negative/negative.py:280: error: Return type "DummyReply" of "UnaryStream" incompatible with return type "Iterator[DummyReply] | AsyncIterator[DummyReply]" in supertype "testproto.grpc.dummy_pb2_grpc.DummyServiceServicer" [override] -test_negative/negative.py:282: error: Argument 1 of "UnaryStream" is incompatible with supertype "testproto.grpc.dummy_pb2_grpc.DummyServiceServicer"; supertype defines the argument type as "DummyRequest" [override] -test_negative/negative.py:282: note: This violates the Liskov substitution principle -test_negative/negative.py:282: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#incompatible-overrides -test_negative/negative.py:289: error: Return type "Iterator[DummyReply]" of "StreamUnary" incompatible with return type "DummyReply | Awaitable[DummyReply]" in supertype "testproto.grpc.dummy_pb2_grpc.DummyServiceServicer" [override] -test_negative/negative.py:291: error: Argument 1 of "StreamUnary" is incompatible with supertype "testproto.grpc.dummy_pb2_grpc.DummyServiceServicer"; supertype defines the argument type as "_MaybeAsyncIterator[DummyRequest]" [override] -test_negative/negative.py:291: note: This violates the Liskov substitution principle -test_negative/negative.py:291: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#incompatible-overrides -test_negative/negative.py:320: error: class testproto.grpc.dummy_pb2_grpc.DeprecatedServiceAsyncStub is deprecated: This service is deprecated [deprecated] -test_negative/negative.py:332: error: Argument "implicit_singular" to "Editions2024Test" has incompatible type "None"; expected "str" [arg-type] -test_negative/negative.py:334: error: Argument 1 to "HasField" of "Editions2024Test" has incompatible type "Literal['implicit_singular']"; expected "Literal['default_singular', b'default_singular', 'explicit_singular', b'explicit_singular', 'legacy', b'legacy', 'message_field', b'message_field']" [arg-type] -test_negative/negative.py:345: error: Cannot instantiate abstract class "IncompleteServicer" with abstract attributes "StreamStream", "StreamUnary", "UnaryStream" and "UnaryUnary" [abstract] -test_negative/negative.py:352: error: Argument 2 to "test_hasfield_alias" has incompatible type "Literal['not_a_field']"; expected "Literal['default_singular', b'default_singular', 'explicit_singular', b'explicit_singular', 'legacy', b'legacy', 'message_field', b'message_field']" [arg-type] -test_negative/negative.py:359: error: Argument 2 to "test_clearfield_alias" has incompatible type "Literal['not_a_field']"; expected "Literal['default_singular', b'default_singular', 'explicit_singular', b'explicit_singular', 'implicit_singular', b'implicit_singular', 'legacy', b'legacy', 'message_field', b'message_field']" [arg-type] -test_negative/negative.py:369: error: Argument 2 to "test_whichoneof_alias" has incompatible type "Literal['not_a_oneof']"; expected "Literal['a_oneof', b'a_oneof']" [arg-type] -test_negative/negative.py:372: error: All overload variants of "DummyServiceStub" require at least one argument [call-overload] -test_negative/negative.py:372: note: Possible overload variants: -test_negative/negative.py:372: note: def __new__(cls, channel: Channel) -> DummyServiceStub -test_negative/negative.py:372: note: def __new__(cls, channel: Channel) -> DummyServiceAsyncStub -test_negative/negative.py:373: error: No overload variant of "DummyServiceStub" matches argument type "str" [call-overload] -test_negative/negative.py:373: note: Possible overload variants: -test_negative/negative.py:373: note: def __new__(cls, channel: Channel) -> DummyServiceStub -test_negative/negative.py:373: note: def __new__(cls, channel: Channel) -> DummyServiceAsyncStub -Found 105 errors in 4 files (checked 4 source files) +test_negative/negative.py:173: error: Incompatible types in assignment (expression has type "str", target has type "Email") [assignment] +test_negative/negative.py:174: error: Invalid index type "int" for "ScalarMap[UserId, Email]"; expected type "UserId" [index] +test_negative/negative.py:176: error: Argument "user_id" to "Simple1" has incompatible type "int"; expected "UserId | None" [arg-type] +test_negative/negative.py:177: error: Argument "email" to "Simple1" has incompatible type "str"; expected "Email | None" [arg-type] +test_negative/negative.py:178: error: Dict entry 0 has incompatible type "int": "str"; expected "UserId": "Email" [dict-item] +test_negative/negative.py:182: error: Module "testproto.reexport_pb2" has no attribute "Inner" [attr-defined] +test_negative/negative.py:186: error: Argument "a_string" to "OuterMessage3" has incompatible type "None"; expected "str" [arg-type] +test_negative/negative.py:191: error: Property "a_repeated_string" defined in "Simple1" is read-only [misc] +test_negative/negative.py:192: error: Property "rep_inner_enum" defined in "Simple1" is read-only [misc] +test_negative/negative.py:197: error: "_r_None" has no attribute "invalid"; maybe "valid"? [attr-defined] +test_negative/negative.py:201: error: Incompatible types in assignment (expression has type "ValueType", variable has type "str") [assignment] +test_negative/negative.py:205: error: function testproto.test_pb2.DeprecatedMessage.deprecated_field is deprecated: This field has been marked as deprecated using proto field options. [deprecated] +test_negative/negative.py:207: error: All overload variants of "DummyServiceStub" require at least one argument [call-overload] +test_negative/negative.py:207: note: Possible overload variants: +test_negative/negative.py:207: note: def __new__(cls, channel: Channel) -> DummyServiceStub +test_negative/negative.py:207: note: def __new__(cls, channel: Channel) -> DummyServiceAsyncStub +test_negative/negative.py:214: error: "DummyReply" has no attribute "not_exists" [attr-defined] +test_negative/negative.py:215: error: "DummyReply" has no attribute "__iter__" (not iterable) [attr-defined] +test_negative/negative.py:220: error: "DummyReply" has no attribute "not_exists" [attr-defined] +test_negative/negative.py:222: error: "_CallIterator[DummyReply]" has no attribute "value" [attr-defined] +test_negative/negative.py:229: error: Argument 1 to "__call__" of "StreamUnaryMultiCallable" has incompatible type "DummyRequest"; expected "Iterator[DummyRequest]" [arg-type] +test_negative/negative.py:231: error: "DummyReply" has no attribute "__iter__" (not iterable) [attr-defined] +test_negative/negative.py:231: error: Argument 1 to "__call__" of "StreamUnaryMultiCallable" has incompatible type "DummyRequest"; expected "Iterator[DummyRequest]" [arg-type] +test_negative/negative.py:234: error: Argument 1 to "__call__" of "StreamStreamMultiCallable" has incompatible type "DummyRequest"; expected "Iterator[DummyRequest]" [arg-type] +test_negative/negative.py:238: error: "DummyReply" has no attribute "not_exists" [attr-defined] +test_negative/negative.py:275: error: Return type "Iterator[DummyReply]" of "UnaryUnary" incompatible with return type "DummyReply | Awaitable[DummyReply]" in supertype "testproto.grpc.dummy_pb2_grpc.DummyServiceServicer" [override] +test_negative/negative.py:277: error: Argument 1 of "UnaryUnary" is incompatible with supertype "testproto.grpc.dummy_pb2_grpc.DummyServiceServicer"; supertype defines the argument type as "DummyRequest" [override] +test_negative/negative.py:277: note: This violates the Liskov substitution principle +test_negative/negative.py:277: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#incompatible-overrides +test_negative/negative.py:283: error: Return type "DummyReply" of "UnaryStream" incompatible with return type "Iterator[DummyReply] | AsyncIterator[DummyReply]" in supertype "testproto.grpc.dummy_pb2_grpc.DummyServiceServicer" [override] +test_negative/negative.py:285: error: Argument 1 of "UnaryStream" is incompatible with supertype "testproto.grpc.dummy_pb2_grpc.DummyServiceServicer"; supertype defines the argument type as "DummyRequest" [override] +test_negative/negative.py:285: note: This violates the Liskov substitution principle +test_negative/negative.py:285: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#incompatible-overrides +test_negative/negative.py:292: error: Return type "Iterator[DummyReply]" of "StreamUnary" incompatible with return type "DummyReply | Awaitable[DummyReply]" in supertype "testproto.grpc.dummy_pb2_grpc.DummyServiceServicer" [override] +test_negative/negative.py:294: error: Argument 1 of "StreamUnary" is incompatible with supertype "testproto.grpc.dummy_pb2_grpc.DummyServiceServicer"; supertype defines the argument type as "_MaybeAsyncIterator[DummyRequest]" [override] +test_negative/negative.py:294: note: This violates the Liskov substitution principle +test_negative/negative.py:294: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#incompatible-overrides +test_negative/negative.py:328: error: function testproto.grpc.dummy_pb2_grpc.DeprecatedServiceStub.DeprecatedMethod is deprecated: This method has been marked as deprecated using proto method options. [deprecated] +test_negative/negative.py:329: error: function testproto.grpc.dummy_pb2_grpc.DeprecatedServiceStub.DeprecatedMethodNotDeprecatedRequest is deprecated: Method is deprecated, but request message is not [deprecated] +test_negative/negative.py:330: error: class testproto.grpc.dummy_pb2_grpc.DeprecatedServiceAsyncStub is deprecated: This service is deprecated [deprecated] +test_negative/negative.py:333: error: function testproto.test_pb2._DeprecatedEnumEnumTypeWrapper.DEPRECATED_ONE is deprecated: This enum value has been marked as deprecated using proto enum value options. [deprecated] +test_negative/negative.py:334: error: function testproto.test_pb2._DeprecatedEnumEnumTypeWrapper.DEPRECATED_TWO is deprecated: This enum value has been marked as deprecated using proto enum value options. [deprecated] +test_negative/negative.py:344: error: Argument "implicit_singular" to "Editions2024Test" has incompatible type "None"; expected "str" [arg-type] +test_negative/negative.py:346: error: Argument 1 to "HasField" of "Editions2024Test" has incompatible type "Literal['implicit_singular']"; expected "Literal['default_singular', b'default_singular', 'explicit_singular', b'explicit_singular', 'legacy', b'legacy', 'message_field', b'message_field']" [arg-type] +test_negative/negative.py:357: error: Cannot instantiate abstract class "IncompleteServicer" with abstract attributes "StreamStream", "StreamUnary", "UnaryStream" and "UnaryUnary" [abstract] +test_negative/negative.py:364: error: Argument 2 to "test_hasfield_alias" has incompatible type "Literal['not_a_field']"; expected "Literal['default_singular', b'default_singular', 'explicit_singular', b'explicit_singular', 'legacy', b'legacy', 'message_field', b'message_field']" [arg-type] +test_negative/negative.py:371: error: Argument 2 to "test_clearfield_alias" has incompatible type "Literal['not_a_field']"; expected "Literal['default_singular', b'default_singular', 'explicit_singular', b'explicit_singular', 'implicit_singular', b'implicit_singular', 'legacy', b'legacy', 'message_field', b'message_field']" [arg-type] +test_negative/negative.py:372: error: Property "message_field" defined in "Editions2024Test" is read-only [misc] +test_negative/negative.py:383: error: Argument 2 to "test_whichoneof_alias" has incompatible type "Literal['not_a_oneof']"; expected "Literal['a_oneof', b'a_oneof']" [arg-type] +test_negative/negative.py:386: error: All overload variants of "DummyServiceStub" require at least one argument [call-overload] +test_negative/negative.py:386: note: Possible overload variants: +test_negative/negative.py:386: note: def __new__(cls, channel: Channel) -> DummyServiceStub +test_negative/negative.py:386: note: def __new__(cls, channel: Channel) -> DummyServiceAsyncStub +test_negative/negative.py:387: error: No overload variant of "DummyServiceStub" matches argument type "str" [call-overload] +test_negative/negative.py:387: note: Possible overload variants: +test_negative/negative.py:387: note: def __new__(cls, channel: Channel) -> DummyServiceStub +test_negative/negative.py:387: note: def __new__(cls, channel: Channel) -> DummyServiceAsyncStub +Found 114 errors in 4 files (checked 4 source files) diff --git a/test_negative/output.expected.3.14.omit_linenos b/test_negative/output.expected.3.14.omit_linenos index b32a0a1e..abe41b67 100644 --- a/test_negative/output.expected.3.14.omit_linenos +++ b/test_negative/output.expected.3.14.omit_linenos @@ -1,10 +1,14 @@ test/generated/testproto/grpc/dummy_pb2.pyi: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] test/generated/testproto/grpc/dummy_pb2_grpc.pyi: error: class testproto.grpc.dummy_pb2_grpc.DeprecatedServiceAsyncStub is deprecated: This service is deprecated [deprecated] test/generated/testproto/grpc/dummy_pb2_grpc.pyi: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] +test/generated/testproto/grpc/dummy_pb2_grpc.pyi: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] test/generated/testproto/grpc/dummy_pb2_grpc.pyi: error: class testproto.grpc.dummy_pb2_grpc.DeprecatedServiceStub is deprecated: This service is deprecated [deprecated] test/generated/testproto/grpc/dummy_pb2_grpc.pyi: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] test/generated/testproto/grpc/dummy_pb2_grpc.pyi: note: Error code "deprecated" not covered by "type: ignore" comment test/generated/testproto/grpc/dummy_pb2_grpc.pyi: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] +test/generated/testproto/grpc/dummy_pb2_grpc.pyi: note: Error code "deprecated" not covered by "type: ignore" comment +test/generated/testproto/grpc/dummy_pb2_grpc.pyi: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] +test/generated/testproto/grpc/dummy_pb2_grpc.pyi: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] test/generated/testproto/grpc/dummy_pb2_grpc.pyi: error: class testproto.grpc.dummy_pb2_grpc.DeprecatedServiceServicer is deprecated: This service is deprecated [deprecated] test/generated/testproto/test_pb2.pyi: error: class testproto.test_pb2.DeprecatedEnum is deprecated: This enum is deprecated 2 lines of comments @@ -99,6 +103,7 @@ test_negative/negative.py: error: Property "a_repeated_string" defined in "Simpl test_negative/negative.py: error: Property "rep_inner_enum" defined in "Simple1" is read-only [misc] test_negative/negative.py: error: "_r_None" has no attribute "invalid"; maybe "valid"? [attr-defined] test_negative/negative.py: error: Incompatible types in assignment (expression has type "ValueType", variable has type "str") [assignment] +test_negative/negative.py: error: function testproto.test_pb2.DeprecatedMessage.deprecated_field is deprecated: This field has been marked as deprecated using proto field options. [deprecated] test_negative/negative.py: error: All overload variants of "DummyServiceStub" require at least one argument [call-overload] test_negative/negative.py: note: Possible overload variants: test_negative/negative.py: note: def __new__(cls, channel: Channel) -> DummyServiceStub @@ -124,12 +129,17 @@ test_negative/negative.py: error: Return type "Iterator[DummyReply]" of "StreamU test_negative/negative.py: error: Argument 1 of "StreamUnary" is incompatible with supertype "testproto.grpc.dummy_pb2_grpc.DummyServiceServicer"; supertype defines the argument type as "_MaybeAsyncIterator[DummyRequest]" [override] test_negative/negative.py: note: This violates the Liskov substitution principle test_negative/negative.py: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#incompatible-overrides +test_negative/negative.py: error: function testproto.grpc.dummy_pb2_grpc.DeprecatedServiceStub.DeprecatedMethod is deprecated: This method has been marked as deprecated using proto method options. [deprecated] +test_negative/negative.py: error: function testproto.grpc.dummy_pb2_grpc.DeprecatedServiceStub.DeprecatedMethodNotDeprecatedRequest is deprecated: Method is deprecated, but request message is not [deprecated] test_negative/negative.py: error: class testproto.grpc.dummy_pb2_grpc.DeprecatedServiceAsyncStub is deprecated: This service is deprecated [deprecated] +test_negative/negative.py: error: function testproto.test_pb2._DeprecatedEnumEnumTypeWrapper.DEPRECATED_ONE is deprecated: This enum value has been marked as deprecated using proto enum value options. [deprecated] +test_negative/negative.py: error: function testproto.test_pb2._DeprecatedEnumEnumTypeWrapper.DEPRECATED_TWO is deprecated: This enum value has been marked as deprecated using proto enum value options. [deprecated] test_negative/negative.py: error: Argument "implicit_singular" to "Editions2024Test" has incompatible type "None"; expected "str" [arg-type] test_negative/negative.py: error: Argument 1 to "HasField" of "Editions2024Test" has incompatible type "Literal['implicit_singular']"; expected "Literal['default_singular', b'default_singular', 'explicit_singular', b'explicit_singular', 'legacy', b'legacy', 'message_field', b'message_field']" [arg-type] test_negative/negative.py: error: Cannot instantiate abstract class "IncompleteServicer" with abstract attributes "StreamStream", "StreamUnary", "UnaryStream" and "UnaryUnary" [abstract] test_negative/negative.py: error: Argument 2 to "test_hasfield_alias" has incompatible type "Literal['not_a_field']"; expected "Literal['default_singular', b'default_singular', 'explicit_singular', b'explicit_singular', 'legacy', b'legacy', 'message_field', b'message_field']" [arg-type] test_negative/negative.py: error: Argument 2 to "test_clearfield_alias" has incompatible type "Literal['not_a_field']"; expected "Literal['default_singular', b'default_singular', 'explicit_singular', b'explicit_singular', 'implicit_singular', b'implicit_singular', 'legacy', b'legacy', 'message_field', b'message_field']" [arg-type] +test_negative/negative.py: error: Property "message_field" defined in "Editions2024Test" is read-only [misc] test_negative/negative.py: error: Argument 2 to "test_whichoneof_alias" has incompatible type "Literal['not_a_oneof']"; expected "Literal['a_oneof', b'a_oneof']" [arg-type] test_negative/negative.py: error: All overload variants of "DummyServiceStub" require at least one argument [call-overload] test_negative/negative.py: note: Possible overload variants: @@ -139,4 +149,4 @@ test_negative/negative.py: error: No overload variant of "DummyServiceStub" matc test_negative/negative.py: note: Possible overload variants: test_negative/negative.py: note: def __new__(cls, channel: Channel) -> DummyServiceStub test_negative/negative.py: note: def __new__(cls, channel: Channel) -> DummyServiceAsyncStub -Found 105 errors in 4 files (checked 4 source files) +Found 114 errors in 4 files (checked 4 source files) diff --git a/test_negative/output.expected.3.9 b/test_negative/output.expected.3.9 index 99a44f73..7085952b 100644 --- a/test_negative/output.expected.3.9 +++ b/test_negative/output.expected.3.9 @@ -1,18 +1,22 @@ -test/generated/testproto/grpc/dummy_pb2.pyi:71: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] +test/generated/testproto/grpc/dummy_pb2.pyi:76: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] test/generated/testproto/grpc/dummy_pb2_grpc.pyi:103: error: class testproto.grpc.dummy_pb2_grpc.DeprecatedServiceAsyncStub is deprecated: This service is deprecated [deprecated] -test/generated/testproto/grpc/dummy_pb2_grpc.pyi:104: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] -test/generated/testproto/grpc/dummy_pb2_grpc.pyi:111: error: class testproto.grpc.dummy_pb2_grpc.DeprecatedServiceStub is deprecated: This service is deprecated [deprecated] -test/generated/testproto/grpc/dummy_pb2_grpc.pyi:115: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] -test/generated/testproto/grpc/dummy_pb2_grpc.pyi:115: note: Error code "deprecated" not covered by "type: ignore" comment -test/generated/testproto/grpc/dummy_pb2_grpc.pyi:127: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] -test/generated/testproto/grpc/dummy_pb2_grpc.pyi:141: error: class testproto.grpc.dummy_pb2_grpc.DeprecatedServiceServicer is deprecated: This service is deprecated [deprecated] -test/generated/testproto/test_pb2.pyi:88: error: class testproto.test_pb2.DeprecatedEnum is deprecated: This enum is deprecated +test/generated/testproto/grpc/dummy_pb2_grpc.pyi:106: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] +test/generated/testproto/grpc/dummy_pb2_grpc.pyi:114: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] +test/generated/testproto/grpc/dummy_pb2_grpc.pyi:118: error: class testproto.grpc.dummy_pb2_grpc.DeprecatedServiceStub is deprecated: This service is deprecated [deprecated] +test/generated/testproto/grpc/dummy_pb2_grpc.pyi:124: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] +test/generated/testproto/grpc/dummy_pb2_grpc.pyi:124: note: Error code "deprecated" not covered by "type: ignore" comment +test/generated/testproto/grpc/dummy_pb2_grpc.pyi:132: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] +test/generated/testproto/grpc/dummy_pb2_grpc.pyi:132: note: Error code "deprecated" not covered by "type: ignore" comment +test/generated/testproto/grpc/dummy_pb2_grpc.pyi:141: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] +test/generated/testproto/grpc/dummy_pb2_grpc.pyi:157: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] +test/generated/testproto/grpc/dummy_pb2_grpc.pyi:162: error: class testproto.grpc.dummy_pb2_grpc.DeprecatedServiceServicer is deprecated: This service is deprecated [deprecated] +test/generated/testproto/test_pb2.pyi:96: error: class testproto.test_pb2.DeprecatedEnum is deprecated: This enum is deprecated 2 lines of comments "Quotes in comments" and 'single quotes' Trailing comment [deprecated] -test/generated/testproto/test_pb2.pyi:446: error: class testproto.test_pb2.DeprecatedMessage is deprecated: This message is deprecated [deprecated] -test/generated/testproto/test_pb2.pyi:465: error: class testproto.test_pb2.DeprecatedMessageBadComment is deprecated: This message has been marked as deprecated using proto message options. [deprecated] +test/generated/testproto/test_pb2.pyi:474: error: class testproto.test_pb2.DeprecatedMessage is deprecated: This message is deprecated [deprecated] +test/generated/testproto/test_pb2.pyi:493: error: class testproto.test_pb2.DeprecatedMessageBadComment is deprecated: This message has been marked as deprecated using proto message options. [deprecated] test_negative/negative.py:16: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] test_negative/negative.py:21: error: class testproto.grpc.dummy_pb2_grpc.DeprecatedServiceServicer is deprecated: This service is deprecated [deprecated] test_negative/negative.py:21: error: class testproto.grpc.dummy_pb2_grpc.DeprecatedServiceStub is deprecated: This service is deprecated [deprecated] @@ -23,120 +27,126 @@ test_negative/negative.py:30: error: class testproto.test_pb2.DeprecatedEnum is and 'single quotes' Trailing comment [deprecated] test_negative/negative.py:31: error: class testproto.test_pb2.DeprecatedMessage is deprecated: This message is deprecated [deprecated] -test_negative/negative.py:45: error: "Simple1" has no attribute "SerializeToStringg" [attr-defined] -test_negative/negative.py:48: error: Argument 1 to "ParseFromString" of "Message" has incompatible type "Simple1"; expected "bytes" [arg-type] -test_negative/negative.py:51: error: Argument 1 to "CopyFrom" of "Message" has incompatible type "bytes"; expected "Simple1" [arg-type] -test_negative/negative.py:55: error: Argument 1 to "extend" of "list" has incompatible type "RepeatedScalarFieldContainer[str]"; expected "Iterable[int]" [arg-type] -test_negative/negative.py:57: error: Argument "foo" to "TestMessage" has incompatible type "int"; expected "str" [arg-type] -test_negative/negative.py:60: error: Incompatible types in assignment (expression has type "int", variable has type "ValueType") [assignment] -test_negative/negative.py:63: error: Argument 1 to "HasField" of "Simple1" has incompatible type "Literal['garbage']"; expected "Literal['a_boolean', b'a_boolean', 'a_enum', b'a_enum', 'a_external_enum', b'a_external_enum', 'a_inner', b'a_inner', 'a_nested', b'a_nested', 'a_oneof', b'a_oneof', 'a_oneof_1', b'a_oneof_1', 'a_oneof_2', b'a_oneof_2', 'a_string', b'a_string', 'a_uint32', b'a_uint32', 'email', b'email', 'inner_enum', b'inner_enum', 'inner_enum_in_oneof', b'inner_enum_in_oneof', 'inner_message', b'inner_message', 'nested_enum', b'nested_enum', 'nested_message', b'nested_message', 'no_package', b'no_package', 'outer_enum_in_oneof', b'outer_enum_in_oneof', 'outer_message_in_oneof', b'outer_message_in_oneof', 'user_id', b'user_id']" [arg-type] -test_negative/negative.py:64: error: Argument 1 to "HasField" of "Simple1" has incompatible type "Literal['a_repeated_string']"; expected "Literal['a_boolean', b'a_boolean', 'a_enum', b'a_enum', 'a_external_enum', b'a_external_enum', 'a_inner', b'a_inner', 'a_nested', b'a_nested', 'a_oneof', b'a_oneof', 'a_oneof_1', b'a_oneof_1', 'a_oneof_2', b'a_oneof_2', 'a_string', b'a_string', 'a_uint32', b'a_uint32', 'email', b'email', 'inner_enum', b'inner_enum', 'inner_enum_in_oneof', b'inner_enum_in_oneof', 'inner_message', b'inner_message', 'nested_enum', b'nested_enum', 'nested_message', b'nested_message', 'no_package', b'no_package', 'outer_enum_in_oneof', b'outer_enum_in_oneof', 'outer_message_in_oneof', b'outer_message_in_oneof', 'user_id', b'user_id']" [arg-type] -test_negative/negative.py:68: error: Argument 1 to "HasField" of "SimpleProto3" has incompatible type "Literal['garbage']"; expected "Literal['OuterMessage3', b'OuterMessage3', '_an_optional_string', b'_an_optional_string', 'a_oneof', b'a_oneof', 'a_oneof_1', b'a_oneof_1', 'a_oneof_2', b'a_oneof_2', 'an_optional_string', b'an_optional_string', 'b_oneof', b'b_oneof', 'b_oneof_1', b'b_oneof_1', 'b_oneof_2', b'b_oneof_2', 'bool', b'bool', 'inner_enum_in_oneof', b'inner_enum_in_oneof', 'outer_enum_in_oneof', b'outer_enum_in_oneof', 'outer_message', b'outer_message', 'outer_message_in_oneof', b'outer_message_in_oneof']" [arg-type] -test_negative/negative.py:69: error: Argument 1 to "HasField" of "SimpleProto3" has incompatible type "Literal['a_string']"; expected "Literal['OuterMessage3', b'OuterMessage3', '_an_optional_string', b'_an_optional_string', 'a_oneof', b'a_oneof', 'a_oneof_1', b'a_oneof_1', 'a_oneof_2', b'a_oneof_2', 'an_optional_string', b'an_optional_string', 'b_oneof', b'b_oneof', 'b_oneof_1', b'b_oneof_1', 'b_oneof_2', b'b_oneof_2', 'bool', b'bool', 'inner_enum_in_oneof', b'inner_enum_in_oneof', 'outer_enum_in_oneof', b'outer_enum_in_oneof', 'outer_message', b'outer_message', 'outer_message_in_oneof', b'outer_message_in_oneof']" [arg-type] -test_negative/negative.py:70: error: Argument 1 to "HasField" of "SimpleProto3" has incompatible type "Literal['outer_enum']"; expected "Literal['OuterMessage3', b'OuterMessage3', '_an_optional_string', b'_an_optional_string', 'a_oneof', b'a_oneof', 'a_oneof_1', b'a_oneof_1', 'a_oneof_2', b'a_oneof_2', 'an_optional_string', b'an_optional_string', 'b_oneof', b'b_oneof', 'b_oneof_1', b'b_oneof_1', 'b_oneof_2', b'b_oneof_2', 'bool', b'bool', 'inner_enum_in_oneof', b'inner_enum_in_oneof', 'outer_enum_in_oneof', b'outer_enum_in_oneof', 'outer_message', b'outer_message', 'outer_message_in_oneof', b'outer_message_in_oneof']" [arg-type] -test_negative/negative.py:71: error: Argument 1 to "HasField" of "SimpleProto3" has incompatible type "Literal['a_repeated_string']"; expected "Literal['OuterMessage3', b'OuterMessage3', '_an_optional_string', b'_an_optional_string', 'a_oneof', b'a_oneof', 'a_oneof_1', b'a_oneof_1', 'a_oneof_2', b'a_oneof_2', 'an_optional_string', b'an_optional_string', 'b_oneof', b'b_oneof', 'b_oneof_1', b'b_oneof_1', 'b_oneof_2', b'b_oneof_2', 'bool', b'bool', 'inner_enum_in_oneof', b'inner_enum_in_oneof', 'outer_enum_in_oneof', b'outer_enum_in_oneof', 'outer_message', b'outer_message', 'outer_message_in_oneof', b'outer_message_in_oneof']" [arg-type] -test_negative/negative.py:74: error: Argument 1 to "ClearField" of "Simple1" has incompatible type "Literal['garbage']"; expected "Literal['a_boolean', b'a_boolean', 'a_enum', b'a_enum', 'a_external_enum', b'a_external_enum', 'a_inner', b'a_inner', 'a_nested', b'a_nested', 'a_oneof', b'a_oneof', 'a_oneof_1', b'a_oneof_1', 'a_oneof_2', b'a_oneof_2', 'a_repeated_string', b'a_repeated_string', 'a_string', b'a_string', 'a_uint32', b'a_uint32', 'email', b'email', 'email_by_uid', b'email_by_uid', 'inner_enum', b'inner_enum', 'inner_enum_in_oneof', b'inner_enum_in_oneof', 'inner_message', b'inner_message', 'nested_enum', b'nested_enum', 'nested_message', b'nested_message', 'no_package', b'no_package', 'outer_enum_in_oneof', b'outer_enum_in_oneof', 'outer_message_in_oneof', b'outer_message_in_oneof', 'rep_inner_enum', b'rep_inner_enum', 'rep_inner_message', b'rep_inner_message', 'user_id', b'user_id']" [arg-type] -test_negative/negative.py:77: error: Argument 1 to "ClearField" of "SimpleProto3" has incompatible type "Literal['garbage']"; expected "Literal['OuterEnum', b'OuterEnum', 'OuterMessage3', b'OuterMessage3', '_an_optional_string', b'_an_optional_string', 'a_oneof', b'a_oneof', 'a_oneof_1', b'a_oneof_1', 'a_oneof_2', b'a_oneof_2', 'a_outer_enum', b'a_outer_enum', 'a_repeated_string', b'a_repeated_string', 'a_string', b'a_string', 'an_optional_string', b'an_optional_string', 'b_oneof', b'b_oneof', 'b_oneof_1', b'b_oneof_1', 'b_oneof_2', b'b_oneof_2', 'bool', b'bool', 'email', b'email', 'email_by_uid', b'email_by_uid', 'inner_enum', b'inner_enum', 'inner_enum_in_oneof', b'inner_enum_in_oneof', 'map_message', b'map_message', 'map_scalar', b'map_scalar', 'outer_enum_in_oneof', b'outer_enum_in_oneof', 'outer_message', b'outer_message', 'outer_message_in_oneof', b'outer_message_in_oneof', 'user_id', b'user_id']" [arg-type] -test_negative/negative.py:80: error: Argument 1 to "WhichOneof" of "Simple1" has incompatible type "Literal['garbage']"; expected "Literal['a_oneof', b'a_oneof']" [arg-type] -test_negative/negative.py:82: error: Incompatible types in assignment (expression has type "Optional[Literal['a_oneof_1', 'a_oneof_2', 'outer_message_in_oneof', 'outer_enum_in_oneof', 'inner_enum_in_oneof']]", variable has type "int") [assignment] -test_negative/negative.py:87: error: Argument 1 to "HasField" of "Simple2" has incompatible type "Literal['a_oneof_1', 'a_oneof_2', 'outer_message_in_oneof', 'outer_enum_in_oneof', 'inner_enum_in_oneof']"; expected "Literal['a_string', b'a_string']" [arg-type] -test_negative/negative.py:91: error: Incompatible types in assignment (expression has type "Optional[Literal['a_oneof_1', 'a_oneof_2', 'outer_message_in_oneof', 'outer_enum_in_oneof', 'inner_enum_in_oneof']]", variable has type "str") [assignment] -test_negative/negative.py:94: error: No overload variant of "WhichOneof" of "SimpleProto3" matches argument type "str" [call-overload] -test_negative/negative.py:94: note: Possible overload variants: -test_negative/negative.py:94: note: def WhichOneof(self, oneof_group: Literal['_an_optional_string', b'_an_optional_string']) -> Optional[Literal['an_optional_string']] -test_negative/negative.py:94: note: def WhichOneof(self, oneof_group: Literal['a_oneof', b'a_oneof']) -> Optional[Literal['a_oneof_1', 'a_oneof_2', 'outer_message_in_oneof', 'outer_enum_in_oneof', 'inner_enum_in_oneof']] -test_negative/negative.py:94: note: def WhichOneof(self, oneof_group: Literal['b_oneof', b'b_oneof']) -> Optional[Literal['b_oneof_1', 'b_oneof_2']] -test_negative/negative.py:96: error: Incompatible types in assignment (expression has type "Optional[Literal['a_oneof_1', 'a_oneof_2', 'outer_message_in_oneof', 'outer_enum_in_oneof', 'inner_enum_in_oneof']]", variable has type "int") [assignment] -test_negative/negative.py:100: error: Argument 1 to "HasField" of "Simple2" has incompatible type "Literal['a_oneof_1', 'a_oneof_2', 'outer_message_in_oneof', 'outer_enum_in_oneof', 'inner_enum_in_oneof']"; expected "Literal['a_string', b'a_string']" [arg-type] -test_negative/negative.py:104: error: Incompatible types in assignment (expression has type "_ExtensionFieldDescriptor[Simple1, Extensions1]", variable has type "int") [assignment] -test_negative/negative.py:105: error: "type[Extensions1]" has no attribute "bad" [attr-defined] -test_negative/negative.py:107: error: "Extensions1" has no attribute "foo" [attr-defined] -test_negative/negative.py:108: error: Incompatible types in assignment (expression has type "Extensions2", variable has type "Extensions1") [assignment] -test_negative/negative.py:112: error: Invalid index type "str" for "_ExtensionDict[Simple1]"; expected type "_ExtensionFieldDescriptor[Simple1, Never]" [index] -test_negative/negative.py:113: error: Invalid index type "_ExtensionFieldDescriptor[Simple2, SeparateFileExtension]" for "_ExtensionDict[Simple1]"; expected type "_ExtensionFieldDescriptor[Simple1, SeparateFileExtension]" [index] -test_negative/negative.py:114: error: Unsupported operand types for in ("_ExtensionFieldDescriptor[Simple2, SeparateFileExtension]" and "_ExtensionDict[Simple1]") [operator] -test_negative/negative.py:115: error: Argument 1 to "__delitem__" of "_ExtensionDict" has incompatible type "_ExtensionFieldDescriptor[Simple2, SeparateFileExtension]"; expected "_ExtensionFieldDescriptor[Simple1, SeparateFileExtension]" [arg-type] -test_negative/negative.py:116: error: Argument 1 to "HasExtension" of "Message" has incompatible type "_ExtensionFieldDescriptor[Simple2, SeparateFileExtension]"; expected "_ExtensionFieldDescriptor[Simple1, Any]" [arg-type] -test_negative/negative.py:117: error: Argument 1 to "ClearExtension" of "Message" has incompatible type "_ExtensionFieldDescriptor[Simple1, Extensions1]"; expected "_ExtensionFieldDescriptor[Simple2, Any]" [arg-type] -test_negative/negative.py:121: error: Incompatible types in assignment (expression has type "int", variable has type "_ExtensionFieldDescriptor[Simple1, Any]") [assignment] -test_negative/negative.py:125: error: Incompatible types in assignment (expression has type "Optional[Literal['b_oneof_1', 'b_oneof_2']]", variable has type "Optional[Literal['a_oneof_1', 'a_oneof_2', 'outer_message_in_oneof', 'outer_enum_in_oneof', 'inner_enum_in_oneof']]") [assignment] -test_negative/negative.py:128: error: "Descriptor" has no attribute "Garbage" [attr-defined] +test_negative/negative.py:46: error: "Simple1" has no attribute "SerializeToStringg" [attr-defined] +test_negative/negative.py:49: error: Argument 1 to "ParseFromString" of "Message" has incompatible type "Simple1"; expected "bytes" [arg-type] +test_negative/negative.py:52: error: Argument 1 to "CopyFrom" of "Message" has incompatible type "bytes"; expected "Simple1" [arg-type] +test_negative/negative.py:56: error: Argument 1 to "extend" of "list" has incompatible type "RepeatedScalarFieldContainer[str]"; expected "Iterable[int]" [arg-type] +test_negative/negative.py:58: error: Argument "foo" to "TestMessage" has incompatible type "int"; expected "str" [arg-type] +test_negative/negative.py:61: error: Incompatible types in assignment (expression has type "int", variable has type "ValueType") [assignment] +test_negative/negative.py:64: error: Argument 1 to "HasField" of "Simple1" has incompatible type "Literal['garbage']"; expected "Literal['a_boolean', b'a_boolean', 'a_enum', b'a_enum', 'a_external_enum', b'a_external_enum', 'a_inner', b'a_inner', 'a_nested', b'a_nested', 'a_oneof', b'a_oneof', 'a_oneof_1', b'a_oneof_1', 'a_oneof_2', b'a_oneof_2', 'a_string', b'a_string', 'a_uint32', b'a_uint32', 'email', b'email', 'inner_enum', b'inner_enum', 'inner_enum_in_oneof', b'inner_enum_in_oneof', 'inner_message', b'inner_message', 'nested_enum', b'nested_enum', 'nested_message', b'nested_message', 'no_package', b'no_package', 'outer_enum_in_oneof', b'outer_enum_in_oneof', 'outer_message_in_oneof', b'outer_message_in_oneof', 'user_id', b'user_id']" [arg-type] +test_negative/negative.py:65: error: Argument 1 to "HasField" of "Simple1" has incompatible type "Literal['a_repeated_string']"; expected "Literal['a_boolean', b'a_boolean', 'a_enum', b'a_enum', 'a_external_enum', b'a_external_enum', 'a_inner', b'a_inner', 'a_nested', b'a_nested', 'a_oneof', b'a_oneof', 'a_oneof_1', b'a_oneof_1', 'a_oneof_2', b'a_oneof_2', 'a_string', b'a_string', 'a_uint32', b'a_uint32', 'email', b'email', 'inner_enum', b'inner_enum', 'inner_enum_in_oneof', b'inner_enum_in_oneof', 'inner_message', b'inner_message', 'nested_enum', b'nested_enum', 'nested_message', b'nested_message', 'no_package', b'no_package', 'outer_enum_in_oneof', b'outer_enum_in_oneof', 'outer_message_in_oneof', b'outer_message_in_oneof', 'user_id', b'user_id']" [arg-type] +test_negative/negative.py:69: error: Argument 1 to "HasField" of "SimpleProto3" has incompatible type "Literal['garbage']"; expected "Literal['OuterMessage3', b'OuterMessage3', '_an_optional_string', b'_an_optional_string', 'a_oneof', b'a_oneof', 'a_oneof_1', b'a_oneof_1', 'a_oneof_2', b'a_oneof_2', 'an_optional_string', b'an_optional_string', 'b_oneof', b'b_oneof', 'b_oneof_1', b'b_oneof_1', 'b_oneof_2', b'b_oneof_2', 'bool', b'bool', 'inner_enum_in_oneof', b'inner_enum_in_oneof', 'outer_enum_in_oneof', b'outer_enum_in_oneof', 'outer_message', b'outer_message', 'outer_message_in_oneof', b'outer_message_in_oneof']" [arg-type] +test_negative/negative.py:70: error: Argument 1 to "HasField" of "SimpleProto3" has incompatible type "Literal['a_string']"; expected "Literal['OuterMessage3', b'OuterMessage3', '_an_optional_string', b'_an_optional_string', 'a_oneof', b'a_oneof', 'a_oneof_1', b'a_oneof_1', 'a_oneof_2', b'a_oneof_2', 'an_optional_string', b'an_optional_string', 'b_oneof', b'b_oneof', 'b_oneof_1', b'b_oneof_1', 'b_oneof_2', b'b_oneof_2', 'bool', b'bool', 'inner_enum_in_oneof', b'inner_enum_in_oneof', 'outer_enum_in_oneof', b'outer_enum_in_oneof', 'outer_message', b'outer_message', 'outer_message_in_oneof', b'outer_message_in_oneof']" [arg-type] +test_negative/negative.py:71: error: Argument 1 to "HasField" of "SimpleProto3" has incompatible type "Literal['outer_enum']"; expected "Literal['OuterMessage3', b'OuterMessage3', '_an_optional_string', b'_an_optional_string', 'a_oneof', b'a_oneof', 'a_oneof_1', b'a_oneof_1', 'a_oneof_2', b'a_oneof_2', 'an_optional_string', b'an_optional_string', 'b_oneof', b'b_oneof', 'b_oneof_1', b'b_oneof_1', 'b_oneof_2', b'b_oneof_2', 'bool', b'bool', 'inner_enum_in_oneof', b'inner_enum_in_oneof', 'outer_enum_in_oneof', b'outer_enum_in_oneof', 'outer_message', b'outer_message', 'outer_message_in_oneof', b'outer_message_in_oneof']" [arg-type] +test_negative/negative.py:72: error: Argument 1 to "HasField" of "SimpleProto3" has incompatible type "Literal['a_repeated_string']"; expected "Literal['OuterMessage3', b'OuterMessage3', '_an_optional_string', b'_an_optional_string', 'a_oneof', b'a_oneof', 'a_oneof_1', b'a_oneof_1', 'a_oneof_2', b'a_oneof_2', 'an_optional_string', b'an_optional_string', 'b_oneof', b'b_oneof', 'b_oneof_1', b'b_oneof_1', 'b_oneof_2', b'b_oneof_2', 'bool', b'bool', 'inner_enum_in_oneof', b'inner_enum_in_oneof', 'outer_enum_in_oneof', b'outer_enum_in_oneof', 'outer_message', b'outer_message', 'outer_message_in_oneof', b'outer_message_in_oneof']" [arg-type] +test_negative/negative.py:75: error: Argument 1 to "ClearField" of "Simple1" has incompatible type "Literal['garbage']"; expected "Literal['a_boolean', b'a_boolean', 'a_enum', b'a_enum', 'a_external_enum', b'a_external_enum', 'a_inner', b'a_inner', 'a_nested', b'a_nested', 'a_oneof', b'a_oneof', 'a_oneof_1', b'a_oneof_1', 'a_oneof_2', b'a_oneof_2', 'a_repeated_string', b'a_repeated_string', 'a_string', b'a_string', 'a_uint32', b'a_uint32', 'email', b'email', 'email_by_uid', b'email_by_uid', 'inner_enum', b'inner_enum', 'inner_enum_in_oneof', b'inner_enum_in_oneof', 'inner_message', b'inner_message', 'nested_enum', b'nested_enum', 'nested_message', b'nested_message', 'no_package', b'no_package', 'outer_enum_in_oneof', b'outer_enum_in_oneof', 'outer_message_in_oneof', b'outer_message_in_oneof', 'rep_inner_enum', b'rep_inner_enum', 'rep_inner_message', b'rep_inner_message', 'user_id', b'user_id']" [arg-type] +test_negative/negative.py:78: error: Argument 1 to "ClearField" of "SimpleProto3" has incompatible type "Literal['garbage']"; expected "Literal['OuterEnum', b'OuterEnum', 'OuterMessage3', b'OuterMessage3', '_an_optional_string', b'_an_optional_string', 'a_oneof', b'a_oneof', 'a_oneof_1', b'a_oneof_1', 'a_oneof_2', b'a_oneof_2', 'a_outer_enum', b'a_outer_enum', 'a_repeated_string', b'a_repeated_string', 'a_string', b'a_string', 'an_optional_string', b'an_optional_string', 'b_oneof', b'b_oneof', 'b_oneof_1', b'b_oneof_1', 'b_oneof_2', b'b_oneof_2', 'bool', b'bool', 'email', b'email', 'email_by_uid', b'email_by_uid', 'inner_enum', b'inner_enum', 'inner_enum_in_oneof', b'inner_enum_in_oneof', 'map_message', b'map_message', 'map_scalar', b'map_scalar', 'outer_enum_in_oneof', b'outer_enum_in_oneof', 'outer_message', b'outer_message', 'outer_message_in_oneof', b'outer_message_in_oneof', 'user_id', b'user_id']" [arg-type] +test_negative/negative.py:81: error: Argument 1 to "WhichOneof" of "Simple1" has incompatible type "Literal['garbage']"; expected "Literal['a_oneof', b'a_oneof']" [arg-type] +test_negative/negative.py:83: error: Incompatible types in assignment (expression has type "Optional[Literal['a_oneof_1', 'a_oneof_2', 'outer_message_in_oneof', 'outer_enum_in_oneof', 'inner_enum_in_oneof']]", variable has type "int") [assignment] +test_negative/negative.py:88: error: Argument 1 to "HasField" of "Simple2" has incompatible type "Literal['a_oneof_1', 'a_oneof_2', 'outer_message_in_oneof', 'outer_enum_in_oneof', 'inner_enum_in_oneof']"; expected "Literal['a_string', b'a_string']" [arg-type] +test_negative/negative.py:92: error: Incompatible types in assignment (expression has type "Optional[Literal['a_oneof_1', 'a_oneof_2', 'outer_message_in_oneof', 'outer_enum_in_oneof', 'inner_enum_in_oneof']]", variable has type "str") [assignment] +test_negative/negative.py:95: error: No overload variant of "WhichOneof" of "SimpleProto3" matches argument type "str" [call-overload] +test_negative/negative.py:95: note: Possible overload variants: +test_negative/negative.py:95: note: def WhichOneof(self, oneof_group: Literal['_an_optional_string', b'_an_optional_string']) -> Optional[Literal['an_optional_string']] +test_negative/negative.py:95: note: def WhichOneof(self, oneof_group: Literal['a_oneof', b'a_oneof']) -> Optional[Literal['a_oneof_1', 'a_oneof_2', 'outer_message_in_oneof', 'outer_enum_in_oneof', 'inner_enum_in_oneof']] +test_negative/negative.py:95: note: def WhichOneof(self, oneof_group: Literal['b_oneof', b'b_oneof']) -> Optional[Literal['b_oneof_1', 'b_oneof_2']] +test_negative/negative.py:97: error: Incompatible types in assignment (expression has type "Optional[Literal['a_oneof_1', 'a_oneof_2', 'outer_message_in_oneof', 'outer_enum_in_oneof', 'inner_enum_in_oneof']]", variable has type "int") [assignment] +test_negative/negative.py:101: error: Argument 1 to "HasField" of "Simple2" has incompatible type "Literal['a_oneof_1', 'a_oneof_2', 'outer_message_in_oneof', 'outer_enum_in_oneof', 'inner_enum_in_oneof']"; expected "Literal['a_string', b'a_string']" [arg-type] +test_negative/negative.py:105: error: Incompatible types in assignment (expression has type "_ExtensionFieldDescriptor[Simple1, Extensions1]", variable has type "int") [assignment] +test_negative/negative.py:106: error: "type[Extensions1]" has no attribute "bad" [attr-defined] +test_negative/negative.py:108: error: "Extensions1" has no attribute "foo" [attr-defined] +test_negative/negative.py:109: error: Incompatible types in assignment (expression has type "Extensions2", variable has type "Extensions1") [assignment] +test_negative/negative.py:113: error: Invalid index type "str" for "_ExtensionDict[Simple1]"; expected type "_ExtensionFieldDescriptor[Simple1, Never]" [index] +test_negative/negative.py:114: error: Invalid index type "_ExtensionFieldDescriptor[Simple2, SeparateFileExtension]" for "_ExtensionDict[Simple1]"; expected type "_ExtensionFieldDescriptor[Simple1, SeparateFileExtension]" [index] +test_negative/negative.py:115: error: Unsupported operand types for in ("_ExtensionFieldDescriptor[Simple2, SeparateFileExtension]" and "_ExtensionDict[Simple1]") [operator] +test_negative/negative.py:116: error: Argument 1 to "__delitem__" of "_ExtensionDict" has incompatible type "_ExtensionFieldDescriptor[Simple2, SeparateFileExtension]"; expected "_ExtensionFieldDescriptor[Simple1, SeparateFileExtension]" [arg-type] +test_negative/negative.py:117: error: Argument 1 to "HasExtension" of "Message" has incompatible type "_ExtensionFieldDescriptor[Simple2, SeparateFileExtension]"; expected "_ExtensionFieldDescriptor[Simple1, Any]" [arg-type] +test_negative/negative.py:118: error: Argument 1 to "ClearExtension" of "Message" has incompatible type "_ExtensionFieldDescriptor[Simple1, Extensions1]"; expected "_ExtensionFieldDescriptor[Simple2, Any]" [arg-type] +test_negative/negative.py:122: error: Incompatible types in assignment (expression has type "int", variable has type "_ExtensionFieldDescriptor[Simple1, Any]") [assignment] +test_negative/negative.py:126: error: Incompatible types in assignment (expression has type "Optional[Literal['b_oneof_1', 'b_oneof_2']]", variable has type "Optional[Literal['a_oneof_1', 'a_oneof_2', 'outer_message_in_oneof', 'outer_enum_in_oneof', 'inner_enum_in_oneof']]") [assignment] test_negative/negative.py:129: error: "Descriptor" has no attribute "Garbage" [attr-defined] -test_negative/negative.py:132: error: "EnumDescriptor" has no attribute "Garbage" [attr-defined] -test_negative/negative.py:135: error: "FileDescriptor" has no attribute "Garbage" [attr-defined] -test_negative/negative.py:142: error: "ValueType" has no attribute "FOO" [attr-defined] -test_negative/negative.py:146: error: Argument 1 to "Name" of "_EnumTypeWrapper" has incompatible type "int"; expected "ValueType" [arg-type] -test_negative/negative.py:148: error: Argument 1 to "Name" of "_EnumTypeWrapper" has incompatible type "testproto.test3_pb2.SimpleProto3._InnerEnum.ValueType"; expected "testproto.test3_pb2._OuterEnum.ValueType" [arg-type] -test_negative/negative.py:150: error: Argument 1 to "Name" of "_EnumTypeWrapper" has incompatible type "testproto.test3_pb2.SimpleProto3._InnerEnum.ValueType"; expected "testproto.test3_pb2._OuterEnum.ValueType" [arg-type] -test_negative/negative.py:152: error: Argument 1 to "Name" of "_EnumTypeWrapper" has incompatible type "testproto.test3_pb2.SimpleProto3._InnerEnum.ValueType"; expected "testproto.test3_pb2._OuterEnum.ValueType" [arg-type] -test_negative/negative.py:156: error: "ScalarMap[int, str]" has no attribute "get_or_create" [attr-defined] -test_negative/negative.py:158: error: No overload variant of "get" of "ScalarMap" matches argument type "str" [call-overload] -test_negative/negative.py:158: note: Possible overload variants: -test_negative/negative.py:158: note: def get(self, key: int, default: None = ...) -> Optional[str] -test_negative/negative.py:158: note: def get(self, key: int, default: str) -> str -test_negative/negative.py:158: note: def [_T] get(self, key: int, default: _T) -> Union[str, _T] -test_negative/negative.py:159: error: No overload variant of "get" of "MessageMap" matches argument type "str" [call-overload] +test_negative/negative.py:130: error: "Descriptor" has no attribute "Garbage" [attr-defined] +test_negative/negative.py:133: error: "EnumDescriptor" has no attribute "Garbage" [attr-defined] +test_negative/negative.py:136: error: "FileDescriptor" has no attribute "Garbage" [attr-defined] +test_negative/negative.py:143: error: "ValueType" has no attribute "FOO" [attr-defined] +test_negative/negative.py:147: error: Argument 1 to "Name" of "_EnumTypeWrapper" has incompatible type "int"; expected "ValueType" [arg-type] +test_negative/negative.py:149: error: Argument 1 to "Name" of "_EnumTypeWrapper" has incompatible type "testproto.test3_pb2.SimpleProto3._InnerEnum.ValueType"; expected "testproto.test3_pb2._OuterEnum.ValueType" [arg-type] +test_negative/negative.py:151: error: Argument 1 to "Name" of "_EnumTypeWrapper" has incompatible type "testproto.test3_pb2.SimpleProto3._InnerEnum.ValueType"; expected "testproto.test3_pb2._OuterEnum.ValueType" [arg-type] +test_negative/negative.py:153: error: Argument 1 to "Name" of "_EnumTypeWrapper" has incompatible type "testproto.test3_pb2.SimpleProto3._InnerEnum.ValueType"; expected "testproto.test3_pb2._OuterEnum.ValueType" [arg-type] +test_negative/negative.py:157: error: "ScalarMap[int, str]" has no attribute "get_or_create" [attr-defined] +test_negative/negative.py:159: error: No overload variant of "get" of "ScalarMap" matches argument type "str" [call-overload] test_negative/negative.py:159: note: Possible overload variants: -test_negative/negative.py:159: note: def get(self, key: int, default: None = ...) -> Optional[OuterMessage3] -test_negative/negative.py:159: note: def get(self, key: int, default: OuterMessage3) -> OuterMessage3 -test_negative/negative.py:159: note: def [_T] get(self, key: int, default: _T) -> Union[OuterMessage3, _T] -test_negative/negative.py:162: error: Incompatible types in assignment (expression has type "Optional[str]", variable has type "int") [assignment] -test_negative/negative.py:163: error: Incompatible types in assignment (expression has type "Optional[OuterMessage3]", variable has type "int") [assignment] -test_negative/negative.py:165: error: Dict entry 0 has incompatible type "str": "int"; expected "int": "str" [dict-item] -test_negative/negative.py:165: error: Dict entry 0 has incompatible type "str": "str"; expected "int": "OuterMessage3" [dict-item] -test_negative/negative.py:169: error: Incompatible types in assignment (expression has type "int", variable has type "UserId") [assignment] -test_negative/negative.py:170: error: Incompatible types in assignment (expression has type "str", variable has type "Email") [assignment] -test_negative/negative.py:171: error: Invalid index type "int" for "ScalarMap[UserId, Email]"; expected type "UserId" [index] -test_negative/negative.py:171: error: Incompatible types in assignment (expression has type "str", target has type "Email") [assignment] +test_negative/negative.py:159: note: def get(self, key: int, default: None = ...) -> Optional[str] +test_negative/negative.py:159: note: def get(self, key: int, default: str) -> str +test_negative/negative.py:159: note: def [_T] get(self, key: int, default: _T) -> Union[str, _T] +test_negative/negative.py:160: error: No overload variant of "get" of "MessageMap" matches argument type "str" [call-overload] +test_negative/negative.py:160: note: Possible overload variants: +test_negative/negative.py:160: note: def get(self, key: int, default: None = ...) -> Optional[OuterMessage3] +test_negative/negative.py:160: note: def get(self, key: int, default: OuterMessage3) -> OuterMessage3 +test_negative/negative.py:160: note: def [_T] get(self, key: int, default: _T) -> Union[OuterMessage3, _T] +test_negative/negative.py:163: error: Incompatible types in assignment (expression has type "Optional[str]", variable has type "int") [assignment] +test_negative/negative.py:164: error: Incompatible types in assignment (expression has type "Optional[OuterMessage3]", variable has type "int") [assignment] +test_negative/negative.py:166: error: Dict entry 0 has incompatible type "str": "int"; expected "int": "str" [dict-item] +test_negative/negative.py:166: error: Dict entry 0 has incompatible type "str": "str"; expected "int": "OuterMessage3" [dict-item] +test_negative/negative.py:170: error: Incompatible types in assignment (expression has type "int", variable has type "UserId") [assignment] +test_negative/negative.py:171: error: Incompatible types in assignment (expression has type "str", variable has type "Email") [assignment] +test_negative/negative.py:172: error: Invalid index type "int" for "ScalarMap[UserId, Email]"; expected type "UserId" [index] test_negative/negative.py:172: error: Incompatible types in assignment (expression has type "str", target has type "Email") [assignment] -test_negative/negative.py:173: error: Invalid index type "int" for "ScalarMap[UserId, Email]"; expected type "UserId" [index] -test_negative/negative.py:175: error: Argument "user_id" to "Simple1" has incompatible type "int"; expected "Optional[UserId]" [arg-type] -test_negative/negative.py:176: error: Argument "email" to "Simple1" has incompatible type "str"; expected "Optional[Email]" [arg-type] -test_negative/negative.py:177: error: Dict entry 0 has incompatible type "int": "str"; expected "UserId": "Email" [dict-item] -test_negative/negative.py:181: error: Module "testproto.reexport_pb2" has no attribute "Inner" [attr-defined] -test_negative/negative.py:185: error: Argument "a_string" to "OuterMessage3" has incompatible type "None"; expected "str" [arg-type] -test_negative/negative.py:190: error: Property "a_repeated_string" defined in "Simple1" is read-only [misc] -test_negative/negative.py:191: error: Property "rep_inner_enum" defined in "Simple1" is read-only [misc] -test_negative/negative.py:196: error: "_r_None" has no attribute "invalid"; maybe "valid"? [attr-defined] -test_negative/negative.py:200: error: Incompatible types in assignment (expression has type "ValueType", variable has type "str") [assignment] -test_negative/negative.py:204: error: All overload variants of "DummyServiceStub" require at least one argument [call-overload] -test_negative/negative.py:204: note: Possible overload variants: -test_negative/negative.py:204: note: def __new__(cls, channel: Channel) -> DummyServiceStub -test_negative/negative.py:204: note: def __new__(cls, channel: Channel) -> DummyServiceAsyncStub -test_negative/negative.py:211: error: "DummyReply" has no attribute "not_exists" [attr-defined] -test_negative/negative.py:212: error: "DummyReply" has no attribute "__iter__" (not iterable) [attr-defined] -test_negative/negative.py:217: error: "DummyReply" has no attribute "not_exists" [attr-defined] -test_negative/negative.py:219: error: "_CallIterator[DummyReply]" has no attribute "value" [attr-defined] -test_negative/negative.py:226: error: Argument 1 to "__call__" of "StreamUnaryMultiCallable" has incompatible type "DummyRequest"; expected "Iterator[DummyRequest]" [arg-type] -test_negative/negative.py:228: error: "DummyReply" has no attribute "__iter__" (not iterable) [attr-defined] -test_negative/negative.py:228: error: Argument 1 to "__call__" of "StreamUnaryMultiCallable" has incompatible type "DummyRequest"; expected "Iterator[DummyRequest]" [arg-type] -test_negative/negative.py:231: error: Argument 1 to "__call__" of "StreamStreamMultiCallable" has incompatible type "DummyRequest"; expected "Iterator[DummyRequest]" [arg-type] -test_negative/negative.py:235: error: "DummyReply" has no attribute "not_exists" [attr-defined] -test_negative/negative.py:272: error: Return type "Iterator[DummyReply]" of "UnaryUnary" incompatible with return type "Union[DummyReply, Awaitable[DummyReply]]" in supertype "testproto.grpc.dummy_pb2_grpc.DummyServiceServicer" [override] -test_negative/negative.py:274: error: Argument 1 of "UnaryUnary" is incompatible with supertype "testproto.grpc.dummy_pb2_grpc.DummyServiceServicer"; supertype defines the argument type as "DummyRequest" [override] -test_negative/negative.py:274: note: This violates the Liskov substitution principle -test_negative/negative.py:274: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#incompatible-overrides -test_negative/negative.py:280: error: Return type "DummyReply" of "UnaryStream" incompatible with return type "Union[Iterator[DummyReply], AsyncIterator[DummyReply]]" in supertype "testproto.grpc.dummy_pb2_grpc.DummyServiceServicer" [override] -test_negative/negative.py:282: error: Argument 1 of "UnaryStream" is incompatible with supertype "testproto.grpc.dummy_pb2_grpc.DummyServiceServicer"; supertype defines the argument type as "DummyRequest" [override] -test_negative/negative.py:282: note: This violates the Liskov substitution principle -test_negative/negative.py:282: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#incompatible-overrides -test_negative/negative.py:289: error: Return type "Iterator[DummyReply]" of "StreamUnary" incompatible with return type "Union[DummyReply, Awaitable[DummyReply]]" in supertype "testproto.grpc.dummy_pb2_grpc.DummyServiceServicer" [override] -test_negative/negative.py:291: error: Argument 1 of "StreamUnary" is incompatible with supertype "testproto.grpc.dummy_pb2_grpc.DummyServiceServicer"; supertype defines the argument type as "_MaybeAsyncIterator[DummyRequest]" [override] -test_negative/negative.py:291: note: This violates the Liskov substitution principle -test_negative/negative.py:291: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#incompatible-overrides -test_negative/negative.py:320: error: class testproto.grpc.dummy_pb2_grpc.DeprecatedServiceAsyncStub is deprecated: This service is deprecated [deprecated] -test_negative/negative.py:332: error: Argument "implicit_singular" to "Editions2024Test" has incompatible type "None"; expected "str" [arg-type] -test_negative/negative.py:334: error: Argument 1 to "HasField" of "Editions2024Test" has incompatible type "Literal['implicit_singular']"; expected "Literal['default_singular', b'default_singular', 'explicit_singular', b'explicit_singular', 'legacy', b'legacy', 'message_field', b'message_field']" [arg-type] -test_negative/negative.py:345: error: Cannot instantiate abstract class "IncompleteServicer" with abstract attributes "StreamStream", "StreamUnary", "UnaryStream" and "UnaryUnary" [abstract] -test_negative/negative.py:352: error: Argument 2 to "test_hasfield_alias" has incompatible type "Literal['not_a_field']"; expected "Literal['default_singular', b'default_singular', 'explicit_singular', b'explicit_singular', 'legacy', b'legacy', 'message_field', b'message_field']" [arg-type] -test_negative/negative.py:359: error: Argument 2 to "test_clearfield_alias" has incompatible type "Literal['not_a_field']"; expected "Literal['default_singular', b'default_singular', 'explicit_singular', b'explicit_singular', 'implicit_singular', b'implicit_singular', 'legacy', b'legacy', 'message_field', b'message_field']" [arg-type] -test_negative/negative.py:369: error: Argument 2 to "test_whichoneof_alias" has incompatible type "Literal['not_a_oneof']"; expected "Literal['a_oneof', b'a_oneof']" [arg-type] -test_negative/negative.py:372: error: All overload variants of "DummyServiceStub" require at least one argument [call-overload] -test_negative/negative.py:372: note: Possible overload variants: -test_negative/negative.py:372: note: def __new__(cls, channel: Channel) -> DummyServiceStub -test_negative/negative.py:372: note: def __new__(cls, channel: Channel) -> DummyServiceAsyncStub -test_negative/negative.py:373: error: No overload variant of "DummyServiceStub" matches argument type "str" [call-overload] -test_negative/negative.py:373: note: Possible overload variants: -test_negative/negative.py:373: note: def __new__(cls, channel: Channel) -> DummyServiceStub -test_negative/negative.py:373: note: def __new__(cls, channel: Channel) -> DummyServiceAsyncStub -Found 105 errors in 4 files (checked 4 source files) +test_negative/negative.py:173: error: Incompatible types in assignment (expression has type "str", target has type "Email") [assignment] +test_negative/negative.py:174: error: Invalid index type "int" for "ScalarMap[UserId, Email]"; expected type "UserId" [index] +test_negative/negative.py:176: error: Argument "user_id" to "Simple1" has incompatible type "int"; expected "Optional[UserId]" [arg-type] +test_negative/negative.py:177: error: Argument "email" to "Simple1" has incompatible type "str"; expected "Optional[Email]" [arg-type] +test_negative/negative.py:178: error: Dict entry 0 has incompatible type "int": "str"; expected "UserId": "Email" [dict-item] +test_negative/negative.py:182: error: Module "testproto.reexport_pb2" has no attribute "Inner" [attr-defined] +test_negative/negative.py:186: error: Argument "a_string" to "OuterMessage3" has incompatible type "None"; expected "str" [arg-type] +test_negative/negative.py:191: error: Property "a_repeated_string" defined in "Simple1" is read-only [misc] +test_negative/negative.py:192: error: Property "rep_inner_enum" defined in "Simple1" is read-only [misc] +test_negative/negative.py:197: error: "_r_None" has no attribute "invalid"; maybe "valid"? [attr-defined] +test_negative/negative.py:201: error: Incompatible types in assignment (expression has type "ValueType", variable has type "str") [assignment] +test_negative/negative.py:205: error: function testproto.test_pb2.DeprecatedMessage.deprecated_field is deprecated: This field has been marked as deprecated using proto field options. [deprecated] +test_negative/negative.py:207: error: All overload variants of "DummyServiceStub" require at least one argument [call-overload] +test_negative/negative.py:207: note: Possible overload variants: +test_negative/negative.py:207: note: def __new__(cls, channel: Channel) -> DummyServiceStub +test_negative/negative.py:207: note: def __new__(cls, channel: Channel) -> DummyServiceAsyncStub +test_negative/negative.py:214: error: "DummyReply" has no attribute "not_exists" [attr-defined] +test_negative/negative.py:215: error: "DummyReply" has no attribute "__iter__" (not iterable) [attr-defined] +test_negative/negative.py:220: error: "DummyReply" has no attribute "not_exists" [attr-defined] +test_negative/negative.py:222: error: "_CallIterator[DummyReply]" has no attribute "value" [attr-defined] +test_negative/negative.py:229: error: Argument 1 to "__call__" of "StreamUnaryMultiCallable" has incompatible type "DummyRequest"; expected "Iterator[DummyRequest]" [arg-type] +test_negative/negative.py:231: error: "DummyReply" has no attribute "__iter__" (not iterable) [attr-defined] +test_negative/negative.py:231: error: Argument 1 to "__call__" of "StreamUnaryMultiCallable" has incompatible type "DummyRequest"; expected "Iterator[DummyRequest]" [arg-type] +test_negative/negative.py:234: error: Argument 1 to "__call__" of "StreamStreamMultiCallable" has incompatible type "DummyRequest"; expected "Iterator[DummyRequest]" [arg-type] +test_negative/negative.py:238: error: "DummyReply" has no attribute "not_exists" [attr-defined] +test_negative/negative.py:275: error: Return type "Iterator[DummyReply]" of "UnaryUnary" incompatible with return type "Union[DummyReply, Awaitable[DummyReply]]" in supertype "testproto.grpc.dummy_pb2_grpc.DummyServiceServicer" [override] +test_negative/negative.py:277: error: Argument 1 of "UnaryUnary" is incompatible with supertype "testproto.grpc.dummy_pb2_grpc.DummyServiceServicer"; supertype defines the argument type as "DummyRequest" [override] +test_negative/negative.py:277: note: This violates the Liskov substitution principle +test_negative/negative.py:277: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#incompatible-overrides +test_negative/negative.py:283: error: Return type "DummyReply" of "UnaryStream" incompatible with return type "Union[Iterator[DummyReply], AsyncIterator[DummyReply]]" in supertype "testproto.grpc.dummy_pb2_grpc.DummyServiceServicer" [override] +test_negative/negative.py:285: error: Argument 1 of "UnaryStream" is incompatible with supertype "testproto.grpc.dummy_pb2_grpc.DummyServiceServicer"; supertype defines the argument type as "DummyRequest" [override] +test_negative/negative.py:285: note: This violates the Liskov substitution principle +test_negative/negative.py:285: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#incompatible-overrides +test_negative/negative.py:292: error: Return type "Iterator[DummyReply]" of "StreamUnary" incompatible with return type "Union[DummyReply, Awaitable[DummyReply]]" in supertype "testproto.grpc.dummy_pb2_grpc.DummyServiceServicer" [override] +test_negative/negative.py:294: error: Argument 1 of "StreamUnary" is incompatible with supertype "testproto.grpc.dummy_pb2_grpc.DummyServiceServicer"; supertype defines the argument type as "_MaybeAsyncIterator[DummyRequest]" [override] +test_negative/negative.py:294: note: This violates the Liskov substitution principle +test_negative/negative.py:294: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#incompatible-overrides +test_negative/negative.py:328: error: function testproto.grpc.dummy_pb2_grpc.DeprecatedServiceStub.DeprecatedMethod is deprecated: This method has been marked as deprecated using proto method options. [deprecated] +test_negative/negative.py:329: error: function testproto.grpc.dummy_pb2_grpc.DeprecatedServiceStub.DeprecatedMethodNotDeprecatedRequest is deprecated: Method is deprecated, but request message is not [deprecated] +test_negative/negative.py:330: error: class testproto.grpc.dummy_pb2_grpc.DeprecatedServiceAsyncStub is deprecated: This service is deprecated [deprecated] +test_negative/negative.py:333: error: function testproto.test_pb2._DeprecatedEnumEnumTypeWrapper.DEPRECATED_ONE is deprecated: This enum value has been marked as deprecated using proto enum value options. [deprecated] +test_negative/negative.py:334: error: function testproto.test_pb2._DeprecatedEnumEnumTypeWrapper.DEPRECATED_TWO is deprecated: This enum value has been marked as deprecated using proto enum value options. [deprecated] +test_negative/negative.py:344: error: Argument "implicit_singular" to "Editions2024Test" has incompatible type "None"; expected "str" [arg-type] +test_negative/negative.py:346: error: Argument 1 to "HasField" of "Editions2024Test" has incompatible type "Literal['implicit_singular']"; expected "Literal['default_singular', b'default_singular', 'explicit_singular', b'explicit_singular', 'legacy', b'legacy', 'message_field', b'message_field']" [arg-type] +test_negative/negative.py:357: error: Cannot instantiate abstract class "IncompleteServicer" with abstract attributes "StreamStream", "StreamUnary", "UnaryStream" and "UnaryUnary" [abstract] +test_negative/negative.py:364: error: Argument 2 to "test_hasfield_alias" has incompatible type "Literal['not_a_field']"; expected "Literal['default_singular', b'default_singular', 'explicit_singular', b'explicit_singular', 'legacy', b'legacy', 'message_field', b'message_field']" [arg-type] +test_negative/negative.py:371: error: Argument 2 to "test_clearfield_alias" has incompatible type "Literal['not_a_field']"; expected "Literal['default_singular', b'default_singular', 'explicit_singular', b'explicit_singular', 'implicit_singular', b'implicit_singular', 'legacy', b'legacy', 'message_field', b'message_field']" [arg-type] +test_negative/negative.py:372: error: Property "message_field" defined in "Editions2024Test" is read-only [misc] +test_negative/negative.py:383: error: Argument 2 to "test_whichoneof_alias" has incompatible type "Literal['not_a_oneof']"; expected "Literal['a_oneof', b'a_oneof']" [arg-type] +test_negative/negative.py:386: error: All overload variants of "DummyServiceStub" require at least one argument [call-overload] +test_negative/negative.py:386: note: Possible overload variants: +test_negative/negative.py:386: note: def __new__(cls, channel: Channel) -> DummyServiceStub +test_negative/negative.py:386: note: def __new__(cls, channel: Channel) -> DummyServiceAsyncStub +test_negative/negative.py:387: error: No overload variant of "DummyServiceStub" matches argument type "str" [call-overload] +test_negative/negative.py:387: note: Possible overload variants: +test_negative/negative.py:387: note: def __new__(cls, channel: Channel) -> DummyServiceStub +test_negative/negative.py:387: note: def __new__(cls, channel: Channel) -> DummyServiceAsyncStub +Found 114 errors in 4 files (checked 4 source files) diff --git a/test_negative/output.expected.3.9.omit_linenos b/test_negative/output.expected.3.9.omit_linenos index 619c4693..3f090ea9 100644 --- a/test_negative/output.expected.3.9.omit_linenos +++ b/test_negative/output.expected.3.9.omit_linenos @@ -1,10 +1,14 @@ test/generated/testproto/grpc/dummy_pb2.pyi: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] test/generated/testproto/grpc/dummy_pb2_grpc.pyi: error: class testproto.grpc.dummy_pb2_grpc.DeprecatedServiceAsyncStub is deprecated: This service is deprecated [deprecated] test/generated/testproto/grpc/dummy_pb2_grpc.pyi: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] +test/generated/testproto/grpc/dummy_pb2_grpc.pyi: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] test/generated/testproto/grpc/dummy_pb2_grpc.pyi: error: class testproto.grpc.dummy_pb2_grpc.DeprecatedServiceStub is deprecated: This service is deprecated [deprecated] test/generated/testproto/grpc/dummy_pb2_grpc.pyi: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] test/generated/testproto/grpc/dummy_pb2_grpc.pyi: note: Error code "deprecated" not covered by "type: ignore" comment test/generated/testproto/grpc/dummy_pb2_grpc.pyi: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] +test/generated/testproto/grpc/dummy_pb2_grpc.pyi: note: Error code "deprecated" not covered by "type: ignore" comment +test/generated/testproto/grpc/dummy_pb2_grpc.pyi: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] +test/generated/testproto/grpc/dummy_pb2_grpc.pyi: error: class testproto.grpc.dummy_pb2.DeprecatedRequest is deprecated: This message has been marked as deprecated using proto message options. [deprecated] test/generated/testproto/grpc/dummy_pb2_grpc.pyi: error: class testproto.grpc.dummy_pb2_grpc.DeprecatedServiceServicer is deprecated: This service is deprecated [deprecated] test/generated/testproto/test_pb2.pyi: error: class testproto.test_pb2.DeprecatedEnum is deprecated: This enum is deprecated 2 lines of comments @@ -99,6 +103,7 @@ test_negative/negative.py: error: Property "a_repeated_string" defined in "Simpl test_negative/negative.py: error: Property "rep_inner_enum" defined in "Simple1" is read-only [misc] test_negative/negative.py: error: "_r_None" has no attribute "invalid"; maybe "valid"? [attr-defined] test_negative/negative.py: error: Incompatible types in assignment (expression has type "ValueType", variable has type "str") [assignment] +test_negative/negative.py: error: function testproto.test_pb2.DeprecatedMessage.deprecated_field is deprecated: This field has been marked as deprecated using proto field options. [deprecated] test_negative/negative.py: error: All overload variants of "DummyServiceStub" require at least one argument [call-overload] test_negative/negative.py: note: Possible overload variants: test_negative/negative.py: note: def __new__(cls, channel: Channel) -> DummyServiceStub @@ -124,12 +129,17 @@ test_negative/negative.py: error: Return type "Iterator[DummyReply]" of "StreamU test_negative/negative.py: error: Argument 1 of "StreamUnary" is incompatible with supertype "testproto.grpc.dummy_pb2_grpc.DummyServiceServicer"; supertype defines the argument type as "_MaybeAsyncIterator[DummyRequest]" [override] test_negative/negative.py: note: This violates the Liskov substitution principle test_negative/negative.py: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#incompatible-overrides +test_negative/negative.py: error: function testproto.grpc.dummy_pb2_grpc.DeprecatedServiceStub.DeprecatedMethod is deprecated: This method has been marked as deprecated using proto method options. [deprecated] +test_negative/negative.py: error: function testproto.grpc.dummy_pb2_grpc.DeprecatedServiceStub.DeprecatedMethodNotDeprecatedRequest is deprecated: Method is deprecated, but request message is not [deprecated] test_negative/negative.py: error: class testproto.grpc.dummy_pb2_grpc.DeprecatedServiceAsyncStub is deprecated: This service is deprecated [deprecated] +test_negative/negative.py: error: function testproto.test_pb2._DeprecatedEnumEnumTypeWrapper.DEPRECATED_ONE is deprecated: This enum value has been marked as deprecated using proto enum value options. [deprecated] +test_negative/negative.py: error: function testproto.test_pb2._DeprecatedEnumEnumTypeWrapper.DEPRECATED_TWO is deprecated: This enum value has been marked as deprecated using proto enum value options. [deprecated] test_negative/negative.py: error: Argument "implicit_singular" to "Editions2024Test" has incompatible type "None"; expected "str" [arg-type] test_negative/negative.py: error: Argument 1 to "HasField" of "Editions2024Test" has incompatible type "Literal['implicit_singular']"; expected "Literal['default_singular', b'default_singular', 'explicit_singular', b'explicit_singular', 'legacy', b'legacy', 'message_field', b'message_field']" [arg-type] test_negative/negative.py: error: Cannot instantiate abstract class "IncompleteServicer" with abstract attributes "StreamStream", "StreamUnary", "UnaryStream" and "UnaryUnary" [abstract] test_negative/negative.py: error: Argument 2 to "test_hasfield_alias" has incompatible type "Literal['not_a_field']"; expected "Literal['default_singular', b'default_singular', 'explicit_singular', b'explicit_singular', 'legacy', b'legacy', 'message_field', b'message_field']" [arg-type] test_negative/negative.py: error: Argument 2 to "test_clearfield_alias" has incompatible type "Literal['not_a_field']"; expected "Literal['default_singular', b'default_singular', 'explicit_singular', b'explicit_singular', 'implicit_singular', b'implicit_singular', 'legacy', b'legacy', 'message_field', b'message_field']" [arg-type] +test_negative/negative.py: error: Property "message_field" defined in "Editions2024Test" is read-only [misc] test_negative/negative.py: error: Argument 2 to "test_whichoneof_alias" has incompatible type "Literal['not_a_oneof']"; expected "Literal['a_oneof', b'a_oneof']" [arg-type] test_negative/negative.py: error: All overload variants of "DummyServiceStub" require at least one argument [call-overload] test_negative/negative.py: note: Possible overload variants: @@ -139,4 +149,4 @@ test_negative/negative.py: error: No overload variant of "DummyServiceStub" matc test_negative/negative.py: note: Possible overload variants: test_negative/negative.py: note: def __new__(cls, channel: Channel) -> DummyServiceStub test_negative/negative.py: note: def __new__(cls, channel: Channel) -> DummyServiceAsyncStub -Found 105 errors in 4 files (checked 4 source files) +Found 114 errors in 4 files (checked 4 source files)