turms
turms copied to clipboard
Support pydantic v2
Now that pydantic v2 is out for a while, and stabilized, we should consider supporting the newer patterns.
There is two axes to this.
Code Generation
Code generation could change in two ways
Plugin Based This should be more straightforward and would just necessitate to generate new plugins that would generate v2 code.
Api Based We could imaging a global API paramete:
pydantic_version: 1 # or two
That would allow this to be set globally. This would however require an intermediary code generator class, that would then delegate to the right api.
While a massive refactor ought to happen soon, i do tend to the plugin based approach, as it would allow us to maintain the code as is.
Internal
Turms uses pydantic internally to load and validate the configuration. Not sure how to best to the transition here yet. Anybody a great idea, whats best practices for a dev tool?
Feedback very welcome :)