From 04cfcf621c48f887c202826ae6255dc8ea64098e Mon Sep 17 00:00:00 2001 From: Niklas Siemer <70580458+niklassiemer@users.noreply.github.com> Date: Mon, 16 Dec 2024 22:56:05 +0100 Subject: [PATCH 1/2] More helpful Error message --- pysqa/queueadapter.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pysqa/queueadapter.py b/pysqa/queueadapter.py index 76bdb35..89f6f80 100644 --- a/pysqa/queueadapter.py +++ b/pysqa/queueadapter.py @@ -407,7 +407,10 @@ def set_queue_adapter( # The RemoteQueueAdapter has additional dependencies, namely paramiko and tqdm. # By moving the import to this line it only fails when the user specifies the # RemoteQueueAdapter in their pysqa configuration. - from pysqa.base.remote import RemoteQueueAdapter + try: + from pysqa.base.remote import RemoteQueueAdapter + except ImportError as e: + raise ImportError('Failed to instantiate RemoteQueue setup, probably due to missing optional dependencies') from e return RemoteQueueAdapter( config=config, directory=directory, execute_command=execute_command From e2b5f433d80a0847298497259647853032bf98bf Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 16 Dec 2024 21:56:18 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- pysqa/queueadapter.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pysqa/queueadapter.py b/pysqa/queueadapter.py index 89f6f80..9c82303 100644 --- a/pysqa/queueadapter.py +++ b/pysqa/queueadapter.py @@ -410,7 +410,9 @@ def set_queue_adapter( try: from pysqa.base.remote import RemoteQueueAdapter except ImportError as e: - raise ImportError('Failed to instantiate RemoteQueue setup, probably due to missing optional dependencies') from e + raise ImportError( + "Failed to instantiate RemoteQueue setup, probably due to missing optional dependencies" + ) from e return RemoteQueueAdapter( config=config, directory=directory, execute_command=execute_command