Skip to content

0.10.0

Choose a tag to compare

@binaryDiv binaryDiv released this 07 May 12:49
· 31 commits to main since this release
1459630

Full changelog

This release features custom pre-validation in dataclasses using the __pre_validate__() method and a change to the accepted format of datetimes in the DateTimeValidator to accept arbitrary decimal places after seconds.

This also is a "spring cleaning" release that contains a lot of miscellaneous refactorings and code cleanup, as well as some preparation for full mypy support (#116).

It also drops support for Python 3.7 and adds support for Python 3.12.

Added

  • Official support for Python 3.12. #112
  • Custom pre-validation in dataclasses using the __pre_validate__ class method. #115

Changed

  • DateTimeValidator: Accept datetimes with arbitrary precision (by @flauschzelle). #111, #113
    • This is not a breaking change, unless you specifically want to restrict datetime input strings to exactly 0, 3 or 6 decimal places after the seconds. It does not really matter for the result.
  • Move ValidationError base class to separate module validataclass.exceptions.base_exceptions. #117
    • This should not break any code as long as you import ValidationError from the validataclass.exceptions package instead of the validataclass.exceptions.common_exceptions module. If you do import it from the module, it should still work because the class is imported there as well, but you might get linter warnings.
  • DataclassValidator: Simplify check and error handling for when the specified dataclass is not a dataclass. #120

Removed

  • Breaking change: Drop support for Python 3.7. #118
  • Remove python-dateutil from install requirements. #122
    • This library was previously a dependency of validataclass. However, it was only needed in the unit tests, so it has been moved to the testing extra requirements.

Fixed

  • Fix style of type comparisons in some unit tests (by @flauschzelle). #110
  • Fix various typing issues reported by mypy, add missing type annotations and other related changes. #120, #121

Testing / CI

  • Add mypy to development environment and CI pipeline. #120

Miscellaneous

  • DateTimeValidator: Unify class docstring with Markdown documentation. #113
  • Miscellaneous code reformatting, more consistent docstrings, unit test refactoring. #119

New contributors