From 82f14dd8f0a0a398073a16602f68222a0965af62 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 27 Dec 2024 13:29:57 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/aiida/brokers/broker.py | 1 - src/aiida/brokers/rabbitmq/broker.py | 3 +-- src/aiida/brokers/rabbitmq/coordinator.py | 8 +++----- src/aiida/cmdline/utils/decorators.py | 1 - src/aiida/engine/runners.py | 4 ++-- 5 files changed, 6 insertions(+), 11 deletions(-) diff --git a/src/aiida/brokers/broker.py b/src/aiida/brokers/broker.py index 388cd7e51..7f719f076 100644 --- a/src/aiida/brokers/broker.py +++ b/src/aiida/brokers/broker.py @@ -8,7 +8,6 @@ if t.TYPE_CHECKING: from plumpy.coordinator import Coordinator - from aiida.manage.configuration.profile import Profile __all__ = ('Broker',) diff --git a/src/aiida/brokers/rabbitmq/broker.py b/src/aiida/brokers/rabbitmq/broker.py index 103720c83..dc9af4acd 100644 --- a/src/aiida/brokers/rabbitmq/broker.py +++ b/src/aiida/brokers/rabbitmq/broker.py @@ -6,9 +6,8 @@ import functools import typing as t -from plumpy.rmq import RemoteProcessThreadController, RmqCoordinator from plumpy import ProcessController -from plumpy.rmq.process_control import RemoteProcessController +from plumpy.rmq import RemoteProcessThreadController from aiida.brokers.broker import Broker from aiida.brokers.rabbitmq.coordinator import RmqLoopCoordinator diff --git a/src/aiida/brokers/rabbitmq/coordinator.py b/src/aiida/brokers/rabbitmq/coordinator.py index 58ce21ece..a0f2fdf02 100644 --- a/src/aiida/brokers/rabbitmq/coordinator.py +++ b/src/aiida/brokers/rabbitmq/coordinator.py @@ -1,10 +1,8 @@ -# -*- coding: utf-8 -*- +import concurrent.futures from asyncio import AbstractEventLoop -import asyncio from typing import Generic, TypeVar, final -import kiwipy -import concurrent.futures +import kiwipy from plumpy.exceptions import CoordinatorConnectionError from plumpy.rmq.communications import convert_to_comm @@ -71,7 +69,7 @@ def broadcast_send( subject=None, correlation_id=None, ): - from aio_pika.exceptions import ChannelInvalidStateError, AMQPConnectionError + from aio_pika.exceptions import AMQPConnectionError, ChannelInvalidStateError try: rsp = self._comm.broadcast_send(body, sender, subject, correlation_id) diff --git a/src/aiida/cmdline/utils/decorators.py b/src/aiida/cmdline/utils/decorators.py index 1cd251493..c5fdf826c 100644 --- a/src/aiida/cmdline/utils/decorators.py +++ b/src/aiida/cmdline/utils/decorators.py @@ -18,7 +18,6 @@ """ -import asyncio from contextlib import contextmanager from click_spinner import spinner diff --git a/src/aiida/engine/runners.py b/src/aiida/engine/runners.py index 007ae3770..768d9fd56 100644 --- a/src/aiida/engine/runners.py +++ b/src/aiida/engine/runners.py @@ -22,12 +22,12 @@ from plumpy.coordinator import Coordinator from plumpy.events import reset_event_loop_policy, set_event_loop_policy from plumpy.persistence import Persister -from plumpy.rmq import RemoteProcessThreadController, wrap_communicator +from plumpy.rmq import RemoteProcessThreadController +from aiida.brokers import Broker from aiida.common import exceptions from aiida.orm import ProcessNode, load_node from aiida.plugins.utils import PluginVersionProvider -from aiida.brokers import Broker from . import transports, utils from .processes import Process, ProcessBuilder, ProcessState, futures