From fd41051208c55e554e6f1211e7ad29df698f6bbf Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Mon, 13 Feb 2023 17:51:11 +0100 Subject: [PATCH 1/2] Print list of errored repo installs --- planemo/galaxy/workflows.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/planemo/galaxy/workflows.py b/planemo/galaxy/workflows.py index fa968ffcc..9029525d9 100644 --- a/planemo/galaxy/workflows.py +++ b/planemo/galaxy/workflows.py @@ -88,16 +88,17 @@ def install_shed_repos( install_results.errored_repositories.extend(update_results.errored_repositories) updated_repos = update_results.installed_repositories else: - updated_repos = None + updated_repos = [] if install_results.errored_repositories: + msg = f"{FAILED_REPOSITORIES_MESSAGE}: \n{yaml.safe_dump(install_results.errored_repositories)}" if ignore_dependency_problems: - warn(FAILED_REPOSITORIES_MESSAGE) + warn(msg) else: - raise Exception(FAILED_REPOSITORIES_MESSAGE) - return install_results.installed_repositories, updated_repos + raise Exception(msg) + return InstalledShedRepos(install_results.installed_repositories, updated_repos) else: - return None, None + return InstalledShedRepos([], []) def import_workflow(path, admin_gi, user_gi, from_path=False): From f860b8b61519837870a79402ea02a759612afc52 Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Mon, 13 Feb 2023 17:51:37 +0100 Subject: [PATCH 2/2] Install repos for all tested artifacts --- planemo/engine/galaxy.py | 7 +++---- planemo/galaxy/workflows.py | 10 ++++++++++ 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/planemo/engine/galaxy.py b/planemo/engine/galaxy.py index 16f2ef81d..a627d4fa7 100644 --- a/planemo/engine/galaxy.py +++ b/planemo/engine/galaxy.py @@ -47,10 +47,9 @@ class GalaxyEngine(BaseEngine, metaclass=abc.ABCMeta): def _run(self, runnables, job_paths): """Run job in Galaxy.""" results = [] - for runnable, job_path in zip(runnables, job_paths): - self._ctx.vlog(f"Serving artifact [{runnable}] with Galaxy.") - with self.ensure_runnables_served([runnable]) as config: - self._ctx.vlog(f"Running job path [{job_path}]") + with self.ensure_runnables_served(runnables) as config: + for runnable, job_path in zip(runnables, job_paths): + self._ctx.log(f"Running [{runnable}] - [{job_path}] with Galaxy.") if self._ctx.verbose: self._ctx.log(f"Running Galaxy with API configuration [{config.user_api_config}]") run_response = execute(self._ctx, config, runnable, job_path, **self._kwds) diff --git a/planemo/galaxy/workflows.py b/planemo/galaxy/workflows.py index 9029525d9..ae7e3bd75 100644 --- a/planemo/galaxy/workflows.py +++ b/planemo/galaxy/workflows.py @@ -7,6 +7,7 @@ Callable, Dict, List, + TYPE_CHECKING, ) from urllib.parse import urlparse @@ -24,14 +25,23 @@ inputs_normalized, outputs_normalized, ) +from typing_extensions import NamedTuple from planemo.galaxy.api import gi from planemo.io import warn +if TYPE_CHECKING: + from ephemeris.shed_tools import InstallRepoDict + FAILED_REPOSITORIES_MESSAGE = "Failed to install one or more repositories." GALAXY_WORKFLOWS_PREFIX = "gxid://workflows/" +class InstalledShedRepos(NamedTuple): + installed_repositories: List["InstallRepoDict"] + updated_repositories: List["InstallRepoDict"] + + def load_shed_repos(runnable): if runnable.type.name != "galaxy_workflow": return []