PurpleMyst / sansio-lsp-client

An implementation of the client side of the LSP protocol, useful for embedding easily in your editor.
MIT License
23 stars 9 forks source link

Update Pydantic to 2.x #55

Open benjamin-kirkbride opened 1 year ago

benjamin-kirkbride commented 1 year ago

I need Pydantic 2.x for a thing I'm working on but "sansio-lsp-client 0.10.0 requires pydantic<2.0.0,>=1.7.3"

PurpleMyst commented 1 year ago

Our usage of pydantic is rather easy to migrate, at it seems we'd only need to update our usage of Config and parse_obj_as. I'm curious what @Akuli thinks of the matter, as one option is just detecting at runtime if pydantic>=2.0.0 is installed and, if so, importing everything from the pydantic.v1 module. That way we'd practically be version agnostic, apart from some more subtle changes we'd have to review.

Akuli commented 1 year ago

I don't think we need to keep v1 support, unless someone specifically asks for it, and in that case pydantic.v1 is probably the best option.

Also, nice to see that you are still around :)