-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cherry-pick latest updates from betterproto #10
Merged
ClausHolbechArista
merged 11 commits into
aristanetworks:main
from
ClausHolbechArista:cherry-pick
Apr 30, 2024
Merged
Cherry-pick latest updates from betterproto #10
ClausHolbechArista
merged 11 commits into
aristanetworks:main
from
ClausHolbechArista:cherry-pick
Apr 30, 2024
Conversation
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
* betterproto: support `Struct` and `Value` Signed-off-by: William Woodruff <[email protected]> * betterproto: handle struct in to_dict as well Signed-off-by: William Woodruff <[email protected]> * tests: add Struct roundtrip tests Signed-off-by: William Woodruff <[email protected]> * specialize from_dict and to_dict on Struct ...rather than special-casing in the Message ABC. Signed-off-by: William Woodruff <[email protected]> * betterproto: `poe format` Signed-off-by: William Woodruff <[email protected]> * Update src/betterproto/__init__.py Co-authored-by: James Hilton-Balfe <[email protected]> * remove future annotations Signed-off-by: William Woodruff <[email protected]> * replace type[...] with typing.T Signed-off-by: William Woodruff <[email protected]> * quote instead Signed-off-by: William Woodruff <[email protected]> --------- Signed-off-by: William Woodruff <[email protected]> Co-authored-by: James Hilton-Balfe <[email protected]>
Removed the parts of the example that showed accessing an unset value, as it now raises an `AttributeError`, and added an example of the `match` way of accessing the attributes. Related to #510 and #358.
PLACEHOLDER is a specific instance of an object, the test here should be "is not" instead of "!=" I am experimenting with adding ndarray support, and the equality test here causes problems.
* ci: Use GITHUB_OUTPUT envvar instead of set-output command * Quote envvar to match documentation
* Add betterproto.Enum __copy__ and __deepcopy__ implementations betterproto.Enum is missing __copy__ and __deepcopy__ implementations, which were recently added to enum.Enum, see python/cpython#106602 This fixes the bug where betterproto messages with Enums nested within cannot be copied via copy.deepcopy. * Type hint on Enum.__copy__ Co-authored-by: James Hilton-Balfe <[email protected]> * Type hint on Enum.__deepcopy__ Co-authored-by: James Hilton-Balfe <[email protected]> --------- Co-authored-by: James Hilton-Balfe <[email protected]>
* feat: pydantic version of google pb * fix: patch pb Struct to support json, dict rountrip * fix: pydantic-version google pb, json, dict rntrip * chore: remove `@generated`, remove gen, code fmt * chore: test case for pydantic-version google pb
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
betterproto