Skip to content

Commit

Permalink
use target_str_to_targets from tool-util package
Browse files Browse the repository at this point in the history
  • Loading branch information
bernt-matthias committed Jul 10, 2024
1 parent 53ccca4 commit fec1db4
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions planemo/conda.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down Expand Up @@ -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]]:
Expand Down

0 comments on commit fec1db4

Please sign in to comment.