protovalidate-unofficial 1.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of protovalidate-unofficial might be problematic. Click here for more details.

Files changed (142) hide show
  1. protovalidate_unofficial-1.1.0/.gitattributes +1 -0
  2. protovalidate_unofficial-1.1.0/.github/CODE_OF_CONDUCT.md +132 -0
  3. protovalidate_unofficial-1.1.0/.github/CONTRIBUTING.md +154 -0
  4. protovalidate_unofficial-1.1.0/.github/ISSUE_TEMPLATE/bug_report.md +47 -0
  5. protovalidate_unofficial-1.1.0/.github/ISSUE_TEMPLATE/feature_request.md +26 -0
  6. protovalidate_unofficial-1.1.0/.github/buf-logo.svg +10 -0
  7. protovalidate_unofficial-1.1.0/.github/dependabot.yml +10 -0
  8. protovalidate_unofficial-1.1.0/.github/workflows/add-to-project.yaml +21 -0
  9. protovalidate_unofficial-1.1.0/.github/workflows/ci.yaml +53 -0
  10. protovalidate_unofficial-1.1.0/.github/workflows/emergency-review-bypass.yaml +13 -0
  11. protovalidate_unofficial-1.1.0/.github/workflows/notify-approval-bypass.yaml +14 -0
  12. protovalidate_unofficial-1.1.0/.github/workflows/pr-title.yaml +18 -0
  13. protovalidate_unofficial-1.1.0/.github/workflows/release.yaml +53 -0
  14. protovalidate_unofficial-1.1.0/.gitignore +8 -0
  15. protovalidate_unofficial-1.1.0/.python-version +1 -0
  16. protovalidate_unofficial-1.1.0/LICENSE +201 -0
  17. protovalidate_unofficial-1.1.0/Makefile +92 -0
  18. protovalidate_unofficial-1.1.0/PKG-INFO +145 -0
  19. protovalidate_unofficial-1.1.0/README.md +117 -0
  20. protovalidate_unofficial-1.1.0/buf.gen.yaml +9 -0
  21. protovalidate_unofficial-1.1.0/buf.lock +6 -0
  22. protovalidate_unofficial-1.1.0/buf.yaml +11 -0
  23. protovalidate_unofficial-1.1.0/gen/buf/validate/conformance/cases/bool_pb2.py +54 -0
  24. protovalidate_unofficial-1.1.0/gen/buf/validate/conformance/cases/bool_pb2.pyi +44 -0
  25. protovalidate_unofficial-1.1.0/gen/buf/validate/conformance/cases/bytes_pb2.py +134 -0
  26. protovalidate_unofficial-1.1.0/gen/buf/validate/conformance/cases/bytes_pb2.pyi +164 -0
  27. protovalidate_unofficial-1.1.0/gen/buf/validate/conformance/cases/custom_rules/custom_rules_pb2.py +230 -0
  28. protovalidate_unofficial-1.1.0/gen/buf/validate/conformance/cases/custom_rules/custom_rules_pb2.pyi +352 -0
  29. protovalidate_unofficial-1.1.0/gen/buf/validate/conformance/cases/enums_pb2.py +128 -0
  30. protovalidate_unofficial-1.1.0/gen/buf/validate/conformance/cases/enums_pb2.pyi +174 -0
  31. protovalidate_unofficial-1.1.0/gen/buf/validate/conformance/cases/filename_with_dash_pb2.py +40 -0
  32. protovalidate_unofficial-1.1.0/gen/buf/validate/conformance/cases/filename_with_dash_pb2.pyi +19 -0
  33. protovalidate_unofficial-1.1.0/gen/buf/validate/conformance/cases/groups_editions_pb2.py +48 -0
  34. protovalidate_unofficial-1.1.0/gen/buf/validate/conformance/cases/groups_editions_pb2.pyi +31 -0
  35. protovalidate_unofficial-1.1.0/gen/buf/validate/conformance/cases/groups_proto2_pb2.py +64 -0
  36. protovalidate_unofficial-1.1.0/gen/buf/validate/conformance/cases/groups_proto2_pb2.pyi +67 -0
  37. protovalidate_unofficial-1.1.0/gen/buf/validate/conformance/cases/ignore_empty_proto2_pb2.py +74 -0
  38. protovalidate_unofficial-1.1.0/gen/buf/validate/conformance/cases/ignore_empty_proto2_pb2.pyi +75 -0
  39. protovalidate_unofficial-1.1.0/gen/buf/validate/conformance/cases/ignore_empty_proto3_pb2.py +82 -0
  40. protovalidate_unofficial-1.1.0/gen/buf/validate/conformance/cases/ignore_empty_proto3_pb2.pyi +88 -0
  41. protovalidate_unofficial-1.1.0/gen/buf/validate/conformance/cases/ignore_empty_proto_editions_pb2.py +104 -0
  42. protovalidate_unofficial-1.1.0/gen/buf/validate/conformance/cases/ignore_empty_proto_editions_pb2.pyi +126 -0
  43. protovalidate_unofficial-1.1.0/gen/buf/validate/conformance/cases/ignore_proto2_pb2.py +244 -0
  44. protovalidate_unofficial-1.1.0/gen/buf/validate/conformance/cases/ignore_proto2_pb2.pyi +348 -0
  45. protovalidate_unofficial-1.1.0/gen/buf/validate/conformance/cases/ignore_proto3_pb2.py +202 -0
  46. protovalidate_unofficial-1.1.0/gen/buf/validate/conformance/cases/ignore_proto3_pb2.pyi +283 -0
  47. protovalidate_unofficial-1.1.0/gen/buf/validate/conformance/cases/ignore_proto_editions_pb2.py +316 -0
  48. protovalidate_unofficial-1.1.0/gen/buf/validate/conformance/cases/ignore_proto_editions_pb2.pyi +468 -0
  49. protovalidate_unofficial-1.1.0/gen/buf/validate/conformance/cases/kitchen_sink_pb2.py +82 -0
  50. protovalidate_unofficial-1.1.0/gen/buf/validate/conformance/cases/kitchen_sink_pb2.pyi +86 -0
  51. protovalidate_unofficial-1.1.0/gen/buf/validate/conformance/cases/library_pb2.py +68 -0
  52. protovalidate_unofficial-1.1.0/gen/buf/validate/conformance/cases/library_pb2.pyi +70 -0
  53. protovalidate_unofficial-1.1.0/gen/buf/validate/conformance/cases/maps_pb2.py +148 -0
  54. protovalidate_unofficial-1.1.0/gen/buf/validate/conformance/cases/maps_pb2.pyi +200 -0
  55. protovalidate_unofficial-1.1.0/gen/buf/validate/conformance/cases/messages_pb2.py +127 -0
  56. protovalidate_unofficial-1.1.0/gen/buf/validate/conformance/cases/messages_pb2.pyi +176 -0
  57. protovalidate_unofficial-1.1.0/gen/buf/validate/conformance/cases/numbers_pb2.py +782 -0
  58. protovalidate_unofficial-1.1.0/gen/buf/validate/conformance/cases/numbers_pb2.pyi +1157 -0
  59. protovalidate_unofficial-1.1.0/gen/buf/validate/conformance/cases/oneofs_pb2.py +62 -0
  60. protovalidate_unofficial-1.1.0/gen/buf/validate/conformance/cases/oneofs_pb2.pyi +64 -0
  61. protovalidate_unofficial-1.1.0/gen/buf/validate/conformance/cases/other_package/embed_pb2.py +50 -0
  62. protovalidate_unofficial-1.1.0/gen/buf/validate/conformance/cases/other_package/embed_pb2.pyi +42 -0
  63. protovalidate_unofficial-1.1.0/gen/buf/validate/conformance/cases/predefined_rules_proto2_pb2.py +245 -0
  64. protovalidate_unofficial-1.1.0/gen/buf/validate/conformance/cases/predefined_rules_proto2_pb2.pyi +310 -0
  65. protovalidate_unofficial-1.1.0/gen/buf/validate/conformance/cases/predefined_rules_proto3_pb2.py +219 -0
  66. protovalidate_unofficial-1.1.0/gen/buf/validate/conformance/cases/predefined_rules_proto3_pb2.pyi +295 -0
  67. protovalidate_unofficial-1.1.0/gen/buf/validate/conformance/cases/predefined_rules_proto_editions_pb2.py +255 -0
  68. protovalidate_unofficial-1.1.0/gen/buf/validate/conformance/cases/predefined_rules_proto_editions_pb2.pyi +325 -0
  69. protovalidate_unofficial-1.1.0/gen/buf/validate/conformance/cases/repeated_pb2.py +149 -0
  70. protovalidate_unofficial-1.1.0/gen/buf/validate/conformance/cases/repeated_pb2.pyi +208 -0
  71. protovalidate_unofficial-1.1.0/gen/buf/validate/conformance/cases/required_field_proto2_pb2.py +104 -0
  72. protovalidate_unofficial-1.1.0/gen/buf/validate/conformance/cases/required_field_proto2_pb2.pyi +127 -0
  73. protovalidate_unofficial-1.1.0/gen/buf/validate/conformance/cases/required_field_proto3_pb2.py +136 -0
  74. protovalidate_unofficial-1.1.0/gen/buf/validate/conformance/cases/required_field_proto3_pb2.pyi +178 -0
  75. protovalidate_unofficial-1.1.0/gen/buf/validate/conformance/cases/required_field_proto_editions_pb2.py +144 -0
  76. protovalidate_unofficial-1.1.0/gen/buf/validate/conformance/cases/required_field_proto_editions_pb2.pyi +195 -0
  77. protovalidate_unofficial-1.1.0/gen/buf/validate/conformance/cases/strings_pb2.py +294 -0
  78. protovalidate_unofficial-1.1.0/gen/buf/validate/conformance/cases/strings_pb2.pyi +404 -0
  79. protovalidate_unofficial-1.1.0/gen/buf/validate/conformance/cases/subdirectory/in_subdirectory_pb2.py +40 -0
  80. protovalidate_unofficial-1.1.0/gen/buf/validate/conformance/cases/subdirectory/in_subdirectory_pb2.pyi +19 -0
  81. protovalidate_unofficial-1.1.0/gen/buf/validate/conformance/cases/wkt_any_pb2.py +75 -0
  82. protovalidate_unofficial-1.1.0/gen/buf/validate/conformance/cases/wkt_any_pb2.pyi +76 -0
  83. protovalidate_unofficial-1.1.0/gen/buf/validate/conformance/cases/wkt_duration_pb2.py +121 -0
  84. protovalidate_unofficial-1.1.0/gen/buf/validate/conformance/cases/wkt_duration_pb2.pyi +144 -0
  85. protovalidate_unofficial-1.1.0/gen/buf/validate/conformance/cases/wkt_field_mask_pb2.py +63 -0
  86. protovalidate_unofficial-1.1.0/gen/buf/validate/conformance/cases/wkt_field_mask_pb2.pyi +57 -0
  87. protovalidate_unofficial-1.1.0/gen/buf/validate/conformance/cases/wkt_nested_pb2.py +52 -0
  88. protovalidate_unofficial-1.1.0/gen/buf/validate/conformance/cases/wkt_nested_pb2.pyi +36 -0
  89. protovalidate_unofficial-1.1.0/gen/buf/validate/conformance/cases/wkt_timestamp_pb2.py +135 -0
  90. protovalidate_unofficial-1.1.0/gen/buf/validate/conformance/cases/wkt_timestamp_pb2.pyi +166 -0
  91. protovalidate_unofficial-1.1.0/gen/buf/validate/conformance/cases/wkt_wrappers_pb2.py +95 -0
  92. protovalidate_unofficial-1.1.0/gen/buf/validate/conformance/cases/wkt_wrappers_pb2.pyi +105 -0
  93. protovalidate_unofficial-1.1.0/gen/buf/validate/conformance/cases/yet_another_package/embed2_pb2.py +46 -0
  94. protovalidate_unofficial-1.1.0/gen/buf/validate/conformance/cases/yet_another_package/embed2_pb2.pyi +33 -0
  95. protovalidate_unofficial-1.1.0/gen/buf/validate/conformance/harness/harness_pb2.py +56 -0
  96. protovalidate_unofficial-1.1.0/gen/buf/validate/conformance/harness/harness_pb2.pyi +65 -0
  97. protovalidate_unofficial-1.1.0/gen/buf/validate/conformance/harness/results_pb2.py +50 -0
  98. protovalidate_unofficial-1.1.0/gen/buf/validate/conformance/harness/results_pb2.pyi +83 -0
  99. protovalidate_unofficial-1.1.0/gen/buf/validate/validate_pb2.py +469 -0
  100. protovalidate_unofficial-1.1.0/gen/buf/validate/validate_pb2.pyi +661 -0
  101. protovalidate_unofficial-1.1.0/gen/cel/expr/checked_pb2.py +76 -0
  102. protovalidate_unofficial-1.1.0/gen/cel/expr/checked_pb2.pyi +185 -0
  103. protovalidate_unofficial-1.1.0/gen/cel/expr/conformance/conformance_service_pb2.py +66 -0
  104. protovalidate_unofficial-1.1.0/gen/cel/expr/conformance/conformance_service_pb2.pyi +123 -0
  105. protovalidate_unofficial-1.1.0/gen/cel/expr/conformance/env_config_pb2.py +60 -0
  106. protovalidate_unofficial-1.1.0/gen/cel/expr/conformance/env_config_pb2.pyi +110 -0
  107. protovalidate_unofficial-1.1.0/gen/cel/expr/conformance/test/simple_pb2.py +58 -0
  108. protovalidate_unofficial-1.1.0/gen/cel/expr/conformance/test/simple_pb2.pyi +106 -0
  109. protovalidate_unofficial-1.1.0/gen/cel/expr/conformance/test/suite_pb2.py +60 -0
  110. protovalidate_unofficial-1.1.0/gen/cel/expr/conformance/test/suite_pb2.pyi +102 -0
  111. protovalidate_unofficial-1.1.0/gen/cel/expr/eval_pb2.py +53 -0
  112. protovalidate_unofficial-1.1.0/gen/cel/expr/eval_pb2.pyi +69 -0
  113. protovalidate_unofficial-1.1.0/gen/cel/expr/explain_pb2.py +46 -0
  114. protovalidate_unofficial-1.1.0/gen/cel/expr/explain_pb2.pyi +36 -0
  115. protovalidate_unofficial-1.1.0/gen/cel/expr/syntax_pb2.py +82 -0
  116. protovalidate_unofficial-1.1.0/gen/cel/expr/syntax_pb2.pyi +199 -0
  117. protovalidate_unofficial-1.1.0/gen/cel/expr/value_pb2.py +51 -0
  118. protovalidate_unofficial-1.1.0/gen/cel/expr/value_pb2.pyi +77 -0
  119. protovalidate_unofficial-1.1.0/gen/cel/policy/policy_pb2.py +49 -0
  120. protovalidate_unofficial-1.1.0/gen/cel/policy/policy_pb2.pyi +76 -0
  121. protovalidate_unofficial-1.1.0/gen/tests/example/v1/validations_pb2.py +113 -0
  122. protovalidate_unofficial-1.1.0/gen/tests/example/v1/validations_pb2.pyi +146 -0
  123. protovalidate_unofficial-1.1.0/proto/tests/example/v1/validations.proto +126 -0
  124. protovalidate_unofficial-1.1.0/protovalidate_unofficial/__init__.py +26 -0
  125. protovalidate_unofficial-1.1.0/protovalidate_unofficial/internal/__init__.py +13 -0
  126. protovalidate_unofficial-1.1.0/protovalidate_unofficial/internal/cel_field_presence.py +45 -0
  127. protovalidate_unofficial-1.1.0/protovalidate_unofficial/internal/extra_func.py +1586 -0
  128. protovalidate_unofficial-1.1.0/protovalidate_unofficial/internal/rules.py +1176 -0
  129. protovalidate_unofficial-1.1.0/protovalidate_unofficial/internal/string_format.py +245 -0
  130. protovalidate_unofficial-1.1.0/protovalidate_unofficial/py.typed +0 -0
  131. protovalidate_unofficial-1.1.0/protovalidate_unofficial/validator.py +118 -0
  132. protovalidate_unofficial-1.1.0/pyproject.toml +124 -0
  133. protovalidate_unofficial-1.1.0/test/__init__.py +20 -0
  134. protovalidate_unofficial-1.1.0/test/conformance/__init__.py +13 -0
  135. protovalidate_unofficial-1.1.0/test/conformance/nonconforming.yaml +9 -0
  136. protovalidate_unofficial-1.1.0/test/conformance/runner.py +112 -0
  137. protovalidate_unofficial-1.1.0/test/test_format.py.bak +136 -0
  138. protovalidate_unofficial-1.1.0/test/test_matches.py +26 -0
  139. protovalidate_unofficial-1.1.0/test/test_validate.py +248 -0
  140. protovalidate_unofficial-1.1.0/test/testdata/string_ext_supplemental.textproto +26 -0
  141. protovalidate_unofficial-1.1.0/test/testdata/string_ext_v0.25.1.textproto +1491 -0
  142. protovalidate_unofficial-1.1.0/uv.lock +1339 -0
@@ -0,0 +1 @@
1
+ /gen/** linguist-generated=true
@@ -0,0 +1,132 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our
6
+ community a harassment-free experience for everyone, regardless of age, body
7
+ size, visible or invisible disability, ethnicity, sex characteristics, gender
8
+ identity and expression, level of experience, education, socio-economic status,
9
+ nationality, personal appearance, race, religion, or sexual identity
10
+ and orientation.
11
+
12
+ We pledge to act and interact in ways that contribute to an open, welcoming,
13
+ diverse, inclusive, and healthy community.
14
+
15
+ ## Our Standards
16
+
17
+ Examples of behavior that contributes to a positive environment for our
18
+ community include:
19
+
20
+ * Demonstrating empathy and kindness toward other people
21
+ * Being respectful of differing opinions, viewpoints, and experiences
22
+ * Giving and gracefully accepting constructive feedback
23
+ * Accepting responsibility and apologizing to those affected by our mistakes,
24
+ and learning from the experience
25
+ * Focusing on what is best not just for us as individuals, but for the
26
+ overall community
27
+
28
+ Examples of unacceptable behavior include:
29
+
30
+ * The use of sexualized language or imagery, and sexual attention or
31
+ advances of any kind
32
+ * Trolling, insulting or derogatory comments, and personal or political attacks
33
+ * Public or private harassment
34
+ * Publishing others' private information, such as a physical or email
35
+ address, without their explicit permission
36
+ * Other conduct which could reasonably be considered inappropriate in a
37
+ professional setting
38
+
39
+ ## Enforcement Responsibilities
40
+
41
+ Community leaders are responsible for clarifying and enforcing our standards of
42
+ acceptable behavior and will take appropriate and fair corrective action in
43
+ response to any behavior that they deem inappropriate, threatening, offensive,
44
+ or harmful.
45
+
46
+ Community leaders have the right and responsibility to remove, edit, or reject
47
+ comments, commits, code, wiki edits, issues, and other contributions that are
48
+ not aligned to this Code of Conduct, and will communicate reasons for moderation
49
+ decisions when appropriate.
50
+
51
+ ## Scope
52
+
53
+ This Code of Conduct applies within all community spaces, and also applies when
54
+ an individual is officially representing the community in public spaces.
55
+ Examples of representing our community include using an official e-mail address,
56
+ posting via an official social media account, or acting as an appointed
57
+ representative at an online or offline event.
58
+
59
+ ## Enforcement
60
+
61
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
62
+ reported to the community leaders responsible for enforcement at
63
+ conduct@buf.build. All complaints will be reviewed and investigated promptly
64
+ and fairly.
65
+
66
+ All community leaders are obligated to respect the privacy and security of the
67
+ reporter of any incident.
68
+
69
+ ## Enforcement Guidelines
70
+
71
+ Community leaders will follow these Community Impact Guidelines in determining
72
+ the consequences for any action they deem in violation of this Code of Conduct:
73
+
74
+ ### 1. Correction
75
+
76
+ **Community Impact**: Use of inappropriate language or other behavior deemed
77
+ unprofessional or unwelcome in the community.
78
+
79
+ **Consequence**: A private, written warning from community leaders, providing
80
+ clarity around the nature of the violation and an explanation of why the
81
+ behavior was inappropriate. A public apology may be requested.
82
+
83
+ ### 2. Warning
84
+
85
+ **Community Impact**: A violation through a single incident or series
86
+ of actions.
87
+
88
+ **Consequence**: A warning with consequences for continued behavior. No
89
+ interaction with the people involved, including unsolicited interaction with
90
+ those enforcing the Code of Conduct, for a specified period of time. This
91
+ includes avoiding interactions in community spaces as well as external channels
92
+ like social media. Violating these terms may lead to a temporary or
93
+ permanent ban.
94
+
95
+ ### 3. Temporary Ban
96
+
97
+ **Community Impact**: A serious violation of community standards, including
98
+ sustained inappropriate behavior.
99
+
100
+ **Consequence**: A temporary ban from any sort of interaction or public
101
+ communication with the community for a specified period of time. No public or
102
+ private interaction with the people involved, including unsolicited interaction
103
+ with those enforcing the Code of Conduct, is allowed during this period.
104
+ Violating these terms may lead to a permanent ban.
105
+
106
+ ### 4. Permanent Ban
107
+
108
+ **Community Impact**: Demonstrating a pattern of violation of community
109
+ standards, including sustained inappropriate behavior, harassment of an
110
+ individual, or aggression toward or disparagement of classes of individuals.
111
+
112
+ **Consequence**: A permanent ban from any sort of public interaction within
113
+ the community.
114
+
115
+ ## Attribution
116
+
117
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118
+ version 2.0, available at
119
+ [https://www.contributor-covenant.org/version/2/0/code_of_conduct.html][v2.0].
120
+
121
+ Community Impact Guidelines were inspired by
122
+ [Mozilla's code of conduct enforcement ladder][Mozilla CoC].
123
+
124
+ For answers to common questions about this code of conduct, see the FAQ at
125
+ [https://www.contributor-covenant.org/faq][FAQ]. Translations are available
126
+ at [https://www.contributor-covenant.org/translations][translations].
127
+
128
+ [homepage]: https://www.contributor-covenant.org
129
+ [v2.0]: https://www.contributor-covenant.org/version/2/0/code_of_conduct.html
130
+ [Mozilla CoC]: https://github.com/mozilla/diversity
131
+ [FAQ]: https://www.contributor-covenant.org/faq
132
+ [translations]: https://www.contributor-covenant.org/translations
@@ -0,0 +1,154 @@
1
+ # Contributing Guidelines
2
+
3
+ Firstly, we want to say thank you for considering contributing
4
+ to `protovalidate-python`. We genuinely appreciate your help. This document aims to
5
+ provide some guidelines to make your contribution process straightforward and
6
+ meaningful.
7
+
8
+ ## Code of Conduct
9
+
10
+ We pledge to maintain a welcoming and inclusive community. Please read
11
+ our [Code of Conduct][code-of-conduct] before participating.
12
+
13
+ ## How Can I Contribute?
14
+
15
+ First, clone the repository:
16
+
17
+ ```
18
+ git clone git@github.com:bufbuild/protovalidate-python.git
19
+ cd protovalidate-python
20
+ ```
21
+
22
+ Next, install dependencies. You will need:
23
+
24
+ * [uv](https://docs.astral.sh/uv/)
25
+
26
+ We use a Makefile to test and lint our code, so you'll also need a few non-Python tools:
27
+
28
+ * GNU Make (to use the Makefile): part of the `build-essential` package on
29
+ Debian-derived Linux distributions (including Ubuntu), and part of
30
+ `xcode-select --install` on Macs.
31
+ * Go (for the conformance test runner): often available in your system package
32
+ manager (`apt`, `dnf`, `brew`, etc.), but most reliable when [installed
33
+ directly from upstream](https://go.dev/doc/install).
34
+
35
+ With Go and GNU Make installed, you can verify that your changes pass tests and
36
+ lint checks by running `make`. For a list of other useful commands, run `make
37
+ help`.
38
+
39
+ ### Reporting Bugs
40
+
41
+ Bugs are tracked as GitHub issues. If you discover a problem
42
+ with `protovalidate-python`, we want to hear about it. Here's how you can report a bug:
43
+
44
+ 1. __Ensure the bug was not already reported__: Before creating a new issue,
45
+ please do a search
46
+ in [issues][issues] to see if
47
+ the problem has already been reported. If it has and the issue is still open,
48
+ add a comment to the existing issue instead of opening a new one.
49
+
50
+ 2. __Check if the issue is fixed__: Try to reproduce the issue using the
51
+ latest `main` branch to see if the problem has already been fixed. If fixed,
52
+ that's great!
53
+
54
+ 3. __Open new issue__: If the issue has not been reported and has not been
55
+ fixed, then we encourage you to [open a new issue][file-bug].
56
+
57
+ Remember to detail the steps to reproduce the issue. This information is
58
+ invaluable in helping us fix the issue.
59
+
60
+ Once you've filled in the template, hit "Submit new issue", and we will take
61
+ care of the rest. We appreciate your contribution to making `protovalidate-python`
62
+ better!
63
+
64
+ ### Suggesting Enhancements
65
+
66
+ We welcome ideas for enhancements and new features to improve `protovalidate-python`.
67
+ If you have an idea you'd like to share, if you want to expand language
68
+ support,
69
+ please read [the section below](#language-support-requirements) first.
70
+
71
+ 1. __Check if the enhancement is already suggested__: Before creating a new
72
+ issue, please do a search
73
+ in [issues][issues] to see if
74
+ the idea or enhancement has already been suggested. If it has and the issue
75
+ is still open, add a comment to the existing issue instead of opening a new
76
+ one.
77
+
78
+ 2. __Open a new issue__: If your enhancement hasn't been suggested before,
79
+ please [create a new issue][file-feature-request].
80
+
81
+ 3. __Discussion__: Once you've submitted the issue, maintainers or other
82
+ community members might jump in to discuss the enhancement. Be prepared to
83
+ provide more context or insights about your suggestion.
84
+
85
+ Remember, the goal of suggesting an enhancement is to improve `protovalidate-python`
86
+ for everyone. Every suggestion is valued, and we thank you in advance for your
87
+ contribution.
88
+
89
+ ### Pull Requests
90
+
91
+ For changes, improvements, or fixes, please create a pull request. Make sure
92
+ your PR is up-to-date with the main branch. Please write clear and concise
93
+ commit messages to help us understand and review your PR.
94
+
95
+ ### Minimizing Performance Regression
96
+
97
+ Performance and efficient resource management are critical aspects
98
+ of `protovalidate-python`. CEL, being non-Turing complete, provides production safety
99
+ controls to limit execution time, helping to prevent excessive resource
100
+ consumption during evaluation. Here are some guidelines for effectively managing
101
+ resource constraints and minimizing performance regressions:
102
+
103
+ 1. __Understanding Resource Constraints__: CEL has resource constraint features
104
+ which provide feedback about expression complexity. These are designed to
105
+ prevent CEL evaluation from consuming excessive resources. One key element is
106
+ the concept of a _cost unit_, an independent measure used for tracking CPU
107
+ utilization regardless of system load or hardware. The cost is deterministic,
108
+ meaning for any CEL expression and input data, the evaluation cost will
109
+ remain the same.
110
+ 2. __Cost Units and Operations__: Many of CEL's operations have fixed costs.
111
+ Simple operations, such as comparisons (e.g. `<`), have a cost of 1, while
112
+ some, like list literal declarations, have a higher fixed cost of 40 cost
113
+ units. Functions implemented in native code approximate cost based on time
114
+ complexity. For instance, regular expression operations like `match`
115
+ and `find` use an approximated cost
116
+ of `length(regexString)*length(inputString)`, reflecting the worst-case time
117
+ complexity of the operation.
118
+ 3. __Testing the Overall Cost__: You can use the CEL library to test the overall
119
+ cost of an expression. This can help predict the resources required to
120
+ evaluate an expression and prevent operations that would consume excessive
121
+ resources.
122
+ 4. __Benchmark and Profile__: Benchmark your changes against the current `main`
123
+ branch to evaluate the performance impact. If a performance regression is
124
+ suspected, profile the code to pinpoint the bottleneck.
125
+ 5. __Optimize__: Always look for ways to optimize your changes without
126
+ compromising readability, maintainability, or correctness of your code.
127
+ 6. __Discuss__: If your changes might cause a performance regression or resource
128
+ constraint, but you believe they're still beneficial, discuss this in the
129
+ pull request. Explain why you think the performance regression or resource
130
+ constraint might be acceptable.
131
+
132
+ By keeping performance and resource management in mind throughout the
133
+ development process, we can ensure `protovalidate-python` remains efficient and
134
+ responsive, even as we add new features and fix bugs.
135
+
136
+ ## Questions?
137
+
138
+ If you have any questions, please don't hesitate to create an issue, and we'll
139
+ answer as soon as possible. If your question is regarding a specific issue or
140
+ pull request, please link it in your comment.
141
+
142
+ ## Thank You
143
+
144
+ Again, we appreciate your help and time, and we are excited to see your
145
+ contributions!
146
+
147
+ Remember, you can reach out to us at any time, and we're looking forward to
148
+ working together to make `protovalidate-python` the best it can be.
149
+
150
+ [code-of-conduct]: https://github.com/bufbuild/protovalidate/tree/main/.github/CODE_OF_CONDUCT.md
151
+ [issues]: https://github.com/bufbuild/protovalidate-python/issues
152
+ [file-bug]: https://github.com/bufbuild/protovalidate-python/issues/new?assignees=&labels=Bug&template=bug_report.md&title=%5BBUG%5D
153
+ [file-feature-request]: https://github.com/bufbuild/protovalidate-python/issues/new?assignees=&labels=Feature&template=feature_request.md&title=%5BFeature+Request%5D
154
+ [cel-spec]: https://github.com/google/cel-spec
@@ -0,0 +1,47 @@
1
+ ---
2
+ name: Bug report
3
+ about: Create a report to help us improve
4
+ title: "[BUG]"
5
+ labels: Bug
6
+ assignees: ''
7
+
8
+ ---
9
+
10
+ ## Description
11
+ <!--Provide a clear and concise description of the bug. Be specific and include any relevant information about the issue, such as what you were trying to accomplish, what the expected behavior was, and how the actual behavior differed.-->
12
+
13
+ ## Steps to Reproduce
14
+ <!--
15
+ 1. First step to reproduce the bug
16
+ 2. Second step to reproduce the bug
17
+ 3. Third step to reproduce the bug
18
+ ... additional steps as needed
19
+ -->
20
+
21
+ ## Expected Behavior
22
+
23
+ <!--Describe what you expected to happen when following the steps to reproduce the bug.-->
24
+
25
+ ## Actual Behavior
26
+
27
+ <!--Describe what actually happened instead of the expected behavior.-->
28
+
29
+ ## Screenshots/Logs
30
+
31
+ <!--If applicable, add screenshots and/or log files to help explain the bug.-->
32
+
33
+ ## Environment
34
+
35
+ - **Operating System**: <!--[e.g., macOS, Windows, Linux]-->
36
+ - **Version**: <!--[e.g., macOS 10.15.7, Windows 10, Ubuntu 20.04]-->
37
+ - **Compiler/Toolchain**: <!--[e.g., GCC 9.3.0, Clang 10.0.0]-->
38
+ - **Protobuf Compiler & Version**: <!--[e.g. buf v1.17.0, protoc 3.17.3]-->
39
+ - **Protovalidate Version**: <!--[if applicable, e.g., v1.0.2]-->
40
+
41
+ ## Possible Solution
42
+ <!--If you have any suggestions on how the bug could be fixed or have identified the source of the problem, please provide your insights here.-->
43
+
44
+ ## Additional Context
45
+ <!--Any other information, context, or relevant details that could be helpful for understanding and resolving the bug.-->
46
+
47
+ <!--Please make sure to provide as much information as possible to help the maintainers diagnose and fix the issue.-->
@@ -0,0 +1,26 @@
1
+ ---
2
+ name: Feature request
3
+ about: Suggest an idea for this project
4
+ title: "[Feature Request]"
5
+ labels: Feature
6
+ assignees: ''
7
+
8
+ ---
9
+
10
+ **Feature description:**
11
+ <!-- A clear and concise description of the feature you would like to see implemented in protoc-gen-validate.-->
12
+
13
+ **Problem it solves or use case:**
14
+ <!-- Explain the problem this feature would solve or the use case it addresses, and how it would benefit users of protoc-gen-validate.-->
15
+
16
+ **Proposed implementation or solution:**
17
+ <!-- If you have a suggestion on how this feature can be implemented or any ideas on the solution, please describe them here.-->
18
+
19
+ **Contribution:**
20
+ <!--Describe how you would like to contribute this feature to the project. If you are willing to implement the feature yourself, please indicate that here. If you are not willing to implement it yourself, please indicate if you would be willing to help others implement it.-->
21
+
22
+ **Examples or references:**
23
+ <!-- If applicable, provide examples or references to similar features in other libraries or tools.-->
24
+
25
+ **Additional context:**
26
+ <!-- Add any other context or information about the feature request here.-->
@@ -0,0 +1,10 @@
1
+ <svg width="85" height="80" viewBox="0 0 85 80" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <rect x="25.4114" y="20.7058" width="8.47059" height="59.2941" fill="#0E5DF5"/>
3
+ <rect x="42.3533" y="20.7058" width="8.47059" height="59.2941" fill="#0E5DF5"/>
4
+ <rect x="59.2942" y="20.7058" width="8.47059" height="59.2941" fill="#0E5DF5"/>
5
+ <rect x="76.2352" y="20.7058" width="8.47059" height="59.2941" fill="#0E5DF5"/>
6
+ <rect width="8.47059" height="59.2941" fill="#5FDCFF"/>
7
+ <rect x="16.9409" width="8.47059" height="59.2941" fill="#5FDCFF"/>
8
+ <rect x="33.8821" width="8.47059" height="59.2941" fill="#5FDCFF"/>
9
+ <rect x="50.8237" width="8.47059" height="59.2941" fill="#5FDCFF"/>
10
+ </svg>
@@ -0,0 +1,10 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: "github-actions"
4
+ directory: "/"
5
+ schedule:
6
+ interval: "weekly"
7
+ - package-ecosystem: "uv"
8
+ directory: "/"
9
+ schedule:
10
+ interval: "weekly"
@@ -0,0 +1,21 @@
1
+ name: Add issues and PRs to project
2
+
3
+ on:
4
+ issues:
5
+ types:
6
+ - opened
7
+ - reopened
8
+ - transferred
9
+ pull_request_target:
10
+ types:
11
+ - opened
12
+ - reopened
13
+ issue_comment:
14
+ types:
15
+ - created
16
+
17
+ jobs:
18
+ call-workflow-add-to-project:
19
+ name: Call workflow to add issue to project
20
+ uses: bufbuild/base-workflows/.github/workflows/add-to-project.yaml@main
21
+ secrets: inherit
@@ -0,0 +1,53 @@
1
+ name: CI
2
+ on:
3
+ push:
4
+ branches: [main]
5
+ tags: ['v*']
6
+ pull_request:
7
+ branches: [main]
8
+ schedule:
9
+ - cron: '15 22 * * *'
10
+ workflow_dispatch: {} # support manual runs
11
+ permissions:
12
+ contents: read
13
+ jobs:
14
+ ci:
15
+ name: CI
16
+ runs-on: ubuntu-latest
17
+ strategy:
18
+ fail-fast: false
19
+ matrix:
20
+ python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
21
+ resolution: ["highest", "lowest-direct"]
22
+ env:
23
+ # Shared env variables for all the tests
24
+ UV_RESOLUTION: '${{ matrix.resolution }}'
25
+ steps:
26
+ - name: Checkout code
27
+ uses: actions/checkout@v6
28
+ with:
29
+ fetch-depth: 1
30
+ - name: Install Go
31
+ uses: actions/setup-go@v6
32
+ with:
33
+ go-version: stable
34
+ cache: false
35
+ - uses: astral-sh/setup-uv@v7
36
+ with:
37
+ python-version: ${{ matrix.python-version }}
38
+ - name: Install dependencies
39
+ run: make install
40
+ - name: Lint
41
+ run: make lint
42
+ - name: Execute tests
43
+ run: make test
44
+ - name: Test conformance
45
+ run: make conformance
46
+ - name: Format
47
+ run: make format
48
+ # When running with matrix.resolution == highest, we expect uv.lock to change, but we don't want that file checked in.
49
+ - if: matrix.resolution == 'lowest-direct'
50
+ name: Check generated
51
+ run: make checkgenerate
52
+ env:
53
+ BUF_TOKEN: ${{ secrets.BUF_TOKEN }}
@@ -0,0 +1,13 @@
1
+ name: Emergency review bypass
2
+ on:
3
+ pull_request:
4
+ types:
5
+ - labeled
6
+ permissions:
7
+ pull-requests: write
8
+ jobs:
9
+ approve:
10
+ name: Approve
11
+ if: github.event.label.name == 'Emergency Bypass Review'
12
+ uses: bufbuild/base-workflows/.github/workflows/emergency-review-bypass.yaml@main
13
+ secrets: inherit
@@ -0,0 +1,14 @@
1
+ name: Approval bypass notifier
2
+ on:
3
+ pull_request:
4
+ types:
5
+ - closed
6
+ branches:
7
+ - main
8
+ permissions:
9
+ pull-requests: read
10
+ jobs:
11
+ notify:
12
+ name: Notify
13
+ uses: bufbuild/base-workflows/.github/workflows/notify-approval-bypass.yaml@main
14
+ secrets: inherit
@@ -0,0 +1,18 @@
1
+ name: Lint PR Title
2
+ # Prevent writing to the repository using the CI token.
3
+ # Ref: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#permissions
4
+ permissions:
5
+ pull-requests: read
6
+ on:
7
+ pull_request:
8
+ # By default, a workflow only runs when a pull_request's activity type is opened,
9
+ # synchronize, or reopened. We explicity override here so that PR titles are
10
+ # re-linted when the PR text content is edited.
11
+ types:
12
+ - opened
13
+ - edited
14
+ - reopened
15
+ - synchronize
16
+ jobs:
17
+ lint:
18
+ uses: bufbuild/base-workflows/.github/workflows/pr-title.yaml@main
@@ -0,0 +1,53 @@
1
+ name: Upload PyPI Release
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+
7
+ jobs:
8
+ build:
9
+ name: Build package
10
+ runs-on: ubuntu-latest
11
+ environment:
12
+ name: release
13
+ steps:
14
+ - name: Checkout source
15
+ uses: actions/checkout@v6
16
+ with:
17
+ fetch-depth: 0
18
+ - name: Set VERSION variable from tag
19
+ run: |
20
+ VERSION=${{github.head_ref}}
21
+ echo "VERSION=${VERSION##*/}" >> $GITHUB_ENV
22
+ - uses: astral-sh/setup-uv@v7
23
+ - name: Build release
24
+ run: |
25
+ uv build
26
+ - uses: actions/upload-artifact@v5
27
+ with:
28
+ name: package
29
+ path: dist/
30
+
31
+ publish:
32
+ name: Publish on PyPI
33
+ runs-on: ubuntu-latest
34
+ environment:
35
+ name: release
36
+ permissions:
37
+ # IMPORTANT: this permission is mandatory for Trusted Publishing
38
+ id-token: write
39
+ needs: build
40
+ steps:
41
+ - name: Checkout source
42
+ uses: actions/checkout@v6
43
+ with:
44
+ fetch-depth: 0
45
+
46
+ - name: Download built artifact
47
+ uses: actions/download-artifact@v6
48
+ with:
49
+ name: package
50
+ path: dist
51
+
52
+ - name: Publish on PyPI
53
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,8 @@
1
+ # tools, see ./Makefile
2
+ /.tmp/
3
+
4
+ # python writes compiled bytecode to .pyc files in __pycache__ directories
5
+ __pycache__
6
+
7
+ # VS Code configuration
8
+ /.vscode/
@@ -0,0 +1 @@
1
+ 3.8