Skip to content

Commit

Permalink
Merge pull request #13925 from bernt-matthias/fix-mulled-respect-cond…
Browse files Browse the repository at this point in the history
…a-channels

fix two bugs in mulled container building
  • Loading branch information
nsoranzo committed May 19, 2022
2 parents e65f1a8 + 92edf4f commit f12ee5c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/galaxy/tool_util/deps/conda_util.py
Expand Up @@ -529,7 +529,7 @@ def best_search_result(
hits = sorted(hits, key=lambda hit: hit["build_number"], reverse=True)
hits = sorted(hits, key=lambda hit: packaging.version.parse(hit["version"]), reverse=True)
except commands.CommandLineException as e:
log.error("Could not execute: '%s'\n%s", e.command, e)
log.error(f"Could not execute: '{e.command}'\n{e}")
hits = []

if len(hits) == 0:
Expand Down
4 changes: 2 additions & 2 deletions lib/galaxy/tool_util/deps/mulled/mulled_build.py
Expand Up @@ -246,14 +246,14 @@ def mull_targets(
bind_path = channel[7:]
binds.append(f"{bind_path}:{bind_path}")

channels = ",".join(channels)
channels_str = ",".join(channels)
target_str = ",".join(map(conda_build_target_str, targets))
bind_str = ",".join(binds)
involucro_args = [
"-f",
f"{DIRNAME}/invfile.lua",
"-set",
f"CHANNELS={channels}",
f"CHANNELS={channels_str}",
"-set",
f"TARGETS={target_str}",
"-set",
Expand Down
7 changes: 5 additions & 2 deletions lib/galaxy/tool_util/deps/mulled/util.py
Expand Up @@ -332,8 +332,11 @@ def v2_image_name(targets, image_build=None, name_override=None):

def get_file_from_recipe_url(url):
"""Downloads file at url and returns tarball"""
r = requests.get(url, timeout=MULLED_SOCKET_TIMEOUT)
return tarfile.open(mode="r:bz2", fileobj=BytesIO(r.content))
if url.startswith("file://"):
return tarfile.open(mode="r:bz2", name=url[7:])
else:
r = requests.get(url, timeout=MULLED_SOCKET_TIMEOUT)
return tarfile.open(mode="r:bz2", fileobj=BytesIO(r.content))


def split_container_name(name):
Expand Down

0 comments on commit f12ee5c

Please sign in to comment.