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

[22.01] Workaround to numeric sorting in the local portion of tool versions if they are galaxy "build" numbers #13570

Open
wants to merge 2 commits into
base: release_22.01
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
12 changes: 11 additions & 1 deletion lib/galaxy/tools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,17 @@ def _view(self):

@property
def version_object(self):
return packaging.version.parse(self.version)
version = self.version
version_split = version.split("+", 1)
if (len(version_split) == 2
and version_split[1].startswith("galaxy")
and version_split[1] != "galaxy"
and version_split[1][6] != "."):
# Per PEP-440 this would be sorted lexicographically if not separated by a '.', this forces a numeric sort
# if the characters after 'galaxy' are an integer, otherwise the outcome will be the same.
version_split[1] = "galaxy." + version_split[1][6:]
version = "+".join(version_split)
return packaging.version.parse(version)

@property
def sa_session(self):
Expand Down