Skip to content

Commit 778057d

Browse files
authored
fix ruff error + pin ruff ver for now (#1107)
1 parent ff60ae7 commit 778057d

File tree

4 files changed

+10
-11
lines changed

4 files changed

+10
-11
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ dependencies = [
1313
"invoke",
1414
# lint
1515
"black",
16-
"ruff",
16+
"ruff==0.0.278", # Ruff is moving really fast, so pinning for now.
1717
"toml",
1818
"flake8",
1919
"flake8-pyproject",

src/py/reactpy/reactpy/core/types.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,21 +62,21 @@ def render(self) -> VdomDict | ComponentType | str | None:
6262
"""Render the component's view model."""
6363

6464

65-
_Render = TypeVar("_Render", covariant=True)
66-
_Event = TypeVar("_Event", contravariant=True)
65+
_Render_co = TypeVar("_Render_co", covariant=True)
66+
_Event_contra = TypeVar("_Event_contra", contravariant=True)
6767

6868

6969
@runtime_checkable
70-
class LayoutType(Protocol[_Render, _Event]):
70+
class LayoutType(Protocol[_Render_co, _Event_contra]):
7171
"""Renders and delivers, updates to views and events to handlers, respectively"""
7272

73-
async def render(self) -> _Render:
73+
async def render(self) -> _Render_co:
7474
"""Render an update to a view"""
7575

76-
async def deliver(self, event: _Event) -> None:
76+
async def deliver(self, event: _Event_contra) -> None:
7777
"""Relay an event to its respective handler"""
7878

79-
async def __aenter__(self) -> LayoutType[_Render, _Event]:
79+
async def __aenter__(self) -> LayoutType[_Render_co, _Event_contra]:
8080
"""Prepare the layout for its first render"""
8181

8282
async def __aexit__(

src/py/reactpy/reactpy/testing/common.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ def clear_reactpy_web_modules_dir() -> None:
2525

2626
_P = ParamSpec("_P")
2727
_R = TypeVar("_R")
28-
_RC = TypeVar("_RC", covariant=True)
2928

3029

3130
_DEFAULT_POLL_DELAY = 0.1

src/py/reactpy/reactpy/widgets.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,11 @@ def sync_inputs(event: dict[str, Any]) -> None:
7878
return inputs
7979

8080

81-
_CastTo = TypeVar("_CastTo", covariant=True)
81+
_CastTo_co = TypeVar("_CastTo_co", covariant=True)
8282

8383

84-
class _CastFunc(Protocol[_CastTo]):
85-
def __call__(self, value: str) -> _CastTo:
84+
class _CastFunc(Protocol[_CastTo_co]):
85+
def __call__(self, value: str) -> _CastTo_co:
8686
...
8787

8888

0 commit comments

Comments
 (0)