Validation using dataclasses sounded like a great idea, and while I learned a lot from this experiment, I unfortunately released a broken version.
Despite all tests were passing, some public interfaces which were not tested caused severe errors.
Earlier versions of plette saved the original snippets parsed by tomlkit as _data attribute for each instance.
These containers behave like dicts, but actually aren't. Hence, trying to model them as dictionaries and cast away the
original data proved tricky.
This refactor keeps the original approach of keeping the tomlkit containers in _data. In addition, validation is now always enforced, as it does not depend on Cerberus.
I believe this approach is simpler and easier to maintain. The real test though is if I can integrate this into pipenv without changing pipenv's tests or it's usage of plette.
Validation using dataclasses sounded like a great idea, and while I learned a lot from this experiment, I unfortunately released a broken version. Despite all tests were passing, some public interfaces which were not tested caused severe errors.
Earlier versions of plette saved the original snippets parsed by
tomlkit
as_data
attribute for each instance. Thesecontainers
behave like dicts, but actually aren't. Hence, trying to model them as dictionaries and cast away the original data proved tricky.This refactor keeps the original approach of keeping the
tomlkit
containers in_data
. In addition, validation is now always enforced, as it does not depend on Cerberus.I believe this approach is simpler and easier to maintain. The real test though is if I can integrate this into pipenv without changing pipenv's tests or it's usage of plette.