Skip to content

Commit

Permalink
fix: ruff errors
Browse files Browse the repository at this point in the history
  • Loading branch information
phi-friday committed Dec 26, 2024
1 parent 313a6d3 commit 802901c
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions ruff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ fixable = [
"RUF020", # never-union
"NPY201", # numpy2-deprecation
"PT",
"RUF022", # unsorted-dunder-all
"RUF023", # unsorted-dunder-slots
]
ignore = [
"TD",
'E712', # TrueFalseComparison # sqlalchemy
"E711", # none-comparison # sqlalchemy
"EM101", # raw-string-in-exception
"TRY003", # raise-vanilla-args
"ANN101", # missing-type-self
"ANN102", # missing-type-cls
"ANN401", # dynamically-typed-expression
"FBT002", # boolean-default-value-in-function-definition
"PGH003", # blanket-type-ignore
Expand Down
2 changes: 1 addition & 1 deletion src/timeout_executor/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from timeout_executor.main import TimeoutExecutor
from timeout_executor.result import AsyncResult

__all__ = ["TimeoutExecutor", "AsyncResult", "apply_func", "delay_func"]
__all__ = ["AsyncResult", "TimeoutExecutor", "apply_func", "delay_func"]

__version__: str

Expand Down
2 changes: 1 addition & 1 deletion src/timeout_executor/const.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from __future__ import annotations

__all__ = ["TIMEOUT_EXECUTOR_INPUT_FILE", "SUBPROCESS_COMMAND"]
__all__ = ["SUBPROCESS_COMMAND", "TIMEOUT_EXECUTOR_INPUT_FILE"]
TIMEOUT_EXECUTOR_INPUT_FILE = "_TIMEOUT_EXECUTOR_INPUT_FILE"
TIMEOUT_EXECUTOR_INIT_FILE = "_TIMEOUT_EXECUTOR_INIT_FILE"
SUBPROCESS_COMMAND = (
Expand Down
6 changes: 3 additions & 3 deletions src/timeout_executor/executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@

class Executor(Callback[P, T], Generic[P, T]):
__slots__ = (
"_timeout",
"_callbacks",
"_func",
"_func_name",
"_unique_id",
"_init_callbacks",
"_callbacks",
"_initializer",
"_timeout",
"_unique_id",
)

def __init__(
Expand Down
2 changes: 1 addition & 1 deletion src/timeout_executor/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
class TimeoutExecutor(Callback[Any, AnyT], Generic[AnyT]):
"""timeout executor"""

__slots__ = ("_timeout", "_callbacks", "initializer", "_use_jinja")
__slots__ = ("_callbacks", "_timeout", "_use_jinja", "initializer")

def __init__(self, timeout: float, *, use_jinja: bool = False) -> None:
self._timeout = timeout
Expand Down
2 changes: 1 addition & 1 deletion src/timeout_executor/result.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
class AsyncResult(Callback[P, T], Generic[P, T]):
"""async result container"""

__slots__ = ("_process", "_executor_args", "_result")
__slots__ = ("_executor_args", "_process", "_result")

_result: Any

Expand Down
2 changes: 1 addition & 1 deletion src/timeout_executor/serde.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
if TYPE_CHECKING:
SerializedTraceback: TypeAlias = dict[str, Any]

__all__ = ["dumps_error", "loads_error", "serialize_error", "deserialize_error"]
__all__ = ["deserialize_error", "dumps_error", "loads_error", "serialize_error"]

_DATACLASS_FROZEN_KWARGS: dict[str, bool] = {"frozen": True}
if sys.version_info >= (3, 10): # pragma: no cover
Expand Down
8 changes: 4 additions & 4 deletions src/timeout_executor/terminate.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ class Terminator(Callback[P, T], Generic[P, T]):
"""

__slots__ = (
"_is_active",
"_executor_args",
"_init_callbacks",
"_callbacks",
"_callback_args",
"_callback_thread",
"_callbacks",
"_executor_args",
"_init_callbacks",
"_is_active",
"_terminator_thread",
)

Expand Down
2 changes: 1 addition & 1 deletion src/timeout_executor/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
from timeout_executor.terminate import Terminator


__all__ = ["ExecutorArgs", "CallbackArgs", "ProcessCallback", "Callback"]
__all__ = ["Callback", "CallbackArgs", "ExecutorArgs", "ProcessCallback"]

_DATACLASS_FROZEN_KWARGS: dict[str, bool] = {"frozen": True}
_DATACLASS_NON_FROZEN_KWARGS: dict[str, bool] = {}
Expand Down

0 comments on commit 802901c

Please sign in to comment.