ignore incompatible override

This commit is contained in:
Lendemor 2025-01-27 21:02:00 +01:00
parent 530d7fc3bc
commit b0824d61a7
8 changed files with 17 additions and 10 deletions

3
pyrightconfig.json Normal file
View File

@ -0,0 +1,3 @@
{
"reportIncompatibleMethodOverride": false
}

View File

@ -116,7 +116,7 @@ class ConnectionToaster(Toaster):
_var_data=VarData(
imports={
"react": ["useEffect", "useState"],
**dict(target_url._get_all_var_data().imports), # pyright: ignore [reportArgumentType]
**dict(target_url._get_all_var_data().imports), # pyright: ignore [reportArgumentType, reportOptionalMemberAccess]
}
),
).call(

View File

@ -72,8 +72,8 @@ class Cond(MemoizationLeaf):
def _render(self) -> Tag:
return CondTag(
cond=self.cond,
true_value=self.comp1.render(),
false_value=self.comp2.render(),
true_value=self.comp1.render(), # pyright: ignore [reportOptionalMemberAccess]
false_value=self.comp2.render(), # pyright: ignore [reportOptionalMemberAccess]
)
def render(self) -> Dict:

View File

@ -238,11 +238,11 @@ class Match(MemoizationLeaf):
match_cases=match_cases,
default=default, # pyright: ignore [reportArgumentType]
),
_var_type=default._var_type, # pyright: ignore [reportAttributeAccessIssue]
_var_type=default._var_type, # pyright: ignore [reportAttributeAccessIssue,reportOptionalMemberAccess]
_var_data=VarData.merge(
match_cond_var._get_all_var_data(),
*[el._get_all_var_data() for case in match_cases for el in case],
default._get_all_var_data(), # pyright: ignore [reportAttributeAccessIssue]
default._get_all_var_data(), # pyright: ignore [reportAttributeAccessIssue, reportOptionalMemberAccess]
),
)

View File

@ -294,11 +294,15 @@ class AppHarness:
if p not in before_decorated_pages
]
self.app_instance = self.app_module.app
if isinstance(self.app_instance._state_manager, StateManagerRedis):
if self.app_instance and isinstance(
self.app_instance._state_manager, StateManagerRedis
):
# Create our own redis connection for testing.
self.state_manager = StateManagerRedis.create(self.app_instance._state) # pyright: ignore [reportArgumentType]
else:
self.state_manager = self.app_instance._state_manager
self.state_manager = (
self.app_instance._state_manager if self.app_instance else None
)
def _reload_state_module(self):
"""Reload the rx.State module to avoid conflict when reloading."""

View File

@ -288,7 +288,7 @@ def test_background_task(
assert background_task._poll_for(lambda: counter.text == "620", timeout=40)
# all tasks should have exited and cleaned up
assert background_task._poll_for(
lambda: not background_task.app_instance._background_tasks
lambda: not background_task.app_instance._background_tasks # pyright: ignore [reportOptionalMemberAccess]
)

View File

@ -89,7 +89,7 @@ def ComponentStateApp():
mc_d,
rx.button(
"Inc A",
on_click=mc_a.State.increment, # pyright: ignore [reportAttributeAccessIssue]
on_click=mc_a.State.increment, # pyright: ignore [reportAttributeAccessIssue, reportOptionalMemberAccess]
id="inc-a",
),
rx.text(

View File

@ -113,7 +113,7 @@ def test_cond_no_else():
comp = comp.children[0]
assert isinstance(comp, Cond)
assert comp.cond._decode() is True
assert comp.comp1.render() == Fragment.create(Text.create("hello")).render()
assert comp.comp1.render() == Fragment.create(Text.create("hello")).render() # pyright: ignore [reportOptionalMemberAccess]
assert comp.comp2 == Fragment.create()
# Props do not support the use of cond without else