Skip to content

use target_str_to_targets from tool-util package #1467

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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