Skip to content
This repository was archived by the owner on Nov 10, 2024. It is now read-only.

Conversation

@ollz272
Copy link

@ollz272 ollz272 commented Jul 9, 2023

Bumps to pydantic v2. Please advise on any other updates needed, as we would like to start using v2 in our projects. thanks.

@ollz272
Copy link
Author

ollz272 commented Jul 11, 2023

please review

@yuval9313
Copy link
Owner

Hey, consider other people using this library and straighten with fastapi's approach on this subject

Since fastapi 0.100 supports pydantic v1 and v2 we should as well

@ollz272
Copy link
Author

ollz272 commented Jul 14, 2023

@yuval9313 Ok - I've updated the PR to support both v1 and v2. I've added into the test suite to test both v1 and v2 installs. I've also tested locally and looks okay to me. There is also a separate package install to get V2 required packages.

@yuval9313
Copy link
Owner

Alright, I assume it's OK

Just one question, why didn't you include v2 in all? Also I assume default behavior should use pydantic 2, is there a way to not install dependencies when we want the v1? Does that makes sense?

Maybe it means that pydantic-settings should be installed for both v1 and v2?

What do you think?

@ollz272
Copy link
Author

ollz272 commented Jul 14, 2023

why didn't you include v2 in all?

I kinda assumed we'd want v2 to be explicitly optin - i can move this though

Also I assume default behavior should use pydantic 2, is there a way to not install dependencies when we want the v1?

I'm honestly not sure - i can take a look?

Maybe it means that pydantic-settings should be installed for both v1 and v2?

pydantic-settings requires V2, so can only be installed when v2 is present.

@yuval9313
Copy link
Owner

I think the default option should be v2.
We want to progress and eventually rid of v1 when it is obsolete in fastapi

I wish I could ask you to separate pydantic from this lib exactly like fastapi but unfortunately I'd call that out of scope

Can you please find out if it possible to install v1 via extras?

@yuval9313
Copy link
Owner

I know it's confusing but don't change the PR yet

Tell me if you think there is a solution to the v2/v1 issue prior to changing the lib

yuval9313
yuval9313 previously approved these changes Jul 14, 2023
@yuval9313
Copy link
Owner

yuval9313 commented Jul 16, 2023

Hey can you make sure you pass the ci?
We've decided that only braking change would replace the version of pydantic to v2

@ollz272
Copy link
Author

ollz272 commented Jul 20, 2023

Hey can you make sure you pass the ci? We've decided that only braking change would replace the version of pydantic to v2

Thanks - I've updated:

  • I've made the decision to only use mypy for V2. Its impossible to get it passing for both, and since this is default i figure this is the one worth type checking.
  • I've updated the dependencies to install V2 things with all.

@ollz272
Copy link
Author

ollz272 commented Jul 21, 2023

Right @yuval9313 , sorry, that should now pass ci 😆

@ollz272
Copy link
Author

ollz272 commented Jul 25, 2023

Thanks for approving @yuval9313! is it possible to get a release with this in soon? 🙏🏻

@yuval9313
Copy link
Owner

Yes, can you merge?

@ollz272
Copy link
Author

ollz272 commented Jul 25, 2023

@yuval9313 I dont have write permissions so can't merge, unfortunately.

@yuval9313 yuval9313 merged commit 22e61d2 into yuval9313:master Jul 29, 2023
@yuval9313 yuval9313 linked an issue Aug 9, 2023 that may be closed by this pull request
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Please support pydantic V2

2 participants