377 Commits

Author SHA1 Message Date
Sriansh Raj Pradhan
c00bc96db7
Create LICENSE.md (#502) 2023-06-16 19:19:51 +01:00
Nick DeRobertis
fcbd8a3759
Fix pydict serialization for optional fields (#495) 2023-05-28 17:47:52 +01:00
pi-slh
aad7d2ad76
Replace pkg_resources with importlib (#462) 2023-05-25 11:12:15 +01:00
Jinyu Liu
2b41383745
Fix dict encoding for timezone aware datetimes (#468)
Co-authored-by: James Hilton-Balfe <gobot1234yt@gmail.com>
2023-04-13 23:34:19 +01:00
Marek Pikuła
b0b6cd24ad
Fix pydantic_dataclasses reference in README (#474) 2023-04-13 21:56:38 +01:00
James Hilton-Balfe
e7f07fa2a1
Update __init__.py (#451) 2023-03-08 08:20:56 +00:00
Samuel Yvon
2fa0be2141
Fix for #459 (pydantic code gen only) (#460) 2023-02-21 19:41:32 +00:00
Samuel Yvon
13d656587c
Add support for pydantic dataclasses (#406) 2023-02-13 15:37:16 +00:00
James Hilton-Balfe
6df8cef3f0
Fix CI (#456) 2023-02-13 00:20:58 +00:00
James Hilton-Balfe
1b1bd47cb1
Drop support for python3.6 (#444) 2023-02-09 08:35:41 +00:00
Wouter Horré
0adcc9020c
Pythonize input_type name in py_input_message (#436)
Co-authored-by: konstantin <konstantin.klein@hochfrequenz.de>
Co-authored-by: James Hilton-Balfe <gobot1234yt@gmail.com>
Fixes https://github.com/danielgtaylor/python-betterproto/issues/427
Fixes https://github.com/danielgtaylor/python-betterproto/issues/438
2022-12-02 22:18:48 +00:00
sterliakov
bfc0fac754
Enforce serialize_empty for repeated fields (#417) 2022-08-31 18:59:12 +01:00
Antonín Říha
8fbf4476a8
Fix typechecker compatiblity checks in server streaming methods (#413) 2022-08-31 00:05:29 +01:00
Samuel Yvon
591ec5efb3
Pull down the include_default_values argument to to_json (#405) 2022-08-08 14:26:28 +01:00
Antonín Říha
f31d51cf3c
Added support for @generated marker (#382) 2022-08-03 11:05:13 +01:00
James Hilton-Balfe
496eba2750
Bump version to b5 (#404) 2022-08-02 09:23:44 +10:00
James Hilton-Balfe
d663a318b7
Release v.2.0.0b5 (#350)
* Implement Message.__bool__ for #130
* Add __bool__ to special members
* Tweak __bool__ docstring
* remove compiler: prefix

Co-authored-by: nat <n@natn.me>
2022-08-02 08:59:44 +10:00
Justin Torre
2fb37dd108
Update Jinja 2 version (#402) 2022-08-01 10:44:37 +01:00
Vasile Razdalovschi
42d2df6de6
Fix broken link in readme to tests (#400) 2022-07-14 13:14:05 +01:00
James Hilton-Balfe
3fd5a0d662
Fix parameters missing from services (#381) 2022-07-06 19:05:40 +01:00
MatejKastak
bc13e7070d
Fix link to google files (#392) 2022-06-16 16:08:39 +01:00
Flynn
6536181902
Add to/from_pydict methods (#203)
* add to/from_pydict methods

* Remove unnecessary method call

* Fix formatting

Co-authored-by: James Hilton-Balfe <gobot1234yt@gmail.com>
2022-05-09 17:34:12 +01:00
GrownNed
85e4be96d8
fix Message.to_dict mutating the underlying Message (#378)
* [fix] to_dict modifies the underlying message (#151)

* add test for mapmessage

* fix for to_dict

* formatting

* Apply suggestions from code review

Co-authored-by: Arun Babu Neelicattu <arun.neelicattu@gmail.com>

* change to_json to to_dict

Co-authored-by: Arun Babu Neelicattu <arun.neelicattu@gmail.com>
2022-05-09 17:29:42 +01:00
efokschaner
06c26ba60d
tests: Lazy evaluate Deadline parameter in pytest (#380)
The pytest parameters are evaluated when the tests are loading.
The Deadline.from_timeout is a fixed point in time. 
By deferring the evaluation it helps ensure that the deadline is not reached before the test is executed.
2022-04-30 23:11:21 +01:00
James Hilton-Balfe
6a70b8e8ea
compiler: do not overwrite top level __init__.py
Resolves: #168 #260
2022-04-24 01:44:16 +02:00
James Hilton-Balfe
3ca092a724
Fix is_set for optional proto3 fields 2022-04-24 01:37:15 +02:00
James Hilton-Balfe
6f7d706a8e
fix float nan comparison
This change also adds minor docstrings fixes and bumps pre-commit blac
version.
2022-04-24 01:13:58 +02:00
James Hilton-Balfe
ac96d8254b
Add a minimal repro for #312 (#340) 2022-04-22 11:04:40 +01:00
Max
e7133adeb3
fix: map field edge-case
This change ensures a parent is a nested type when checking if a field is a map.
2022-04-22 11:06:44 +02:00
Pavel Savchenko
204e04dd69 Update README.md
linebreak after bullet-point, and remove redundant conjunction at the start of the section
2022-04-22 10:57:35 +02:00
James Hilton-Balfe
b9b0b22d57
Make Message.__getattribute__ invisible to type checkers (#359)
This lets linters know that we shouldn't access fields that aren't actually defined
2022-04-21 15:44:55 +01:00
James Hilton-Balfe
402c21256f
Fix unicodefun import error in black (#366) 2022-04-16 22:15:14 +01:00
Gabriel Pajot
5f7e4d58ef
Fix documentation for nested enums (#351) 2022-03-18 22:36:27 +00:00
Arun Babu Neelicattu
1aaf7728cc
compiler: Run isort on compiled code (#355) 2022-03-18 22:29:42 +00:00
Arun Babu Neelicattu
70310c9e8c
pre-commit: add isort hook and apply (#354) 2022-03-17 00:01:17 +00:00
Arun Babu Neelicattu
18a518efa7
Expose timeout, deadline and metadata parameters from grpclib (#352) 2022-03-13 22:34:11 +00:00
Arun Babu Neelicattu
62da35b3ea
parser: ensure prefix is separated when traversing (#353) 2022-03-12 09:08:03 +00:00
Arun Babu Neelicattu
69f4192341
Fix incorrect deprecation warnings on defaults (#348)
This change ensures that deprecation warnings are only raised when
either a deprecated field is explicitly set or a deprecated message is
initialised.

Resolves: #347
2022-03-11 23:36:14 +00:00
Arun Babu Neelicattu
9c1bf25304
tests.generate: stop using asyncio.get_event_loop (#349)
The use of `asyncio.get_event_loop()` has been deprecated in python 3.10+. We replace this usage with `asyncio.run()` for python 3.7+.
2022-03-03 18:11:57 +00:00
Arun Babu Neelicattu
a836fb23bc
Configure pre-commit for project (#346) 2022-03-03 18:10:01 +00:00
Arun Babu Neelicattu
bd69862a02
test input: use explicit package declaration (#345) 2022-03-03 13:34:53 +00:00
James Hilton-Balfe
74205e3319
Implement __deepcopy__ for Message (#339) 2022-02-16 23:12:51 +00:00
James Hilton-Balfe
3f377e3bfd
Remove the poetry.lock (#338) 2022-02-15 15:37:47 +00:00
Eitan Mosenkis
8c727d904f
Fix from_dict() in the presence of optional datetime fields. (#329) 2022-02-03 09:00:56 +00:00
Eitan Mosenkis
eeddc844a5
Bump Jinja2 to 3.0.3. (#330) 2022-02-01 08:32:25 +00:00
Michael Osthege
9b5594adbe
Format field comments also as docstrings (#304)
Closes #303

* Format field comments also as docstrings
To make it clear that they refer to the item above.
* Fix placement of enum item docstrings
* Add line breaks after class attribute or enum item docstrings
2022-01-27 09:25:48 +11:00
Danil Akhtarov
d991040ff6
Fix message text in NotImplementedError (#325) 2022-01-21 11:39:09 +00:00
efokschaner
d260f071e0
Client and Service Stubs take 1 request parameter, not one for each field (#311) 2022-01-17 19:58:57 +01:00
James Hilton-Balfe
6dd7baa26c
Release v2.0.0.b4 (#307)
Co-authored-by: Kalan <22137047+kalzoo@users.noreply.github.com>
v2.0.0b4
2022-01-03 18:18:44 +00:00
Kalan
573c7292a6
Add Python 3.10 to GitHub Actions test matrix (#280)
Co-authored-by: James Hilton-Balfe <50501825+Gobot1234@users.noreply.github.com>
2021-12-29 23:10:34 +00:00