Replace the deprecated `pytest.warns(None)` with the suggested
replacement (from https://github.com/pytest-dev/pytest/issues/9404)
to make the test suite forward compatible with pytest-8. This works
correctly with pytest-6 as well.
* Bump version to 2.0.0b7
* chore: changes to changelog from PR comments
* chore: grammar fix
* Add entry for #596
* Apply suggestions from code review
---------
Co-authored-by: James Hilton-Balfe <gobot1234yt@gmail.com>
* Add test
* To run the workflow
* Fix import
* Format
* Add warning
* Fix indentation
* Test deprecated method
* More test
* Format
* Add import if needed
---------
Co-authored-by: Adrien Vannson <adrien.vannson@gardacp.com>
* Pydantic V2 support
* Support Python 3.8
* Mark as classmethod
* Remove max int validation
* Run poe format
* Merge develop
* Revert dataclasses import
* Fix revert
* Drop 3.7 from ci
Currently, CI is broken for 3.7 as github runs its macos images on arm and doesn't provide arm images for 3.7. As 3.7 is deprecated the best (at least interim) solution would be to drop 3.7 checks entirely.
* 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
* Add betterproto.Enum __copy__ and __deepcopy__ implementations
betterproto.Enum is missing __copy__ and __deepcopy__ implementations, which were recently added to enum.Enum, see https://github.com/python/cpython/issues/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 <gobot1234yt@gmail.com>
* Type hint on Enum.__deepcopy__
Co-authored-by: James Hilton-Balfe <gobot1234yt@gmail.com>
---------
Co-authored-by: James Hilton-Balfe <gobot1234yt@gmail.com>
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.
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.
* betterproto: support `Struct` and `Value`
Signed-off-by: William Woodruff <william@trailofbits.com>
* betterproto: handle struct in to_dict as well
Signed-off-by: William Woodruff <william@trailofbits.com>
* tests: add Struct roundtrip tests
Signed-off-by: William Woodruff <william@trailofbits.com>
* specialize from_dict and to_dict on Struct
...rather than special-casing in the Message ABC.
Signed-off-by: William Woodruff <william@trailofbits.com>
* betterproto: `poe format`
Signed-off-by: William Woodruff <william@trailofbits.com>
* Update src/betterproto/__init__.py
Co-authored-by: James Hilton-Balfe <gobot1234yt@gmail.com>
* remove future annotations
Signed-off-by: William Woodruff <william@trailofbits.com>
* replace type[...] with typing.T
Signed-off-by: William Woodruff <william@trailofbits.com>
* quote instead
Signed-off-by: William Woodruff <william@trailofbits.com>
---------
Signed-off-by: William Woodruff <william@trailofbits.com>
Co-authored-by: James Hilton-Balfe <gobot1234yt@gmail.com>