Skip to content

Commit 83e635d

Browse files
Lendemormasenf
andauthored
bump ruff version to 0.9.3 (#4705)
* bump ruff version to 0.9.3 * relock poetry file * poetry relock * ignore RUF008 for now * pass pre-commit * update-pyi-files: require_serial to avoid mp explosion --------- Co-authored-by: Masen Furer <[email protected]>
1 parent 3cb4443 commit 83e635d

File tree

13 files changed

+71
-72
lines changed

13 files changed

+71
-72
lines changed

.pre-commit-config.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ fail_fast: true
33
repos:
44

55
- repo: https://github.com/charliermarsh/ruff-pre-commit
6-
rev: v0.8.2
6+
rev: v0.9.3
77
hooks:
88
- id: ruff-format
99
args: [reflex, tests]
@@ -24,11 +24,12 @@ repos:
2424
name: update-pyi-files
2525
always_run: true
2626
language: system
27+
require_serial: true
2728
description: 'Update pyi files as needed'
2829
entry: python3 scripts/make_pyi.py
2930

3031
- repo: https://github.com/RobertCraigie/pyright-python
31-
rev: v1.1.392
32+
rev: v1.1.393
3233
hooks:
3334
- id: pyright
3435
args: [reflex, tests]

poetry.lock

Lines changed: 51 additions & 51 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ dill = ">=0.3.8"
6161
toml = ">=0.10.2,<1.0"
6262
pytest-asyncio = ">=0.24.0"
6363
pytest-cov = ">=4.0.0,<7.0"
64-
ruff = "0.8.2"
64+
ruff = "0.9.3"
6565
pandas = ">=2.1.1,<3.0"
6666
pillow = ">=10.0.0,<12.0"
6767
plotly = ">=5.13.0,<6.0"
@@ -88,7 +88,7 @@ target-version = "py310"
8888
output-format = "concise"
8989
lint.isort.split-on-trailing-comma = false
9090
lint.select = ["ANN001","B", "C4", "D", "E", "ERA", "F", "FURB", "I", "N", "PERF", "PGH", "PTH", "RUF", "SIM", "T", "TRY", "W"]
91-
lint.ignore = ["B008", "D205", "E501", "F403", "SIM115", "RUF006", "RUF012", "TRY0"]
91+
lint.ignore = ["B008", "D205", "E501", "F403", "SIM115", "RUF006", "RUF008", "RUF012", "TRY0"]
9292
lint.pydocstyle.convention = "google"
9393

9494
[tool.ruff.lint.per-file-ignores]

reflex/app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1310,7 +1310,7 @@ def _validate_exception_handlers(self):
13101310
):
13111311
raise ValueError(
13121312
f"Provided custom {handler_domain} exception handler `{_fn_name}` has the wrong argument order."
1313-
f"Expected `{required_arg}` as the {required_arg_index+1} argument but got `{list(arg_annotations.keys())[required_arg_index]}`"
1313+
f"Expected `{required_arg}` as the {required_arg_index + 1} argument but got `{list(arg_annotations.keys())[required_arg_index]}`"
13141314
)
13151315

13161316
if not issubclass(arg_annotations[required_arg], Exception):

reflex/components/component.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -623,8 +623,7 @@ def _render(self, props: dict[str, Any] | None = None) -> Tag:
623623
if props is None:
624624
# Add component props to the tag.
625625
props = {
626-
attr[:-1] if attr.endswith("_") else attr: getattr(self, attr)
627-
for attr in self.get_props()
626+
attr.removesuffix("_"): getattr(self, attr) for attr in self.get_props()
628627
}
629628

630629
# Add ref to element if `id` is not None.

reflex/components/datadisplay/dataeditor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ def add_hooks(self) -> list[str]:
347347
data_callback = f"getData_{editor_id}"
348348
self.get_cell_content = Var(_js_expr=data_callback)
349349

350-
code = [f"function {data_callback}([col, row])" "{"]
350+
code = [f"function {data_callback}([col, row]){{"]
351351

352352
columns_path = str(self.columns)
353353
data_path = str(self.data)

reflex/custom_components/custom_components.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -772,7 +772,7 @@ def _validate_project_info():
772772
pyproject_toml = _get_package_config()
773773
project = pyproject_toml["project"]
774774
console.print(
775-
f'Double check the information before publishing: {project["name"]} version {project["version"]}'
775+
f"Double check the information before publishing: {project['name']} version {project['version']}"
776776
)
777777

778778
console.print("Update or enter to keep the current information.")
@@ -784,7 +784,7 @@ def _validate_project_info():
784784
author["name"] = console.ask("Author Name", default=author.get("name", ""))
785785
author["email"] = console.ask("Author Email", default=author.get("email", ""))
786786

787-
console.print(f'Current keywords are: {project.get("keywords") or []}')
787+
console.print(f"Current keywords are: {project.get('keywords') or []}")
788788
keyword_action = console.ask(
789789
"Keep, replace or append?", choices=["k", "r", "a"], default="k"
790790
)

reflex/event.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ def add_args(self, *args: Var) -> EventSpec:
332332
arg = None
333333
try:
334334
for arg in args:
335-
values.append(LiteralVar.create(value=arg)) # noqa: PERF401
335+
values.append(LiteralVar.create(value=arg)) # noqa: PERF401, RUF100
336336
except TypeError as e:
337337
raise EventHandlerTypeError(
338338
f"Arguments to event handlers must be Vars or JSON-serializable. Got {arg} of type {type(arg)}."

reflex/utils/prerequisites.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1855,7 +1855,7 @@ def replace_content(_match: re.Match) -> str:
18551855
[
18561856
resp.text,
18571857
"",
1858-
"" "def index() -> rx.Component:",
1858+
"def index() -> rx.Component:",
18591859
f" return {render_func_name}()",
18601860
"",
18611861
"",

reflex/utils/pyi_generator.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,7 @@ def figure_out_return_type(annotation: Any):
622622
defaults=[],
623623
)
624624

625-
definition = ast.FunctionDef(
625+
definition = ast.FunctionDef( # pyright: ignore [reportCallIssue]
626626
name="create",
627627
args=create_args,
628628
body=[ # pyright: ignore [reportArgumentType]
@@ -684,7 +684,7 @@ def _generate_staticmethod_call_functiondef(
684684
else []
685685
),
686686
)
687-
definition = ast.FunctionDef(
687+
definition = ast.FunctionDef( # pyright: ignore [reportCallIssue]
688688
name="__call__",
689689
args=call_args,
690690
body=[

0 commit comments

Comments
 (0)