diff --git a/src/aiida/brokers/broker.py b/src/aiida/brokers/broker.py index 388cd7e510..7f719f0760 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 103720c83f..dc9af4acd5 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 58ce21ecee..a0f2fdf02f 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 1cd251493e..c5fdf826ca 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 007ae3770e..768d9fd569 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