Skip to content

[pre-commit.ci] pre-commit autoupdate #117

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jul 26, 2025
Merged
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
8 changes: 2 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,13 @@ repos:
- id: python-no-log-warn
- id: python-use-type-annotations
- id: text-unicode-replacement-char
- repo: https://github.com/aio-libs/sort-all
rev: v1.3.0
hooks:
- id: sort-all
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.11.6
rev: v0.12.4
hooks:
- id: ruff
- id: ruff-format
- repo: https://github.com/dosisod/refurb
rev: v2.0.0
rev: v2.1.0
hooks:
- id: refurb
- repo: https://github.com/kynan/nbstripout
Expand Down
2 changes: 0 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,6 @@ unsafe-fixes = true

[tool.ruff.lint]
extend-ignore = [
"ANN101", # type annotating self
"ANN102", # type annotating cls
"ANN401", # flake8-annotate typing.Any
"COM812", # Comply with ruff-format.
"ISC001", # Comply with ruff-format.
Expand Down
2 changes: 1 addition & 1 deletion src/pytask_parallel/backends.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def submit(
def _get_dask_executor(n_workers: int) -> Executor:
"""Get an executor from a dask client."""
_rich_traceback_guard = True
from pytask import import_optional_dependency
from pytask import import_optional_dependency # noqa: PLC0415

distributed = import_optional_dependency("distributed")
assert distributed # noqa: S101
Expand Down
8 changes: 5 additions & 3 deletions src/pytask_parallel/execute.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,9 @@ def pytask_execute_task(session: Session, task: PTask) -> Future[WrapperResult]:

if is_coiled_function(task):
# Prevent circular import for coiled backend.
from pytask_parallel.wrappers import rewrap_task_with_coiled_function
from pytask_parallel.wrappers import ( # noqa: PLC0415
rewrap_task_with_coiled_function,
)

wrapper_func = rewrap_task_with_coiled_function(task)

Expand All @@ -219,7 +221,7 @@ def pytask_execute_task(session: Session, task: PTask) -> Future[WrapperResult]:

if worker_type == WorkerType.PROCESSES:
# Prevent circular import for loky backend.
from pytask_parallel.wrappers import wrap_task_in_process
from pytask_parallel.wrappers import wrap_task_in_process # noqa: PLC0415

# Task modules are dynamically loaded and added to `sys.modules`. Thus,
# cloudpickle believes the module of the task function is also importable in the
Expand All @@ -242,7 +244,7 @@ def pytask_execute_task(session: Session, task: PTask) -> Future[WrapperResult]:

if worker_type == WorkerType.THREADS:
# Prevent circular import for loky backend.
from pytask_parallel.wrappers import wrap_task_in_thread
from pytask_parallel.wrappers import wrap_task_in_thread # noqa: PLC0415

return session.config["_parallel_executor"].submit(
wrap_task_in_thread, task=task, remote=False, **kwargs
Expand Down
2 changes: 1 addition & 1 deletion src/pytask_parallel/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def parse_future_result(
future_exception = future.exception()
if future_exception is not None:
# Prevent circular import for loky backend.
from pytask_parallel.wrappers import WrapperResult
from pytask_parallel.wrappers import WrapperResult # noqa: PLC0415

exc_info = _parse_future_exception(future_exception)
return WrapperResult(
Expand Down
4 changes: 2 additions & 2 deletions src/pytask_parallel/wrappers.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,8 @@ def _patch_set_trace_and_breakpoint() -> None:
a subprocess and print a better exception message.

"""
import pdb # noqa: T100
import sys
import pdb # noqa: PLC0415, T100
import sys # noqa: PLC0415

pdb.set_trace = _raise_exception_on_breakpoint
sys.breakpointhook = _raise_exception_on_breakpoint
Expand Down
Loading