pydantic / bump-pydantic

Convert Pydantic from V1 to V2 ♻
MIT License
317 stars 24 forks source link

Ensure that warnings are treated as errors and fix encoding errors #94

Closed kkirsche closed 1 year ago

kkirsche commented 1 year ago

Sorry, I had meant to originally create this as a draft / against my fork, but it ended up here.

This merge request is a follow-up to https://github.com/pydantic/bump-pydantic/pull/93 which fixes:

  1. That warning are treated as errors
  2. That the encoding errors identified in the tests are fixed.

This merge request opens encoding as "utf8" in the mypy visitor to align with the default encoding of all python files as of Python 3. Since the logfile is controlled by bump-pydantic, I used utf8 as well for consistency with the python language files.

kkirsche commented 1 year ago

I'll need to come back to this and install hatch as this seems to introduce errors from workflow dependencies and I can't see from the actions where the encoding warning is truly being generated from in the test, so want to see if it's related to running the app itself (so will install and run it that way)

kkirsche commented 1 year ago

Thanks for your help getting it over the finish line. I appreciate that. Excited to look around and see if any other things may be good opportunities for contributions.

I'm working through transitioning five or six decent size applications at work, so seeing what types of things may be good fits, e.g., is it reasonable to detect a missing dependency on pydantic-settings if you're using BaseSettings in PydanticV1 but don't have the corresponding dependency for V2 specified.

Thanks again, though, and hopefully, we can run into each other on more PRs