make pydantic optional - #6786
Conversation
Merging this PR will not alter performance
Comparing Footnotes
|
Greptile SummaryThis PR makes
Confidence Score: 5/5Safe to merge. The packaging change is a clean extraction of pydantic into an optional extra; the db extra retains pydantic directly so existing users of reflex[db] are unaffected. The change is isolated to dependency declarations and a new test file. The subprocess-based test correctly isolates the without-pydantic path using both meta_path wrapping and sys.modules purge, matching the concerns from the existing review thread. No runtime logic is altered in this PR. Files Needing Attention: No files require special attention.
|
| Filename | Overview |
|---|---|
| packages/reflex-base/pyproject.toml | Removes pydantic from hard deps; adds it as optional-dep pydantic = ["pydantic >=2.12.0,<3.0"]. |
| pyproject.toml | Adds pydantic = ["reflex-base[pydantic]"] optional extra to the root reflex package; db extra keeps pydantic directly for backwards compatibility. |
| tests/units/test_optional_pydantic.py | New test that spawns a subprocess with pydantic/sqlmodel/alembic/sqlalchemy blocked via meta_path wrappers and sys.modules purge, then verifies state, component render, and serializers all work without those packages present. |
| news/+pydantic-optional.breaking.md | Changelog entry describing the breaking change; mentions the new reflex[pydantic] and reflex[db] install paths. |
| packages/reflex-base/news/+pydantic-optional.breaking.md | Changelog entry for reflex-base describing pydantic as no longer a hard dependency. |
Reviews (6): Last reviewed commit: "Merge remote-tracking branch 'upstream/m..." | Re-trigger Greptile
masenf
left a comment
There was a problem hiding this comment.
interesting; i thought we had pydantic as optional for some time now, but i guess not...
I remember reading some git commits or changelogs which mentioned this as well - however somehow it currently isn't optional. I guess this is ready for review now. |
No description provided.