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 Jan 11, 2025
1 parent 9d03fa2 commit ec5c772
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/timeout_executor/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
TIMEOUT_EXECUTOR_INPUT_FILE = "_TIMEOUT_EXECUTOR_INPUT_FILE"
TIMEOUT_EXECUTOR_INIT_FILE = "_TIMEOUT_EXECUTOR_INIT_FILE"
SUBPROCESS_COMMAND = (
"from timeout_executor.subprocess import run_in_subprocess;run_in_subprocess()"
"from timeout_executor.process import run_in_subprocess;run_in_subprocess()"
)
8 changes: 3 additions & 5 deletions src/timeout_executor/executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
TIMEOUT_EXECUTOR_INIT_FILE,
TIMEOUT_EXECUTOR_INPUT_FILE,
)
from timeout_executor.logging import logger
from timeout_executor.log import logger
from timeout_executor.result import AsyncResult
from timeout_executor.terminate import Terminator
from timeout_executor.types import (
Expand Down Expand Up @@ -366,7 +366,7 @@ def _render_jinja_subprocess(self) -> str:
import jinja2

init_func_code, init_func_name, func_code, func_name = self._prepare_func_code()
with Path(__file__).with_name("subprocess_jinja.py").open("r") as file:
with Path(__file__).with_name("process_jinja.py").open("r") as file:
source = file.read()
return jinja2.Template(source).render(
func_code=func_code,
Expand All @@ -380,9 +380,7 @@ async def _render_async_jinja_subprocess(self) -> str:

init_func_code, init_func_name, func_code, func_name = self._prepare_func_code()
async with (
await anyio.Path(__file__)
.with_name("subprocess_jinja.py")
.open("r") as file
await anyio.Path(__file__).with_name("process_jinja.py").open("r") as file
):
source = await file.read()
return await jinja2.Template(source, enable_async=True).render_async(
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/timeout_executor/result.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from async_wrapper import async_to_sync, sync_to_async
from typing_extensions import ParamSpec, Self, TypeVar, override

from timeout_executor.logging import logger
from timeout_executor.log import logger
from timeout_executor.serde import SerializedError, loads_error
from timeout_executor.types import Callback, ProcessCallback

Expand Down
2 changes: 1 addition & 1 deletion src/timeout_executor/terminate.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from psutil import pid_exists
from typing_extensions import ParamSpec, Self, TypeVar, override

from timeout_executor.logging import logger
from timeout_executor.log import logger
from timeout_executor.types import Callback, CallbackArgs, ExecutorArgs, ProcessCallback

if TYPE_CHECKING:
Expand Down
4 changes: 2 additions & 2 deletions src/timeout_executor/types.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from __future__ import annotations
from __future__ import annotations # noqa: A005

import sys
from abc import ABC, abstractmethod
Expand All @@ -8,7 +8,7 @@

from typing_extensions import ParamSpec, TypeVar

from timeout_executor.logging import logger
from timeout_executor.log import logger

if sys.version_info < (3, 11): # pragma: no cover
from exceptiongroup import ExceptionGroup
Expand Down

0 comments on commit ec5c772

Please sign in to comment.