Mypy-protobuf

Latest version: v3.6.0

Safety actively analyzes 629639 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 4 of 5

1.24

- Bump required mypy version to 0.800
- Bump required protobuf version to 3.14 (pi!!)
- Update the autogenerated `.pyi` file header to cite `mypy-protobuf`
- Reorganize mypy-protobuf testsuite files to more closely match autogeneration into a `generated` directory
- Remove incorrect `type___` prefixed alias for inner enum type wrappers
- Add support for extension fields in proto2 messages
- Overwrite typing for `Message.Extensions` mapping to support better type inference for proto2 message extensions
- Support `Message.HasExtension` and `Message.ClearExtension`
- Bump python-protobuf from 3.11.3 to 3.13.0
- Add support for optional proto3 fields
- Support ScalarMap and MessageMap generated types for map types in proto. This will allow us to support `get_or_create`

proto
message Message {
map<int32, OuterMessage3> map_message = 17
}


and

python
message.map_message.get_or_create(0)

1.23

- Inherit FromString from superclass Message - rather than re-generating here. Fixes bug
in python2 usage `google/protobuf/type_pb2.pyi:92: error: Argument 1 of "FromString" is incompatible with supertype "Message"; supertype defines the argument type as "ByteString" [override]`

1.22

python
ProtoEnum: _ProtoEnum
class _ProtoEnum(google.protobuf.EnumTypeWrapper):
def Value(self, name: str) -> ProtoEnumValue


- Remove autogenerated EnumTypeWrapper methods that are redundant to the typeshed parent class. Added testing for these.

1.21

python
from msg_pb2 import ProtoEnum, ProtoMsg

def make_proto_msg(enum: 'msg_pb2.ProtoEnumValue') -> ProtoMsg:
return ProtoMsg(enum)
make_proto_msg(ProtoMsg.FIRST)


- Use inline-style rather than comment-style typing in the pyi file
- Remove MergeFrom/CopyFrom from generated code as it is in the Message superclass

1.20

- Black code formatting
- Fix message/field name aliasing when field name matches a message/enum name

1.19

- Allow omitting required proto2 fields from constructor parameters
- Support and testing for python 3.8
- Support for python-protobuf to 3.11.3

Page 4 of 5

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.