Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Pydantic v1 API from v2 #27

Merged
merged 5 commits into from
Aug 1, 2023
Merged

Use Pydantic v1 API from v2 #27

merged 5 commits into from
Aug 1, 2023

Conversation

mattwthompson
Copy link
Member

@mattwthompson mattwthompson commented Aug 1, 2023

Description

This is an easier attempt at #26, enabling v2 to be installed while basically keeping the code the same, using pydantic.v1.

Thanks for @jthorton for tipping us off to https://docs.pydantic.dev/latest/migration/#continue-using-pydantic-v1-features.

Todos

Notable points that this PR has either accomplished or will accomplish.

  • Set up testing for both Pydantic versions
  • Update codebase to use v1 from pydantic.v1 import path

Questions

  • Question1

Status

  • Ready to go

updates:
- [github.com/psf/black: 23.3.0 → 23.7.0](psf/black@23.3.0...23.7.0)
- [github.com/PyCQA/flake8: 6.0.0 → 6.1.0](PyCQA/flake8@6.0.0...6.1.0)
- [github.com/asottile/pyupgrade: v3.4.0 → v3.10.1](asottile/pyupgrade@v3.4.0...v3.10.1)
@mattwthompson mattwthompson force-pushed the pydantic-1-2 branch 3 times, most recently from c15c48e to 273b83e Compare August 1, 2023 10:34
@codecov-commenter
Copy link

codecov-commenter commented Aug 1, 2023

Codecov Report

Merging #27 (7ab6620) into main (ff399c9) will increase coverage by 0.09%.
The diff coverage is 100.00%.

Additional details and impacted files

@mattwthompson
Copy link
Member Author

This is working much better than I expected (and I expected it to work well and work quickly) at least by the green check.

Could I get a quick pair of eyes to make sure I'm not missing anything obvious @jthorton or @hmacdope?

@mattwthompson mattwthompson marked this pull request as ready for review August 1, 2023 10:44
Copy link

@hmacdope hmacdope left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! I don't see anything wrong and if tests aren't complaining seems good.

Copy link

@jthorton jthorton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! I tried searching for other pydantic instances and didn't find anything. I also love the testing of both versions, great job!

@mattwthompson
Copy link
Member Author

Thanks both! Now to incrementally do the same for every other repo ... 😁

@mattwthompson mattwthompson merged commit 7dc163a into main Aug 1, 2023
24 checks passed
@mattwthompson mattwthompson deleted the pydantic-1-2 branch August 1, 2023 10:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants