Skip to content

Add typed ORM fields and blocking basedpyright CI - #224

Merged
tmgbedu merged 10 commits into
mainfrom
feat/typed-orm-fields-basedpyright
Sep 13, 2026
Merged

Add typed ORM fields and blocking basedpyright CI#224
tmgbedu merged 10 commits into
mainfrom
feat/typed-orm-fields-basedpyright

Conversation

@tmgbedu

@tmgbedu tmgbedu commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

Summary

Support declarative ORM fields such as id = Field[int](), inferred defaults such as Field(default=False), and nested Pydantic values such as address = Field[Address](). Register field specifiers with dataclass_transform on the base model, derive runtime casts from explicit generic types or defaults, and include descriptor-only fields in fillable attributes.

Keep ModelField available for compatibility and emit a deprecation warning announcing removal in 2.x, with Field[YourModel]() as the replacement.

Replace Pyright with basedpyright in development dependencies and CI. The type-check job is blocking and has no baseline: existing type errors will currently fail CI and are deferred for subsequent work.

Validation

  • 53 focused ORM model, attribute, and SQLite casting tests passed, including deprecated ModelField compatibility.
  • Focused basedpyright checks on the field implementation and model fixture passed; this is not a clean full-project type check.
  • git diff --check passed.

@codecov

codecov Bot commented Sep 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

tmgbedu and others added 3 commits September 12, 2026 17:28
Resolve conflicts in fastapi_startkit/pyproject.toml and
masoniteorm/models/model.py.

- pyproject.toml: keep basedpyright from this branch alongside main's
  pyright and pytest-benchmark dev dependencies.
- model.py: union the typing imports so the dataclass_transform decorator
  on Model coexists with main's overload-typed where() and get().
- uv.lock regenerated with `uv sync`.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
tests/utils/test_structures.py imported `fastapi_startkit.utils.structures`,
a module that does not exist, so collection aborted with ModuleNotFoundError
and took the whole suite down with it. The helpers `load`, `data`, `data_get`
and `data_set` live in `fastapi_startkit.support.structures`.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@tmgbedu
tmgbedu merged commit 4cd5bb3 into main Sep 13, 2026
4 of 6 checks passed
@tmgbedu
tmgbedu deleted the feat/typed-orm-fields-basedpyright branch September 13, 2026 03:58
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.

1 participant