Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.14.9
rev: v0.16.4
hooks:
- id: ruff
args: [--fix]
Expand Down
2 changes: 1 addition & 1 deletion reasonify-headless/bridge.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Callable
from collections.abc import Callable

from pyodide.webloop import PyodideFuture

Expand Down
2 changes: 1 addition & 1 deletion reasonify-headless/reasonify/tools/input.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
if res := window.prompt(prompt):
return res

raise IOError("User cancelled the input (refused to input anything)")
raise OSError("User cancelled the input (refused to input anything)")

from builtins import input

Check failure on line 18 in reasonify-headless/reasonify/tools/input.py

View workflow job for this annotation

GitHub Actions / checks

ruff (UP029)

reasonify-headless/reasonify/tools/input.py:18:5: UP029 Unnecessary builtin import: `input` help: Remove unnecessary builtin import

Check failure on line 18 in reasonify-headless/reasonify/tools/input.py

View workflow job for this annotation

GitHub Actions / checks

ruff (UP029)

reasonify-headless/reasonify/tools/input.py:18:5: UP029 Unnecessary builtin import: `input` help: Remove unnecessary builtin import

return input(prompt)
3 changes: 2 additions & 1 deletion reasonify-headless/reasonify/utils/inject.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from collections.abc import Callable
from inspect import signature
from typing import TYPE_CHECKING, Callable
from typing import TYPE_CHECKING

from .context import Context

Expand Down
3 changes: 2 additions & 1 deletion reasonify-headless/reasonify/utils/run.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
from collections.abc import Callable
from contextlib import redirect_stderr, redirect_stdout
from functools import cache
from io import StringIO
from itertools import count
from json import loads
from traceback import format_exception, format_exception_only, walk_tb
from typing import Callable, TypedDict
from typing import TypedDict

from promplate import Context

Expand Down Expand Up @@ -53,7 +54,7 @@
with redirect_stdout(io), redirect_stderr(io):
try:
result = await eval_code_async(source, context, filename=filename)
except Exception as e:

Check failure on line 57 in reasonify-headless/reasonify/utils/run.py

View workflow job for this annotation

GitHub Actions / checks

ruff (BLE001)

reasonify-headless/reasonify/utils/run.py:57:16: BLE001 Do not catch blind exception: `Exception`

Check failure on line 57 in reasonify-headless/reasonify/utils/run.py

View workflow job for this annotation

GitHub Actions / checks

ruff (BLE001)

reasonify-headless/reasonify/utils/run.py:57:16: BLE001 Do not catch blind exception: `Exception`
io.write(get_clean_traceback(e, filename))

if diff := diff_context(original_context, context):
Expand Down
2 changes: 1 addition & 1 deletion reasonify-headless/reasonify/utils/tool.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from asyncio import iscoroutinefunction
from collections.abc import Callable
from inspect import Signature, isasyncgenfunction
from typing import Callable

from promplate_recipes.functional.component import SimpleComponent

Expand Down
5 changes: 3 additions & 2 deletions reasonify-headless/utils/fs.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from typing import TYPE_CHECKING, Awaitable, Callable
from collections.abc import Awaitable, Callable
from typing import TYPE_CHECKING

from js import FileSystemDirectoryHandle

Expand All @@ -16,4 +17,4 @@ def unmount(target: str) -> None: ...

NativeFS = object

__all__ = ["mount", "unmount", "NativeFS"]
__all__ = ["NativeFS", "mount", "unmount"]
Loading