From fec1db4be8496d24b288b69d6b5f2278bf2172f0 Mon Sep 17 00:00:00 2001 From: Matthias Bernt Date: Wed, 10 Jul 2024 16:12:05 +0200 Subject: [PATCH] use target_str_to_targets from tool-util package needs: https://github.com/galaxyproject/galaxy/pull/18522 --- planemo/conda.py | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/planemo/conda.py b/planemo/conda.py index f21e8210b..956a7bbfc 100644 --- a/planemo/conda.py +++ b/planemo/conda.py @@ -25,6 +25,7 @@ CondaContext, CondaTarget, ) +from galaxy.tool_util.deps.mulled.mulled_build import target_str_to_targets from galaxy.util import unicodify from planemo.exit_codes import ( @@ -112,21 +113,6 @@ def collect_conda_targets(ctx, paths, recursive=False, found_tool_callback=None) return conda_targets -# Copied and modified from mulled stuff - need to syncronize these concepts. -def target_str_to_targets(targets_raw: str) -> List[CondaTarget]: - def parse_target(target_str: str) -> CondaTarget: - if "=" in target_str: - package_name, version = target_str.split("=", 1) - else: - package_name = target_str - version = None - target = CondaTarget(package_name, version) - return target - - targets = [parse_target(_) for _ in targets_raw.split(",")] - return targets - - def collect_conda_target_lists( ctx: "PlanemoCliContext", paths: Iterable[str], recursive: bool = False, found_tool_callback=None ) -> List[FrozenSet[CondaTarget]]: