forked from alecthomas/voluptuous
-
Notifications
You must be signed in to change notification settings - Fork 0
Diff of 0.8.7 to 0.10.5 +latest #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
minboost
wants to merge
344
commits into
minboost:master
Choose a base branch
from
alecthomas:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add validate_schema decorator
Remove setup_requires from setup.py
Fixes #188.
Invert Range tests so nan is excluded
Fix Exact Sequence to Match Lengths
Add Equal validator
Add Unordered validator
Empty lists are now regarded as is. If a free-form list is needed, use 'list'.
Fix empty list evaluation
Fixes #204: Making Path validators resilient to None.
Introducing decorator that is able to validate input arguments and return value of the decorated function. Before calling the wrapped function, the validators specified in the decorator's argument list will be tested against the values passed at the function call. ``` @validate_schema(arg1=int, arg2=int) def foo(arg1, arg2): return arg1 * arg2 ``` After calling the function with the validated arguments, schema specified in `RETURNS_KEY` (currently `__return__`) will be applied against the output. ``` @validate_schema(arg1=int, arg2=int, __returns__=int) def foo(arg1, arg2): return arg1 * arg2 ``` See more in the related test cases. Signed-off-by: Gergő Nagy <grigori.grant@gmail.com>
…ator Argument validation decorator
Handle non-subscriptable path in humanize_error
…tox (#501) * feat: add python 3.11 to github workflow tox matrix, remove 3.7 from tox * run flake8 and mypy on py311 * add py311 to package metadata
…ata (#502) * feat: add python 3.12 to github workflow tox matrix and package metadata * bump minimal python requirement in setup.py
…) (#506) credits to: @spacegaier and @beastd
python 3.8 goes EOL in 2024-10
* Remove Maybe validator typing * Use Schemable as validator type
* Add comprehensive tests for humanize.py module to improve coverage from 71% to 100% - Add tests for _nested_getitem error handling (KeyError, IndexError, TypeError) - Add tests for humanize_error with long error message truncation - Add tests for validate_with_humanized_errors success and failure cases - Add tests for edge cases with None data and multiple validation errors - Improve overall test coverage from 89% to 90% This addresses the missing coverage in humanize.py lines 19-22, 45, and 54-57. * Fix import sorting with isort
* Feature: Support requiring anyOf a list of keys
This adds a new feature to Voluptuous, which is somewhat akin to what json-schema does with the special key `anyOf`.
`Schema({Required(Any('color', 'temperature', 'brightness')): str})` will validate that AT LEAST ONE of these three values is present. That doesn't preclude any individual validation on each of those fields to still apply.
That means that in the above example, if `color` is present, brightness doesn't need to be present. But if brightness is present, all other validations of brightness (like checking that its value is a number between 0 and 100) still apply.
* Simplify tests
* Format stuff like black wants it
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.