move pydantic, sqlmodel, alembic to optional dependencies#5438
Merged
move pydantic, sqlmodel, alembic to optional dependencies#5438
Conversation
Contributor
There was a problem hiding this comment.
PR Summary
Major architectural change that makes database-related dependencies (Pydantic, SQLModel, Alembic) optional rather than required, improving modularity and reducing base installation size.
- Replaced Pydantic models with Python dataclasses in
reflex/config.pyandreflex/components/datadisplay/dataeditor.py - Added conditional dependency loading in
reflex/model.pywith helpful error messages when database packages are missing - Moved database dependencies to optional [db] extra group in
pyproject.toml - Fixed typing issues in
tests/integration/test_tailwind.pyto accommodate optional Pydantic - Added conditional Pydantic imports across multiple core files using importlib.util.find_spec
23 files reviewed, 4 comments
Edit PR Review Bot Settings | Greptile
CodSpeed Performance ReportMerging #5438 will degrade performances by 4.77%Comparing Summary
Benchmarks breakdown
|
Contributor
|
Closes #5155 thanks, @adhami3310 |
This was
linked to
issues
Jun 12, 2025
masenf
reviewed
Jun 17, 2025
| keywords = ["web", "framework"] | ||
| requires-python = ">=3.10,<4.0" | ||
| dependencies = [ | ||
| "alembic >=1.15.2,<2.0", |
Member
Author
There was a problem hiding this comment.
well, for now we are preserving "still install everything" till we reach 0.9.0
…el,-alembic-to-optional-dependencies
* Move sqlalchemy-only helpers out of the sqlmodel section * Remove sqlmodel pydantic v2 hacks -- just use pydantic v2 now * Import guard other parts of the code that were importing sqlalchemy
…el,-alembic-to-optional-dependencies
Kastier1
approved these changes
Oct 7, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.