Skip to content

Commit

Permalink
Named type for parsed tool versions.
Browse files Browse the repository at this point in the history
  • Loading branch information
jmchilton committed Sep 26, 2024
1 parent 40f2ed7 commit 2d37c63
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
10 changes: 10 additions & 0 deletions lib/galaxy/tool_util/version_util.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from typing import Union

from packaging.version import Version

from .version import LegacyVersion

AnyVersionT = Union[LegacyVersion, Version]


__all__ = ["AnyVersionT"]
10 changes: 4 additions & 6 deletions lib/galaxy/tools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,8 @@
from galaxy.tool_util.verify.interactor import ToolTestDescription
from galaxy.tool_util.verify.parse import parse_tool_test_descriptions
from galaxy.tool_util.verify.test_data import TestDataNotFoundError
from galaxy.tool_util.version import (
LegacyVersion,
parse_version,
)
from galaxy.tool_util.version import parse_version
from galaxy.tool_util.version_util import AnyVersionT
from galaxy.tools import expressions
from galaxy.tools.actions import (
DefaultToolAction,
Expand Down Expand Up @@ -339,8 +337,8 @@


class safe_update(NamedTuple):
min_version: Union[LegacyVersion, Version]
current_version: Union[LegacyVersion, Version]
min_version: AnyVersionT
current_version: AnyVersionT


# Tool updates that did not change parameters in a way that requires rebuilding workflows
Expand Down

0 comments on commit 2d37c63

Please sign in to comment.