0.10.0
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
ValidationErrorbase class to separate modulevalidataclass.exceptions.base_exceptions. #117- This should not break any code as long as you import
ValidationErrorfrom thevalidataclass.exceptionspackage instead of thevalidataclass.exceptions.common_exceptionsmodule. 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.
- This should not break any code as long as you import
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-dateutilfrom 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
testingextra requirements.
- This library was previously a dependency of validataclass. However, it was only needed in the unit tests, so it has been moved to the
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
Miscellaneous
DateTimeValidator: Unify class docstring with Markdown documentation. #113- Miscellaneous code reformatting, more consistent docstrings, unit test refactoring. #119
New contributors
- @flauschzelle made her first contributions in #110 and #111.