Releases: bufbuild/protovalidate-python
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_messageconformance (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
v0.6.0
Breaking Changes
protovalidate.ValidationError has changed. The violations property is now a list of protovalidate.Violation, instead of a protobuf buf.validate.Violations message. In most cases, code will need to be updated like this:
violations = protovalidate.collect_violations(msg)
- print(violations.violations[0].constraint_id)
+ print(violations[0].proto.constraint_id)The ValidationError.errors() method is removed in favor of the violations property, and a new ValidationError.to_proto() method is added to return the equivalent buf.validate.Violations.
In addition to containing the buf.validate.Violation protobuf message under the property proto, the new protovalidate.Violation class contains additional in-memory information about the violation which cannot be serialized to the wire:
field_value: Contains the value of the field failing validation, if there is a field corresponding to the violation.rule_value: Contains the value of the rule failing validation, if there is a rule corresponding to the violation.
Take, for example, the following protobuf message schema:
message User {
string email = 1 [(buf.validate.field).string.email = true];
}If you try to validate the message User(email="invalid"), the field_value will be "invalid" and the rule_value will be True.
Some violations do not correspond directly to a field, such as a message constraint failure; in these cases, the field_value will be None.
What's Changed
- Regenerate protos by @stefanvanburen in #198
- Update README for buf v2 commands/config by @stefanvanburen in #197
- Bump generated code to latest version by @stefanvanburen in #201
- Add explicit Python 3.13 support by @stefanvanburen in #204
- Bump mypy from 1.11.1 to 1.13.0 by @dependabot in #207
- Drop Python 3.8 support by @stefanvanburen in #209
- Update protovalidate to v0.8.2 by @jchadwick-buf in #216
- Bump tomli from 2.0.2 to 2.1.0 by @dependabot in #214
- Implement structured field and rule paths for violations by @jchadwick-buf in #217
- Bump ruff from 0.5.5 to 0.8.1 by @dependabot in #219
- Bump pytest from 8.3.2 to 8.3.4 by @dependabot in #222
- Bump tomli from 2.1.0 to 2.2.1 by @dependabot in #221
- Bump protobuf from 5.27.3 to 5.29.0 by @dependabot in #220
- Add rule and field value to violations by @jchadwick-buf in #224
Full Changelog: v0.5.0...v0.6.0
v0.5.0
Adds support for custom predefined field constraints. See the protovalidate documentation for more information.
Updates protovalidate to v0.8.1. Note that this is a breaking change. You may need to make some adjustments to your code:
- Code that imports
buf.validate.expression_pb2orbuf.validate.priv.private_pb2should now only importbuf.validate.validate_pb2. buf.validate.priv.private_pb2.fieldwas moved tobuf.validate.validate_pb2.predefined
Note
This release updates protovalidate-python to use Protobuf Python v5+, which is not currently compatible with Protobuf Python v4 gencode. If you can not update to Protobuf Python v5 currently, you should continue to use protovalidate-python v0.3.1 for now.
What's Changed
- Implement predefined field constraints by @jchadwick-buf in #189
Full Changelog: v0.4.0...v0.5.0
v0.4.0
This release adds support for the string.host_and_port CEL utility function and Protobuf Editions, and bumps the versions of many of the dependencies.
Note
This release updates protovalidate-python to use Protobuf Python v5+, which is not currently compatible with Protobuf Python v4 gencode. If you can not update to Protobuf Python v5 currently, you should continue to use protovalidate-python v0.3.1 for now.
What's Changed
- Bump actions/setup-go from 4 to 5 by @dependabot in #109
- Bump actions/setup-python from 4 to 5 by @dependabot in #108
- Create add-to-project workflow by @chrispine in #131
- Add string.host_and_port support by @rodaine in #132
- Bump pytest from 7.4.3 to 8.1.1 by @dependabot in #144
- Bump mypy from 1.7.1 to 1.9.0 by @dependabot in #143
- Bump actions/download-artifact from 3 to 4 by @dependabot in #114
- Bump actions/upload-artifact from 3 to 4 by @dependabot in #115
- Document import path for code generation by @emcfarlane in #153
- Bump aiohttp from 3.9.1 to 3.9.4 by @dependabot in #151
- Bump idna from 3.6 to 3.7 by @dependabot in #150
- Bump morrisoncole/pr-lint-action from 1.7.0 to 1.7.1 by @dependabot in #136
- Bump types-protobuf from 4.24.0.4 to 5.26.0.20240422 by @dependabot in #154
- Bump requests from 2.31.0 to 2.32.2 by @dependabot in #149
- Test 3.12 by @emcfarlane in #148
- Bump ruff from 0.1.7 to 0.4.9 by @dependabot in #157
- Switch from
blacktoruff formatby @stefanvanburen in #162 - Bump ruff from 0.4.9 to 0.5.0 by @dependabot in #168
- Update for Protobuf Editions by @jchadwick-buf in #174
New Contributors
- @chrispine made their first contribution in #131
- @emcfarlane made their first contribution in #153
- @stefanvanburen made their first contribution in #162
- @jchadwick-buf made their first contribution in #174
Full Changelog: v0.3.1...v0.4.0
v0.3.1
What's Changed
- Fix behavior of required + ignore_empty constraints by @rodaine in #97
- Bump ruff from 0.1.3 to 0.1.4 by @dependabot in #94
- Bump protobuf from 4.24.4 to 4.25.0 by @dependabot in #95
- Fix JSON formatting in README.md by @kyleconroy in #98
- Combined dependencies PR by @rodaine in #102
- Support Python >=3.10 by @Alfus in #111
- Support Python >=3.8 by @Alfus in #112
New Contributors
- @rodaine made their first contribution in #97
- @kyleconroy made their first contribution in #98
Full Changelog: v0.3.0...v0.3.1
v0.3.0
What's Changed
- Bump actions/checkout from 3 to 4 by @dependabot in #71
- Bump protobuf from 4.24.1 to 4.24.3 by @dependabot in #72
- Bump black from 23.7.0 to 23.9.1 by @dependabot in #73
- Bump pytest from 7.4.0 to 7.4.2 by @dependabot in #74
- Bump types-protobuf from 4.24.0.1 to 4.24.0.2 by @dependabot in #76
- Bump urllib3 from 2.0.4 to 2.0.6 by @dependabot in #79
- Bump ruff from 0.0.285 to 0.0.292 by @dependabot in #80
- Support only Python 3.11+ by @akshayjshah in #90
- Add isIpPrefix by @higebu in #78
New Contributors
Full Changelog: v0.2.1...v0.3.0