Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
2243535
initial migration
benedikt-bartscher Apr 28, 2026
394ead6
improve typing
benedikt-bartscher Apr 28, 2026
66d3326
update pyi
benedikt-bartscher Apr 28, 2026
08231d5
some typing stuff
benedikt-bartscher Apr 28, 2026
b57afce
do it like stdlib does for dataclasses
benedikt-bartscher Apr 28, 2026
6f36c66
fix type confusion
benedikt-bartscher Apr 28, 2026
d16d057
fix some more type ignores
benedikt-bartscher Apr 28, 2026
501b351
even more typing fixes
benedikt-bartscher Apr 28, 2026
f7bfd25
bump ty
benedikt-bartscher May 6, 2026
1da8a7f
Merge remote-tracking branch 'upstream/main' into migrate-pyright-to-ty
benedikt-bartscher May 6, 2026
fabfba2
ruff format
benedikt-bartscher May 6, 2026
28ac1e1
Merge remote-tracking branch 'upstream/main' into migrate-pyright-to-ty
benedikt-bartscher May 23, 2026
c8c4dff
bump ty, adjust some typing
benedikt-bartscher May 23, 2026
6a4b3b7
pyi
benedikt-bartscher May 23, 2026
7e6578f
fix import
benedikt-bartscher May 24, 2026
3ce9c63
less type ignores
benedikt-bartscher May 24, 2026
64734b9
some more typing stuff
benedikt-bartscher May 24, 2026
d39f7c7
eliminate more type ignores
benedikt-bartscher May 24, 2026
440e7b6
add passthrough_event_spec overload
benedikt-bartscher May 24, 2026
a10eff7
re-add docs
benedikt-bartscher May 24, 2026
114e076
fix docs
benedikt-bartscher May 25, 2026
0e31f36
revert docs
benedikt-bartscher May 25, 2026
fa1a17f
Merge upstream/main into migrate-pyright-to-ty
benedikt-bartscher May 29, 2026
7db7e00
less type ignores
benedikt-bartscher May 29, 2026
d6713fa
pre-commit
benedikt-bartscher May 29, 2026
3d4589f
more typing
benedikt-bartscher May 29, 2026
b2867cc
use future annotations
benedikt-bartscher May 29, 2026
3ac5147
drop pyright ignores, use final
benedikt-bartscher May 29, 2026
1c52796
more final, less ignore
benedikt-bartscher May 29, 2026
bc89a87
drop type ignores
benedikt-bartscher May 29, 2026
15d26b4
streamline signature assignment
benedikt-bartscher May 29, 2026
2510a90
add callable_qualname
benedikt-bartscher May 29, 2026
16a3c8d
remove double ignores
benedikt-bartscher May 29, 2026
3225280
Merge remote-tracking branch 'upstream/main' into migrate-pyright-to-ty
benedikt-bartscher Jul 7, 2026
582bf98
bump ty
benedikt-bartscher Jul 7, 2026
b5ba90c
fix some typing
benedikt-bartscher Jul 7, 2026
39969fe
Merge remote-tracking branch 'upstream/main' into migrate-pyright-to-ty
benedikt-bartscher Jul 18, 2026
d696a65
ty adjustments for new code from main
benedikt-bartscher Jul 18, 2026
e7475eb
typing wip
benedikt-bartscher Aug 8, 2026
0833064
Merge remote-tracking branch 'origin/main' into migrate-pyright-to-ty
benedikt-bartscher Aug 20, 2026
3475185
wip
benedikt-bartscher Aug 20, 2026
de1b64d
Merge remote-tracking branch 'origin/main' into migrate-pyright-to-ty
benedikt-bartscher Sep 21, 2026
d83b130
Run the minimum-dependency check with ty
benedikt-bartscher Sep 21, 2026
f88c78d
Merge remote-tracking branch 'upstream/main' into migrate-pyright-to-ty
benedikt-bartscher Oct 2, 2026
3429822
Merge remote-tracking branch 'upstream/main' into migrate-pyright-to-ty
benedikt-bartscher Oct 20, 2026
eeec9cc
Read literal values through cast wrappers in get_var_value
benedikt-bartscher Oct 21, 2026
cd54809
Merge remote-tracking branch 'upstream/main' into migrate-pyright-to-ty
benedikt-bartscher Oct 21, 2026
c5c0b35
Merge remote-tracking branch 'upstream/main' into migrate-pyright-to-ty
benedikt-bartscher Oct 21, 2026
bbd2deb
Regenerate pyi hashes after the upstream merge
benedikt-bartscher Oct 21, 2026
be98d4a
Raise the recharts reflex-base floor and drop the duplicate component…
benedikt-bartscher Oct 25, 2026
270d08f
Type the SQLModel config as a ClassVar dict
benedikt-bartscher Oct 25, 2026
dc8a17f
Merge remote-tracking branch 'upstream/main' into migrate-pyright-to-ty
benedikt-bartscher Oct 25, 2026
3c6f4b9
Floor reflex-components-internal on the reflex-base it type-checks ag…
benedikt-bartscher Oct 25, 2026
7f8a74c
Drop the type-only issubclass check in telemetry accounting
benedikt-bartscher Oct 25, 2026
7f246fc
Merge static dependencies that resolve to the same state
benedikt-bartscher Oct 25, 2026
b2f584b
Floor reflex-components-core on the sonner with ToastProps defaults
benedikt-bartscher Oct 25, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
19 changes: 10 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,20 +54,21 @@ repos:
require_serial: true
- repo: local
hooks:
- id: pyright
name: pyright
entry: uv run --no-sync pyright
- id: ty
name: ty
entry: uv run --no-sync ty check
language: system
types: [python]
pass_filenames: false
require_serial: true
- repo: local
hooks:
# The second opinion the assert_type examples exist for. Always runs: what
# these examples catch is a source change altering an inferred type, so
# scoping the hook to the examples themselves would never fire on the edit
# that broke them.
- id: ty
name: ty
# The assert_type examples, re-checked against the newest Python the project
# supports. Always runs: what these examples catch is a source change altering
# an inferred type, so scoping the hook to the examples themselves would never
# fire on the edit that broke them.
- id: ty-type-checking
name: ty-type-checking
entry: uv run --no-sync ty check --python-version 3.14 tests/type_checking
language: system
always_run: true
Expand Down
6 changes: 3 additions & 3 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ uv run pytest tests/units --cov --no-cov-on-fail --cov-report= # unit tests (>
uv run pytest tests/integration # integration tests (slow)
uv run ruff check . # lint
uv run ruff format . # format
uv run pyright reflex tests # type check
uv run python scripts/check_min_deps.py # validate each package's declared minimum dep versions (pyright in isolated min-version envs; workspace siblings resolve from locally built wheels, all other deps from PyPI). CI passes --wheelhouse instead, reusing the build jobs' artifacts
uv run ty check # type check
uv run python scripts/check_min_deps.py # validate each package's declared minimum dep versions (ty in isolated min-version envs; workspace siblings resolve from locally built wheels, all other deps from PyPI). CI passes --wheelhouse instead, reusing the build jobs' artifacts
uv run python scripts/check_min_deps.py --check-dev-pins [pkg] # fail if pkg (default: all) declares an unpublishable *.dev dependency pin (the publish workflow runs the same gate via `reflex-release check-dev-pins`)
uv run reflex-release sync # regenerate the release workflows after editing [tool.reflex-release] or the reflex-release templates
uv run python scripts/make_pyi.py # regenerate .pyi stubs
Expand Down Expand Up @@ -210,7 +210,7 @@ if TYPE_CHECKING:
Before submitting:
1. Tests pass with adequate coverage
2. `uv run ruff check .` and `uv run ruff format .` clean
3. `uv run pyright reflex tests` passes
3. `uv run ty check` passes
4. `pyi_hashes.json` updated if components changed
5. Documentation updated if user-facing behavior changed
6. News fragment added for user-facing changes
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ Next make sure all the following tests pass. This ensures that every new change

```bash
uv run ruff check .
uv run pyright reflex tests
uv run ty check
```

Finally, run `ruff` to format your code.
Expand All @@ -184,7 +184,7 @@ Finally, run `ruff` to format your code.
uv run ruff format .
```

Consider installing git pre-commit hooks so Ruff, Pyright, and `make_pyi` will run automatically before each commit.
Consider installing git pre-commit hooks so Ruff, ty, and `make_pyi` will run automatically before each commit.

```bash
uv run pre-commit install
Expand Down
2 changes: 1 addition & 1 deletion docs/app/reflex_docs/pages/docs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,7 @@ def register_doc(virtual_doc: str, comp):


# Alias needed by sidebar — the library page route object.
library_: Route = library # type: ignore[assignment]
library_: Route = library


# Process all docs via reflex_docgen pipeline.
Expand Down
2 changes: 1 addition & 1 deletion docs/app/reflex_docs/pages/docs/cloud_cliref.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ def process_command(command: click.Command, name: str) -> str:


if find_spec("typer") is not None and find_spec("typer.main") is not None:
import typer # pyright: ignore[reportMissingImports]
import typer

if isinstance(cli, typer.Typer):
cli = typer.main.get_command(cli)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ def sidebar_comp(
rx.cond(is_docs_ai_builder, ai_builder_content, docs_content),
)

return rx.box( # pyright: ignore [reportCallIssue]
return rx.box(
categories,
content,
style={
Expand Down
2 changes: 1 addition & 1 deletion docs/app/reflex_docs/utils/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def once(f: Callable[[], T]) -> Callable[[], T]:
def wrapper() -> T:
nonlocal value
value = f() if value is unset else value
return value # pyright: ignore[reportReturnType]
return value

return wrapper

Expand Down
2 changes: 1 addition & 1 deletion examples/playground/.content-hash
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sha256:4e394b7fae5105fdd5820509cefc0ee7bd5d4e05714a89cfb8d1478568123ef5
sha256:651c89480e23f669f2388196cf4bac2397fff2e8363a1cd1544e25e07a53a030
2 changes: 1 addition & 1 deletion examples/playground/playground/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def seed_database():
"""
with rx.session() as session:
connection = session.connection()
product_table = Product.__table__ # pyright: ignore[reportAttributeAccessIssue]
product_table = Product.__table__ # ty:ignore[unresolved-attribute]
connection.execute(CreateTable(product_table, if_not_exists=True))
table = Product.__tablename__
if connection.exec_driver_sql(f"SELECT 1 FROM {table} LIMIT 1").first():
Expand Down
2 changes: 1 addition & 1 deletion examples/playground/playground/pages/charts.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from playground.layout import layout
from playground.states.charts import KINDS, MAX_POINTS, MIN_POINTS, ChartsState

CHART_SIZE = {"width": "100%", "height": 280}
CHART_SIZE: dict[str, Any] = {"width": "100%", "height": 280}


def waves_chart() -> rx.Component | rx.Var:
Expand Down
2 changes: 1 addition & 1 deletion examples/playground/playground/pages/grids.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def grids() -> rx.Component:
rx.data_editor(
columns=EDITOR_COLUMNS,
data=GridState.rows,
on_cell_edited=GridState.edit_cell, # pyright: ignore[reportArgumentType]
on_cell_edited=GridState.edit_cell, # ty:ignore[invalid-argument-type]
height="20rem",
),
id="grids-editor",
Expand Down
2 changes: 1 addition & 1 deletion examples/playground/playground/pages/item.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ def item() -> rx.Component:
rx.vstack(
rx.heading("Item"),
# Dynamic route arguments are vars of the root state.
rx.text("item_id: ", rx.code(rx.State.item_id, id="item-id")), # pyright: ignore[reportAttributeAccessIssue]
rx.text("item_id: ", rx.code(rx.State.item_id, id="item-id")), # ty:ignore[unresolved-attribute]
)
)
4 changes: 2 additions & 2 deletions examples/playground/playground/pages/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def settings() -> rx.Component:
name.capitalize(),
rx.switch(
checked=SettingsState.switches[name],
on_change=lambda _, name=name: SettingsState.flip(
on_change=lambda _, name=name: SettingsState.flip( # ty:ignore[invalid-argument-type] https://github.com/astral-sh/ty/issues/4098
name
),
id=f"settings-switch-{name}",
Expand Down Expand Up @@ -123,7 +123,7 @@ def settings() -> rx.Component:
rx.callout(
"The accent previews here; the app theme stays violet.",
icon="info",
color_scheme=SettingsState.accent, # pyright: ignore[reportArgumentType]
color_scheme=SettingsState.accent, # ty:ignore[invalid-argument-type]
size=rx.cond(SettingsState.compact, "1", "2"),
id="settings-preview",
),
Expand Down
4 changes: 2 additions & 2 deletions examples/playground/playground/pages/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def task_row(task: rx.vars.ObjectVar[Task]) -> rx.Component:
return rx.hstack(
rx.checkbox(
checked=task.done,
on_change=lambda _: TasksState.toggle(task.id),
on_change=lambda _: TasksState.toggle(task.id), # ty:ignore[invalid-argument-type] https://github.com/astral-sh/ty/issues/4098
),
rx.text(
task.title,
Expand Down Expand Up @@ -123,7 +123,7 @@ def tasks() -> rx.Component:
*[
rx.input(
placeholder=f"note on {tag}",
on_blur=lambda value, tag=tag: TasksState.set_note(tag, value),
on_blur=lambda value, tag=tag: TasksState.set_note(tag, value), # ty:ignore[invalid-argument-type] https://github.com/astral-sh/ty/issues/4098
id=f"tasks-note-{tag}",
)
for tag in TAG_CHOICES
Expand Down
2 changes: 1 addition & 1 deletion examples/playground/playground/states/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def _query(self):
"""Query the current page of the filtered, sorted products."""
statement = Product.select()
if self.query:
statement = statement.where(Product.name.contains(self.query)) # pyright: ignore[reportAttributeAccessIssue]
statement = statement.where(Product.name.contains(self.query)) # ty:ignore[unresolved-attribute]
if self.category != "all":
statement = statement.where(Product.category == self.category)
column = getattr(Product, self.sort_by)
Expand Down
2 changes: 1 addition & 1 deletion examples/playground/playground/states/editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def save(self, form_data: dict[str, Any]):
return rx.toast.error("Fix the highlighted fields.")
with rx.session() as session:
if self.product is None:
product = Product(listed_day=0, **values) # pyright: ignore[reportArgumentType]
product = Product(listed_day=0, **values) # ty:ignore[invalid-argument-type]
else:
product = session.get(Product, self.product.id)
if product is None:
Expand Down
2 changes: 1 addition & 1 deletion examples/playground/playground/states/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ def set_filter(self, value: str | list[str]):
Args:
value: One of ``all``, ``open`` and ``done``.
"""
if value in FILTERS:
if isinstance(value, str) and value in FILTERS:
self.filter = value

@rx.event
Expand Down
2 changes: 1 addition & 1 deletion examples/playground/playground/states/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def set_layout(self, value: str | list[str]):
Args:
value: One of ``cards``, ``list`` and ``table``.
"""
if value in LAYOUTS:
if isinstance(value, str) and value in LAYOUTS:
self.layout = value

@rx.event
Expand Down
Loading
Loading