3 Commits

Author SHA1 Message Date
Adrien
f41934a0e2
Use ruff instead of black+isort (#644)
* Use ruff

* Update .gitignore

* Format code

* Use Ruff on generated code

* Update pre-commit hook

* Wrong commit

* Remove wrong imports

* Update hook

* Format code

* Target Python 3.8

* Reformat

* Pin ruff version
2025-01-03 01:59:43 +00:00
Joshua Leivers
4f18ed1325
Add support for streaming delimited messages (#529)
* Add support for streaming delimited messages

This allows developers to easily dump and load multiple messages
from a stream in a way that is compatible with official
protobuf implementations (such as Java's
`MessageLite#writeDelimitedTo(...)`).

* Add Java compatibility tests for streaming

These tests stream data such as messages to output files, have a
Java binary read them and then write them back using the
`protobuf-java` functions, and then read them back in on the Python
side to check that the returned data is as expected. This checks
that the official Java implementation (and so any other matching
implementations) can properly parse outputs from Betterproto, and
vice-versa, ensuring compatibility in these functions between the
two.

* Replace `xxxxableBuffer` with `SupportsXxxx`
2023-10-16 21:59:33 +11:00
Joshua Leivers
8659c51123
Add message streaming support (#518) 2023-08-29 14:26:25 +01:00