-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
### Added - Support for the `google.protobuf.Value` message
- Loading branch information
1 parent
85ee496
commit 374d8fe
Showing
21 changed files
with
445 additions
and
160 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
__version__ = '5.2.0' | ||
__version__ = '5.3.0' | ||
|
||
__author__ = 'Thordur Matthiasson <[email protected]>' | ||
__license__ = 'MIT License' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,7 +37,8 @@ def dataclass_to_dict(dc) -> Dict: | |
for field in dataclasses.fields(dc): | ||
dicted = _dataclass_field_to_dict_field(field, dc) | ||
# if dicted: | ||
if dicted is not None: # TODO([email protected]>) 2024-04-15: To include "default/empty" fields or not? | ||
# if dicted is not None: # TODO([email protected]>) 2024-04-15: To include "default/empty" fields or not? | ||
if dicted is not ...: | ||
d[_get_proto_field_name(field)] = dicted | ||
|
||
return d | ||
|
@@ -50,10 +51,11 @@ def _get_proto_field_name(field: dataclasses.Field): | |
def _dataclass_field_to_dict_field(field: dataclasses.Field, dc): | ||
val = getattr(dc, field.name) | ||
|
||
dictator_cls = field.metadata.get('dictator', dictators.BaseDictator) | ||
|
||
if val is None: | ||
return None | ||
|
||
dictator_cls = field.metadata.get('dictator', dictators.BaseDictator) | ||
is_obj = field.metadata.get('is_obj', False) | ||
is_list = field.metadata.get('is_list', False) | ||
is_map = field.metadata.get('is_map', False) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
neobuilder >=5.3, <6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
neobuilder >=5.2.0-rc.1, <6 | ||
Jinja2 >=3.1, <4 | ||
semver >= 3.0.2, <4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
ccptools >= 1.1, <2 | ||
|
||
protobuf >=5.28.2, <6 | ||
grpcio >=1.66.1, <2 | ||
grpcio-tools >=1.66.1, <2 | ||
googleapis-common-protos >=1.65, <2 | ||
protobuf == 5.27.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
syntax = "proto3"; | ||
|
||
package sandbox.test; | ||
|
||
|
||
// This should collide with `typing.Type` when used with `from typing import *` | ||
message Type { | ||
int32 type_id = 1; | ||
string name = 2; | ||
} | ||
|
||
|
||
// This should collide with `typing.Collection` when used with `from typing import *` | ||
message Collection { | ||
string name = 1; | ||
|
||
// Not sure if this causes issues though :D | ||
repeated Type types = 2; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.