Skip to content

Comments

move pydantic, sqlmodel, alembic to optional dependencies#5438

Merged
Kastier1 merged 48 commits intomainfrom
move-pydantic,-sqlmodel,-alembic-to-optional-dependencies
Oct 7, 2025
Merged

move pydantic, sqlmodel, alembic to optional dependencies#5438
Kastier1 merged 48 commits intomainfrom
move-pydantic,-sqlmodel,-alembic-to-optional-dependencies

Conversation

@adhami3310
Copy link
Member

No description provided.

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.py and reflex/components/datadisplay/dataeditor.py
  • Added conditional dependency loading in reflex/model.py with 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.py to 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-hq
Copy link

codspeed-hq bot commented Jun 12, 2025

CodSpeed Performance Report

Merging #5438 will degrade performances by 4.77%

Comparing move-pydantic,-sqlmodel,-alembic-to-optional-dependencies (3f85492) with main (c923a97)

Summary

❌ 1 (👁 1) regression
✅ 7 untouched

Benchmarks breakdown

Benchmark BASE HEAD Change
👁 test_evaluate_page[_stateful_page] 6.2 ms 6.5 ms -4.77%

@benedikt-bartscher
Copy link
Contributor

Closes #5155

thanks, @adhami3310

This was linked to issues Jun 12, 2025
keywords = ["web", "framework"]
requires-python = ">=3.10,<4.0"
dependencies = [
"alembic >=1.15.2,<2.0",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still needed?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well, for now we are preserving "still install everything" till we reach 0.9.0

@Kastier1 Kastier1 merged commit c28bdba into main Oct 7, 2025
37 of 41 checks passed
@Kastier1 Kastier1 deleted the move-pydantic,-sqlmodel,-alembic-to-optional-dependencies branch October 7, 2025 22:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

make sqlmodel dependency optional Upgrade to Pydantic 2.0

4 participants