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

[24.2] Fix mulled_hash #19199

Merged
merged 2 commits into from
Nov 25, 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
12 changes: 6 additions & 6 deletions lib/galaxy/tool_util/deps/mulled/mulled_hash.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

mulled-hash samtools=1.3.1,bedtools=2.22
"""
from typing_extensions import Literal

from ._cli import arg_parser
from .mulled_build import target_str_to_targets
Expand All @@ -16,14 +17,14 @@
)


def _mulled_hash(hash, targets):
def _mulled_hash(hash: Literal["v1", "v2"], targets_str: str):
"""
>>> _mulled_hash(hash="v2", targets="samtools=1.3.1,bedtools=2.26.0")
>>> _mulled_hash("v2", "samtools=1.3.1,bedtools=2.26.0")
'mulled-v2-8186960447c5cb2faa697666dc1e6d919ad23f3e:a6419f25efff953fc505dbd5ee734856180bb619'
>>> _mulled_hash(hash="v2", targets="samtools=1.3.1=h9071d68_10,bedtools=2.26.0=0")
>>> _mulled_hash("v2", "samtools=1.3.1=h9071d68_10,bedtools=2.26.0=0")
'mulled-v2-8186960447c5cb2faa697666dc1e6d919ad23f3e:a6419f25efff953fc505dbd5ee734856180bb619'
"""
targets = target_str_to_targets(targets)
targets = target_str_to_targets(targets_str)
image_name = v2_image_name if hash == "v2" else v1_image_name
return image_name(targets)

Expand All @@ -36,8 +37,7 @@ def main(argv=None):
)
parser.add_argument("--hash", dest="hash", choices=["v1", "v2"], default="v2")
args = parser.parse_args()
targets = target_str_to_targets(args.targets)
print(_mulled_hash(args.hash, targets))
print(_mulled_hash(args.hash, args.targets))


__all__ = ("main",)
Expand Down
Loading