Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Releases: smarie/python-valid8

5.1.2 - Bugfix with custom error formatting

29 Jan 11:32
Compare
Choose a tag to compare
Loading

Fixed issue: custom help messages inValidationError using several variables were not rendering to string correctly and instead were displayingError while formatting the help message. Fixes#58

Seedocumentation page for details.

Assets2
Loading

5.1.1 - packaging improvements

24 Apr 16:55
Compare
Choose a tag to compare
Loading
  • packaging improvements: set the "universal wheel" flag to 1, and cleaned up thesetup.py. In particular removed dependency tosix for setup. Fixes#57

Seedocumentation page for details.

Loading

5.1.0 - PEP561 compliance

22 Jan 10:54
Compare
Choose a tag to compare
Loading
  • Package was made PEP561 compatible. Fixed#55

  • Improved type hints for decorators so that they do not make the decorated item loose its type hints. Fixed#56

  • Removed usage of@with_signature in favour of stub file in theentry_points_annotations.py. Fixed#50

Seedocumentation page for details.

Loading

5.0.6 - Minor improvements

17 Dec 17:25
Compare
Choose a tag to compare
Loading

Improvedgetfullargspec so as to cover more builtins in python 3.

Seedocumentation page for details.

Loading

5.0.5 - bugfix - support for numpy True

02 Dec 22:47
Compare
Choose a tag to compare
Loading

NumpyTrue can be used (again) as a success condition in validation functions. Fixed#53

Seedocumentation page for details.

Loading

5.0.4 - `pyproject.toml`

18 Nov 11:28
Compare
Choose a tag to compare
Loading

Addedpyproject.toml.

Seedocumentation page for details.

Loading

5.0.3 - bug fixes

03 Oct 14:52
Compare
Choose a tag to compare
Loading

Fixed bug with mini-lambda < 2.2. Fixed#48.

Fixed bug inis_in when the reference object was a non-set container. Fixed#47.

Seedocumentation page for details.

Loading

5.0.2 - Bug fix

24 Sep 16:12
Compare
Choose a tag to compare
Loading

Fixed regression with non-able detection. Fixed#46.

Seedocumentation page for details.

Loading

5.0.1 - More betterness!

24 Sep 15:38
Compare
Choose a tag to compare
Loading

Better syntax for*validation_func:

  • you can provide atuple(<callable>, <help_msg>, <failure_type>) to define a single failure raiser (before only(<callable>, <help_msg>) or(<callable>, <failure_type>) were supported). Fixes#33

  • you can provide adict-like to define several validation functions, where the key and values can contain<callable>,<help_msg>,<failure_type>. For example{<help_msg>: (<callable>, <failure_type>)} is supported. Fixes#40.

  • nested lists are however not supported anymore

  • the<callable> can now either have signaturef(v),f(*args),f(*args, **ctx) orf(v, **ctx), where**ctx can be used to receive contextual information. Fixes#39

validation_lib should be imported explicitly

  • symbols fromvalid8.validation_lib are not imported automatically at package root anymore. You need to import them fromvalid8.validation_lib. This speeds up the library's import especially when you do not use the built-in functions. So instead offrom valid8 import is_even you should now dofrom valid8.validation_lib import is_even (orfrom valid8 import validation_lib as vlib +vlib.is_even). Fixed#35.

Major exceptions refactoring

  • the main validation function in aValidator is now always a failure raiser, even if a single callable was provided. This major design choice made many simplifications possible in particular the string representation of exceptions (below). Fixes#44

  • The string representation ofValidationError andValidationFailure was greatly improved. In particularValidationError does not display the name and outcome of the validation function anymore (since it is always a failure, see above), andValidationFailure now has a "compact" string representation option in a newto_str() method, used in composition messages to simplify the result. Composition failures are also represented in a more compact way.

  • failure_raiser moved tobase submodule with its associated type hintsValidationCallable andValidationCallableOrLambda. It now only accepts a single validation function argument ; this is more intuitive and separates concerns with the other higher-level functions. If you used it with several inputs in the past, you can useand_(...) instead, it will be strictly equivalent to the old behaviour.

  • new@as_failure_raiser decorator to create a failure raiser by decorating an existing validation function. Fixes#36.

  • WrappingFailure does not exist anymore, it was merged withFailure class for architecture simplification. So there are two main exception classes in valid8 now:ValidationError andValidationFailure. When the validation callable does not raise an instance ofValidationFailure itself, theInvalid subclass is used. Fixes#41

Misc

  • assert_subclass_of now exposed at root level (for consistency withassert_instance_of, to be used in the context manager entry point)

  • Added__version__ attribute to comply with PEP396, followinghttps://smarie.github.io/python-getversion/#package-versioning-best-practices. Fixes#38.

  • result_is_success is now inlined and does not use a set expression anymore. Fixed#37

  • Improved all examples ofFailure in the validation lib to show how a better practice where thehelp_msg stays at class level but can be overridden failure instance by failure instance.

  • Removedlength_betweenopen_left/right arguments as it does not make sense, to continue fixing#29

  • new subpackageutils where all util submodules now live

  • New submodulecommon_syntax where all the logic to handle the*validation_func input syntax resides

  • some type hints renamed for clarity:

    • before:ValidationFuncs /ValidationFunc /CallableType /Callable
    • now:OneOrSeveralVFDefinitions /ValidationFuncDefinition /ValidationCallableOrLamba /ValidationCallable.
    • ValidationFuncs still exists as a short alias forOneOrSeveralVFDefinitions.
  • fixed a few type hints too: tuples with unlimited length were not declared correctly. Now using the ellipsisTuple[<type>, ...].

Seedocumentation page for details.

Loading

4.2.1 - Minor error message fix

09 Sep 13:06
Compare
Choose a tag to compare
Loading

Error messages improvements: removed the brackets inWrong value: [...] for theFailure details. Fixed#32.

Seedocumentation page for details.

Loading
Previous1
Previous

[8]ページ先頭

©2009-2025 Movatter.jp