sarugaku / plette

Structured Pipfile and Pipfile.lock models.
ISC License
7 stars 7 forks source link

Validation using pure python #57

Closed oz123 closed 2 months ago

oz123 commented 2 months ago

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.

oz123 commented 2 months ago

Note, I intend to release this version as 2.0.0 and mark 1.0.0 as obsolete. There are no "new features" here, but it's again a complete rewrite.