Releases: bufbuild/protovalidate-python
v1.1.0
This release is compatible with the v1.1.0 release of Protovalidate.
What's Changed
- Drop Python 3.9 support by @stefanvanburen in #384
- Add support for Python 3.14 by @stefanvanburen in #379
- Make it so that you can define expression-only rules by @srikrsna-buf in #396
- Update protovalidate by @srikrsna-buf in #397
New Contributors
- @AdrienVannson made their first contribution in #393
Full Changelog: v1.0.0...v1.1.0
v1.0.0
Protovalidate is now v1.0
After two years of development, Protovalidate has reached v1.0, marking our commitment to stability and production readiness.
Read more in our blog post. Get started at https://protovalidate.com.
What's Changed
There are no functional changes compared to the previous release.
- Convert tests to pytest by @stefanvanburen in #366
- Bump actions/setup-go from 5 to 6 by @dependabot[bot] in #369
- Minor tweaks / cleanup by @stefanvanburen in #370
- Bump protovalidate version to v1.0.0 by @stefanvanburen in #372
- Use lowest-direct dependency resolution by default by @stefanvanburen in #373
Full Changelog: v0.15.0...v1.0.0
v0.15.0
Another day, another release — this time, moving to v0.15.0 as we've bundled a couple of breaking changes into one release (we hope these are the last for awhile)!
Breaking Changes
- Removed the
protovalidate.Configclass (#364)- Moved back to providing the
fail_fastkwarg to eithervalidateorcollect_validations
- Moved back to providing the
- Removed
collect_validations(..., into=)argument (#365)- Let us know if you were using / have a usecase for this!
- Made
google-re2a required dependency (#363)- This keeps our regex implementation compliant with CEL, and removes the need for the
re2extra that was added in v0.14.0.google-re2supplies wheels for all supported versions of Python, so this shouldn't be an issue, but please let us know if you have issues!
- This keeps our regex implementation compliant with CEL, and removes the need for the
What's Changed
- Improve typing by @stefanvanburen in #359
- Fix timestamp typing by @stefanvanburen in #360
- Make
google-re2required dependency by @stefanvanburen in #363 - Remove Config class in favor of fail_fast kwargs by @stefanvanburen in #364
- Remove collect_violations(..., into=) argument by @stefanvanburen in #365
Full Changelog: v0.14.1...v0.15.0
v0.14.1
This release fixes a bug with concatenated values (#354 + #357), and adds back support for protobuf==5 (#358). We plan to support protobuf==5 until protobuf==7 is released.
What's Changed
- Update links to buf.build/docs to use protovalidate.com by @jrinehart-buf in #331
- Bump actions/download-artifact from 4 to 5 by @dependabot[bot] in #349
- Add
buf formatto Makefileformattarget by @stefanvanburen in #348 - Fix Makefile dependencies by @stefanvanburen in #350
- Pin local Python version to lowest supported by @stefanvanburen in #351
- Bump actions/checkout from 4 to 5 by @dependabot[bot] in #352
- Fix instance check for concatenated values by @stefanvanburen in #354
- Add dependency resolution to test matrix by @stefanvanburen in #355
- Simplify
isinstancecall inextra_func.pyby @engnatha in #357 - Support protobuf==5 by @stefanvanburen in #358
New Contributors
Full Changelog: v0.14.0...v0.14.1
v0.14.0
Breaking Changes
Config option for custom regex removed
We have removed the regex_matches_func from the config. Now that google-re2 has pre-built binaries for Python 3.13, re2 can be fully supported inside protovalidate-python. Users no longer need to bring-their-own-re2.
To use re2 syntax, install protovalidate-python with an extra dependency on re2 as follows:
pip install protovalidate[re2]For more context, see PR #346
What's Changed
- Add re2 as optional dependency (#346) by @smaye81 in #346
- Set up trusted publishing by @stefanvanburen in #345
- Fix descriptor pool TODO by @stefanvanburen in #343
- Drop custom matcher & config by @stefanvanburen in #342
This release is compatible with protovalidate v0.14.0.
Full Changelog: v0.13.0...v0.14.0
v0.13.0
This release is compatible with the v0.14.0 release of Protovalidate.
Breaking changes
We want validation rules to be easy to understand for authors and consumers. To simplify Protovalidate, we are renaming an option and remove two others. This is a breaking change, and you will have to update your Protobuf files if they use the relevant options :
IGNORE_IF_UNPOPULATEDis renamed toIGNORE_IF_ZERO_VALUE.
See bufbuild/protovalidate#397 for details.(buf.validate.message).disabledis removed.
You can replace it by addingIGNORE_ALWAYSto every field of the message. See bufbuild/protovalidate#394 for details.IGNORE_IF_DEFAULT_VALUEis removed.
In most cases, you can replace it withIGNORE_IF_ZERO_VALUE. See bufbuild/protovalidate#396 for details.
Full Changelog: v0.12.0...v0.13.0
v0.12.0
Breaking Changes
New API for creating a validator and running validation.
Users can now specify a Config object when explicitly creating a validator, allowing for configuring validation logic. Currently, the two available options are:
fail_fast (bool): If True, validation stops after the first failure.
regex_matches_func (Callable[[str, str], bool): An optional function for overriding this library's matches logic for regular expressions.
Example:
from protovalidate import Config, Validator
cfg = Config(fail_fast=True)
validator = protovalidate.Validator(config=cfg)
validator.validate(msg)As a result of the above, we have removed the fail_fast parameter from the validate and collect_violations methods on a validator. Users should instead use the above config approach.
Flagging invalid re2 syntax
Usage of invalid re2 syntax will now throw an evaluation error. While the CEL spec specifies that regular expressions should follow the re2 syntax, the underlying regex engine in protovalidate-python is still Python's re package. This is because there is currently no pre-built binary that supports Python 3.13 (issue).
So, to get as close as possible until then, we are flagging invalid re2 syntax used in regular expressions. Users can also choose to override this and bring their own re2 engine by using the config approach above.
What's Changed
- Add ability to specify custom regex matcher by @smaye81 in #325
- Add the ability to specify a config to validators by @smaye81 in #323
- Implement matches override by @smaye81 in #319
This release is compatible with protovalidate v0.13.3.
Full Changelog: v0.11.0...v0.12.0
v0.11.0
What's Changed
- Validate
MessageOneofRuleby @smaye81 in #320 - Add implicit
IGNORE_IF_UNPOPULATEDforMessageOneofRulefields by @srikrsna-buf in #321
This release is compatible with protovalidate v1.0.0-rc.4.
New Contributors
- @srikrsna-buf made their first contribution in #321
Full Changelog: v0.10.0...v0.11.0
v0.10.0
What's Changed
- Implement MessageOneofRule by @timostamm in #317
This release is compatible with protovalidate v1.0.0-rc.2.
Full Changelog: v0.9.0...v0.10.0
v0.9.0
Breaking Changes
String formatting is now conformant with the CEL spec.
As a result, some formatting output may differ from previous versions. See #307 and #308 for details on formatting changes.
What's Changed
- Add supplemental format conformance tests by @smaye81 in #308
- Add conformance testing to string.format implementation by @smaye81 in #307
Full Changelog: v0.8.0...v0.9.0