48 Commits

Author SHA1 Message Date
boukeversteegh
3ca75dadd7 Remove dependency on stringcase, apply black 2020-06-11 13:55:12 +02:00
boukeversteegh
f7c2fd1194 Support nested messages, fix casing. Support test-cases in packages. 2020-06-11 13:55:11 +02:00
boukeversteegh
d31f90be6b Combine circular imports 2020-06-04 00:11:22 +02:00
boukeversteegh
7ecf3fe0e6 Add comment to explain unusual import location 2020-06-04 00:02:28 +02:00
boukeversteegh
eeed1c0db7 Extend pre-compiled Duration and Timestamp instead of manual definition 2020-06-03 23:58:47 +02:00
boukeversteegh
e8991339e9 Use pre-compiled wrapper-classes 2020-06-03 23:54:43 +02:00
James Lan
ed33a48d64 Cache field metadata, to avoid calling dataclasses.fields to get more than 10% performance improvement 2020-05-27 15:58:14 -07:00
Nat Noordanus
be2a24d15c blacken 2020-05-27 11:25:00 +02:00
nat
0fe557bd3c
Merge pull request #52 from nat-n/fix_type_imports
Only import types from grpclib when type checking
2020-05-24 19:09:08 +02:00
James Lan
917de09bb6 Replace extra decorator with property and lazy initialization so that it is backward compatible. 2020-05-23 17:36:29 -07:00
James Lan
1f7f39049e Cache resolved classes for fields, so that there's no new data classes generated while deserializing. 2020-05-23 17:36:29 -07:00
James Lan
3d001a2a1a Store the class metadata of fields in the class, to improve preformance
Cached data include,
- lookup table between groups and fields of "oneof" fields
- default value creator of each field
- type hint of each field
2020-05-23 17:36:29 -07:00
Nat Noordanus
91f586f7d7 Apply black formatting 2020-05-22 18:46:43 +02:00
Nat Noordanus
33fb83faad Only import types from grpclib when type checking 2020-05-22 18:41:29 +02:00
Nat Noordanus
5759e323bd Add ability to provide metadata, timeout & deadline args to requests
This is an enhancement of the ServiceStub abstract class that makes
it more useful by making it possible to pass all arguments supported
by the underlying grpclib request function.

It extends to the existing high level API by allowing values to be
set on the stub instance, and the low level API by allowing values
to be set per call.
2020-04-12 22:23:10 +02:00
Nat Noordanus
b2b36c8575 Apply black formatting 2020-04-03 19:54:19 +02:00
Nat Noordanus
203105f048 Add support for python 3.6
Changes:
- Update config and docs to reference 3.6
- Add backports of dataclasses and datetime.fromisoformat for python_version<"3.7"
- Support both 3.7 and 3.6 usages of undocumented __origin__ attribute on typing objects
- Make github ci run tests for python 3.6 as well
2020-04-03 19:52:19 +02:00
Daniel G. Taylor
dbd438e682
Update to emit empty lists if asked for defaults 2020-01-30 17:28:22 -08:00
Daniel G. Taylor
dce1c89fbe
Merge branch 'master' into patch-1 2020-01-30 17:22:47 -08:00
Daniel G. Taylor
c78851b1b8
Merge pull request #12 from ulasozguler/master
Added `include_default_values` parameter to `to_dict` function
2020-01-30 17:19:34 -08:00
Vasilios Syrakis
4554d91f89
Exclude empty lists from to_dict output 2020-01-29 22:32:35 +11:00
ulas
c0170f4d80 Added include_default_values parameter to to_dict function. 2020-01-22 19:16:57 +03:00
Daniel G. Taylor
d8785b4622
Merge pull request #10 from qix/master
Fix serialization of dataclass constructor parameters
2020-01-09 16:35:06 -08:00
Josh Yudaken
d7559c22f8 Fix serialization of dataclass constructor parameters 2020-01-08 11:29:45 -05:00
ulas
f9c351a98d propagate casing param recursively. 2019-12-04 19:28:53 +03:00
Daniel G. Taylor
706bd5a475
Slightly simplify gRPC helper functions 2019-10-28 20:58:33 -07:00
Daniel G. Taylor
16687211a2
Typing fixes 2019-10-27 15:13:51 -07:00
Daniel G. Taylor
eb5020db2a
Fix bool parsing bug 2019-10-27 14:59:38 -07:00
Daniel G. Taylor
035793aec3
Support wrapper types 2019-10-27 14:55:25 -07:00
Daniel G. Taylor
c79535b614
Support Duration/Timestamp Google well-known types 2019-10-26 23:07:30 -07:00
Daniel G. Taylor
5daf61f64c
Refactor default value code 2019-10-25 21:16:32 -07:00
Daniel G. Taylor
ff8463cf12
Handle fields that clash with Python reserved keywords 2019-10-23 21:28:31 -07:00
Daniel G. Taylor
d43d5af5ce
Better JSON casing support, renaming messages/fields 2019-10-23 15:06:34 -07:00
Daniel G. Taylor
5dae20970b
Add OneOf support, rework field detection 2019-10-22 20:44:00 -07:00
Daniel G. Taylor
a5fac1c2ae
Support pass-through of unknown fields 2019-10-19 22:33:31 -07:00
Daniel G. Taylor
b5c1f1aa7c
Support JSON base64 bytes and enums as strings 2019-10-19 12:31:22 -07:00
Daniel G. Taylor
7fe64ad8fe
Doc updates, refactor code layout, python package 2019-10-18 21:14:54 -07:00
Daniel G. Taylor
811b54cabb
Better JSON 64-bit int handling, add way to determine whether a message was sent on the wire, various fixes 2019-10-17 23:36:52 -07:00
Daniel G. Taylor
d93214eccd
Implement basic async gRPC support 2019-10-16 22:55:14 -07:00
Daniel G. Taylor
130acfffa3
Generate __init__.py files 2019-10-12 10:16:05 -07:00
Daniel G. Taylor
dcb7102d92
Implement imports, simplified default value handling 2019-10-12 09:48:40 -07:00
Daniel G. Taylor
7dbaee0cfb
Add support for map value message types 2019-10-10 23:22:50 -07:00
Daniel G. Taylor
e0d1611797
Add basic support for maps 2019-10-10 22:20:57 -07:00
Daniel G. Taylor
ad7162a3ec
Support for repeated message fields 2019-10-09 20:46:16 -07:00
Daniel G. Taylor
1a488faf7a Generate/test refactoring 2019-10-09 17:21:29 -07:00
Daniel G. Taylor
1f46e10ba7 Refactoring 2019-10-08 17:48:53 -07:00
Daniel G. Taylor
c932fbc72c More features, refactoring 2019-10-08 00:23:11 -07:00
Daniel G. Taylor
6ed3b09f44 Initial commit 2019-10-05 08:47:14 -07:00