dmontagu / fastapi-utils

Reusable utilities for FastAPI
MIT License
1.91k stars 166 forks source link

[FEATURE] Support Pydantic 2.0 #276

Closed wintonzheng closed 4 months ago

wintonzheng commented 1 year ago

Is your feature request related to a problem? Please describe. pydantic v2 got released. However, fastapi-utils has a pydantic<2.0 constraint: https://github.com/dmontagu/fastapi-utils/blob/3ef27a6f67ac10fae6a8b4816549c0c44567a451/pyproject.toml#L43

Describe the solution you'd like I would like to be able to use pydantic v2 and fastapi-utils together. Can we build the support for pydantic v2?

Describe alternatives you've considered N/A

Additional context N/A

yogsagot commented 1 year ago

Same issue here.

ERROR: Cannot install -r requirements.txt (line 1), -r requirements.txt (line 2) and pydantic==2.0.2 because these package versions have conflicting dependencies.
The conflict is caused by:
    The user requested pydantic==2.0.2
    fastapi 0.100.0 depends on pydantic!=1.8, !=1.8.1, !=2.0.0, !=2.0.1, <3.0.0 and >=1.7.4
    fastapi-utils 0.2.1 depends on pydantic<2.0 and >=1.0
kgadek93 commented 1 year ago

Hi @dmontagu, Are there any plans to release it in near future? Pydyantic v2 provides many fixes.

pavelzw commented 1 year 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.

priyanshu-panwar commented 1 year ago

https://github.com/priyanshu-panwar/fastapi-utilities is based on this project and has support for it.

yuval9313 commented 4 months ago

Fixed in version 0.6.0 in pr #291