dmontagu / fastapi-utils

Reusable utilities for FastAPI
MIT License
1.84k stars 163 forks source link

Migrate to pydantic 2.0 #277

Closed pavelzw closed 5 months ago

pavelzw commented 1 year ago

Closes #276

jonashaag commented 1 year ago

Is it possible to keep supporting Pydantic 1?

pavelzw commented 1 year ago

I don't think that we can specify "install pydantic-settings only if pydantic < 2.0" in poetry... Otherwise yes, that should be easy.

It also doesn't seem to work with optional groups :(

Optional group dependencies will still be resolved alongside other dependencies, so special care should be taken to ensure they are compatible with each other.

We could just not write pydantic-settings into the dependencies but this is also suboptimal...

pavelzw commented 1 year ago

@dmontagu could you take a look at this PR please?

jonashaag commented 1 year ago

Would be a real bummer to drop Pydantic 1 support... Pydantic 1 is going to be used by lots of people for a few years.

pavelzw commented 1 year ago

I think adding pydantic-settings as an optional dependency is the best compromise.

kgadek93 commented 12 months ago

Hi, I really need these changes. Can we somehow speed up the review and release process? 🙏

pavelzw commented 11 months ago

Pinging @dmontagu for visibility.

pavelzw commented 11 months ago

https://github.com/yuval9313/FastApi-RESTful is a fork of fastapi-utils that is more active and already has support for pydantic 2. Feel free to check it out.

ohmeow commented 7 months ago

Any update on this?

Thanks!