-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Pydantic v2 still not compatible with Reflex 0.4.6 loosened requirements? #3019
Comments
Even after relaxing the reflex-hosting-cli pydantic pin, there is still a fundamental incompatibility with Reflex using v1 (imported from v2) and SQLModel changing how it works based on which pydantic version is installed. I'm looking into the issue in the next few days, but I think Reflex will need to fully go to pydantic v2 and drop v1 support entirely. |
Yep... I'm running into those issues now too... (I temporarily copied the I think you are right that the best option is for Reflex to go fully to pydantic v2 (very excited for this!!!). In the meantime, I have had some success with this hacky solution...
I.e. importing sqlmodel in a context where it thinks pydantic v1 is installed before anything reflex related. Additionally, I think there is a small mistake in the
I think a full migration to v2 is best, but maybe worth considering this as an option in the meantime since anyone using SQLModel with reflex will anyway be using pydantic v1 currently. |
This is a cool albeit super hacky approach. My plan was to just let the Model use pydantic v2, even tho everything else is using v1... but that's a lot more code change. I kinda like your hack for the next few releases until we can get our full v2 migration merged in (0.5.0 is the milestone for that) |
Yep, surely is hacky, but as you say, might be a good temporary solution until 0.5.0. |
When importing sqlmodel, we need to fake like pydantic v2 is actually v1 for compatibility with Reflex's rx.Base (which is still based on pydantic v1 BaseModel) Inspired by #3019
Describe the bug
I see in the notes for the
v0.4.6
release that the requirements forreflex
were loosened to allowPydantic v2
, however, I'm still running into an issue withreflex
depending onreflex-hosting-cli
which depends onpydantic < 2
.Poetry error:
It seems like #2777 was about this issue, and was closed with #2796, but I guess the
reflex-hosting-cli
part was not addressed yet?Is there going to be a new release of the hosting-cli with loosened dependencies soon?
Other related issues and PRs:
#1539
To Reproduce
Steps to reproduce the behavior:
pydantic>=2.0.0
as a dependencyreflex
as another dependencyExpected behavior
Should be solvable given the loosend requirements for
reflex
Specifics (please complete the following information):
The text was updated successfully, but these errors were encountered: