Skip to content
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

Don't crash autoupdate on non-PEP440-compliant tool versions #1422

Merged
merged 1 commit into from
Jan 11, 2024
Merged
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
6 changes: 3 additions & 3 deletions planemo/autoupdate.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
)
from xml.etree.ElementTree import ElementTree

import packaging.version
import requests
import yaml
from bioblend import toolshed
from bioblend.toolshed import ToolShedInstance
from galaxy.tool_util.deps import conda_util
from galaxy.tool_util.version import parse_version

import planemo.conda
from planemo.io import (
Expand Down Expand Up @@ -89,7 +89,7 @@ def check_conda(package_name: str, ctx: "PlanemoCliContext", **kwds) -> str:
search_results = itertools.chain.from_iterable(
n["versions"] for n in r.json() if n["name"] == package_name and n["owner"] in kwds["conda_ensure_channels"]
)
return sorted(search_results, key=packaging.version.parse, reverse=True)[0]
return sorted(search_results, key=parse_version, reverse=True)[0]

target = conda_util.CondaTarget(package_name)
best_search_results = conda_util.best_search_result(target, conda_context=conda_context)
Expand Down Expand Up @@ -289,7 +289,7 @@ def _update_wf(config: "LocalGalaxyConfig", workflow_id: str, instance: bool = F
def get_newest_tool_id(tool_ids: List[str]) -> str:
return sorted(
tool_ids,
key=lambda n: packaging.version.parse(n.split("/")[-1]),
key=lambda n: parse_version(n.split("/")[-1]),
)[-1]


Expand Down