Releases: bufbuild/protovalidate-python
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_UNPOPULATED
is renamed toIGNORE_IF_ZERO_VALUE
.
See bufbuild/protovalidate#397 for details.(buf.validate.message).disabled
is removed.
You can replace it by addingIGNORE_ALWAYS
to every field of the message. See bufbuild/protovalidate#394 for details.IGNORE_IF_DEFAULT_VALUE
is 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
MessageOneofRule
by @smaye81 in #320 - Add implicit
IGNORE_IF_UNPOPULATED
forMessageOneofRule
fields 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
v0.8.0
What's Changed
protovalidate-python is now conformant with protovalidate v0.11.0, sans current known limitations (higher resolution timestamps/durations, which are not currently supported by the CEL implementation.) Various dependencies are also updated.
- Various maintenance by @stefanvanburen in #261
- Bump pytest from 8.3.4 to 8.3.5 by @dependabot in #263
- Bump ruff from 0.9.7 to 0.11.7 by @dependabot in #262, #264, #267, #270, #278, #289, #293
- Bump types-protobuf from 5.29.1.20250208 to 5.29.1.20250403 by @dependabot in #266, #279
- Bump protobuf from 5.29.3 to 6.30.2 by @dependabot in #265, #276
- Update to protovalidate 0.11.0 by @timostamm, @smaye81 in #268, #280, #291
- Prepare GitHub docs for shift to buf.build/docs by @jrinehart-buf in #260
- Move unit tests to local protos by @smaye81 in #288
- Upgrade validation logic by @smaye81 in #275
- Implement getField CEL function by @jchadwick-buf in #290
- Fix various v0.11.0 conformance issues by @jchadwick-buf in #294
New Contributors
- @jrinehart-buf made their first contribution in #260
Full Changelog: v0.7.1...v0.8.0
v0.7.1
The biggest change in this release is the upgrade to cel-python 0.2.0, which should help with some of the extraneous logging that users may have noticed.
What's Changed
- Bump mypy from 1.14.1 to 1.15.0 by @dependabot in #250
- Bump types-protobuf from 5.29.1.20241207 to 5.29.1.20250208 by @dependabot in #251
- Bump ruff from 0.9.4 to 0.9.5 by @dependabot in #249
- Bump ruff from 0.9.5 to 0.9.6 by @dependabot in #253
- Pass
--strict_message
conformance (minus duration/timestamp) by @stefanvanburen in #256 - Bump gencode to 29.3 by @stefanvanburen in #258
- Bump ruff from 0.9.6 to 0.9.7 by @dependabot in #259
- Upgrade cel-python to 0.2.0 by @stefanvanburen in #252
Full Changelog: v0.7.0...v0.7.1
v0.7.0
Breaking Changes
v0.7.0 removes support for the long-deprecated ignore_empty
and skipped
fields on FieldConstraints
; protovalidate-python will no longer respect these options if they are set, and they are removed from the latest version of the protovalidate definitions.
What's Changed
- Bump ruff from 0.9.1 to 0.9.4 by @dependabot in #244, #245, #247
- Add URN validation by @smaye81 in #248
- Remove support for deprecated options by @jchadwick-buf in #246
New Contributors
Full Changelog: v0.6.1...v0.7.0
v0.6.1
The biggest change in this release is the support of PEP 561 (marking protovalidate
as having type information inline), which should make usage of protovalidate
with tools like mypy
more seamless — see #243 for more details. Other than that, it's mostly dependency updates.
If coming from a release pre-v0.6.0, make sure to check out the release notes for that release when upgrading!
What's Changed
- Bump protobuf from 5.29.0 to 5.29.1 by @dependabot in #225
- Bump types-protobuf from 5.28.3.20241030 to 5.29.1.20241207 by @dependabot in #226
- Bump ruff from 0.8.1 to 0.8.3 by @dependabot in #228
- Fix README cel expression by @stefanvanburen in #230
- Bump mypy from 1.13.0 to 1.14.0 by @dependabot in #231
- Bump ruff from 0.8.3 to 0.8.4 by @dependabot in #232
- Bump protobuf from 5.29.1 to 5.29.2 by @dependabot in #233
- Bump gencode version to 29.2 by @stefanvanburen in #234
- Bump mypy from 1.14.0 to 1.14.1 by @dependabot in #236
- Bump ruff from 0.8.4 to 0.8.6 by @dependabot in #235
- Bump ruff from 0.8.6 to 0.9.1 by @dependabot in #239
- Bump Pipfile python_version to 3.9 and re-lock by @stefanvanburen in #240
- Add PEP 561 type support by @stefanvanburen in #243
Full Changelog: v0.6.0...v0.6.1