* Serialize default values in oneofs when calling to_dict() or to_json()
This change is consistent with the official protobuf implementation. If
a default value is set when using a oneof, and then a message is
translated from message -> JSON -> message, the default value is kept in
tact. Also, if no default value is set, they remain null.
* Some cleanup + testing for nested messages with oneofs
* Cleanup oneof_enum test cases, they should be fixed
This _should_ address:
https://github.com/danielgtaylor/python-betterproto/issues/63
* Include default value oneof fields when serializing to bytes
This will cause oneof fields with default values to explicitly be sent
to clients. Note that does not mean that all fields are serialized and
sent to clients, just those that _could_ be null and are not.
* Remove assignment when populating a sub-message within a proto
Also, move setattr out one indentation level
* Properly transform proto with empty string in oneof to bytes
Also, updated tests to ensure that which_one_of picks up the set field
* Formatting betterproto/__init__.py
* Adding test cases demonstrating equivalent behaviour with google impl
* Removing a temporary file I made locally
* Adding some clarifying comments
* Fixing tests for python38
* re-implement README gRPC client example to be a self-contained script
- fix a syntax error
- fix a usage error
* asyncio.run() was added in 3.7
- this lib targets >= 3.6
* Apply suggestions from code review
Optimized imports, store RPC call result before printing
Co-authored-by: Arun Babu Neelicattu <arun.neelicattu@gmail.com>
* add entry-point check to example
Co-authored-by: Arun Babu Neelicattu <arun.neelicattu@gmail.com>
- replace some usages of `==` with `is`
- use available constants instead of magic strings for type names
Co-authored-by: nat <nat.noordanus@gmail.com>
This change removes the dependency on platform provided protobuf tools
in favour of `grpcio-tools` dependency. This makes both development and
compiler use independent from platform dependencies.
- fix few typos
- remove unused imports
- fix minor code-quality issues
- replace `grpclib._protocols` with `grpclib._typing`
- fix boolean and None assertions in test cases