Skip to content

[Python] Protobuf python generated pb2 files are without typing files #16115

@matejsp

Description

@matejsp

Please generate with pyi files for python for builtin types.

Currently we have a lot of errors using those types with pylint and need to ignore checking:

'google.protobuf.timestamp_pb2' has no 'Timestamp' member .
image

What version of protobuf and what language are you using?
Version: 4.25.2 (from pypi)
Language: Python

What operating system (Linux, Windows, ...) and version?
MacOSX, Linux

What runtime / compiler are you using (e.g., python version or gcc version)
python 3.11.2

What did you do?

import "google/protobuf/timestamp.proto";

message SomeMessage {
  google.protobuf.Timestamp timestamp = 2;
}

python -m grpc_tools.protoc -I. --python_out=. --pyi_out=. --grpc_python_out=. *.proto

What did you expect to see
Protobuf should include pyi files and pass pylint validation when using timestampa type.

What did you see instead?

'google.protobuf.timestamp_pb2' has no 'Timestamp' member .

Anything else we should know about your project / environment
/

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions