pydantic-pycharm-plugin icon indicating copy to clipboard operation
pydantic-pycharm-plugin copied to clipboard

Support Pydantic V2

Open koxudaxi opened this issue 2 years ago • 4 comments

Pydantic V2 changes some behavior. This issue should list all related issues and PRs related to V2.

  • [x] Add an error when __root__ is set in the model. #696
  • [ ] Strict mode type-checking.
  • [ ] Validator without a model.
  • [ ] Required and Nullable behavior like dataclass
  • [ ] Aliases in Field
  • [x] Warning removed methods.
  • [ ] Respect conversion types table in type-checking.
  • [ ] Suggest running migration tools for v2
    • [x] Jump to v2 migration documents
    • [ ] Run v2 migration tool

koxudaxi avatar Apr 03 '23 00:04 koxudaxi

Thanks so much for pinging me @koxudaxi.

In general this sounds great, a few pointers:

  • https://github.com/pydantic/pydantic/pull/5343 contains what migration guide we have, it'll be improved today ahead of the first alpha
  • https://github.com/pydantic/pydantic/pull/5324 contains code for the conversion table that you should ultimately be able to use when marking arguments as valid or invalid, please comment their if you have any feedback
  • https://github.com/pydantic/pydantic/issues/5013 for details on an auto-migration tool
  • most of the warnings on removed methods should already work since pycharm spots DeprecationWarning and puts a line through the function.

samuelcolvin avatar Apr 03 '23 13:04 samuelcolvin

@samuelcolvin I'm checking the links. Btw, Thank you for sponsoring me :bow:

koxudaxi avatar Apr 03 '23 15:04 koxudaxi

No problem, thank you for everything you've done.

samuelcolvin avatar Apr 03 '23 21:04 samuelcolvin