Skip to content

Commit 3ceaa40

Browse files
committed
Enable repo type update (not supported by TS API yet)
See galaxyproject/galaxy#2781
1 parent 057f4f0 commit 3ceaa40

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

planemo/shed/__init__.py

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -602,10 +602,11 @@ def _build_suite_repo(config, repos, suite_config):
602602

603603

604604
def update_repository_for(ctx, tsi, id, repo_config):
605-
# TODO: enforce no "type" change.
606605
from bioblend.galaxy.client import Client
606+
name = repo_config["name"]
607607
description = repo_config.get("description", None)
608608
long_description = repo_config.get("long_description", None)
609+
repo_type = shed_repo_type(repo_config, name)
609610
remote_repository_url = repo_config.get("remote_repository_url", None)
610611
homepage_url = repo_config.get("homepage_url", None)
611612
categories = repo_config.get("categories", [])
@@ -614,8 +615,9 @@ def update_repository_for(ctx, tsi, id, repo_config):
614615
_ensure_shed_description(description)
615616

616617
kwds = dict(
617-
name=repo_config["name"],
618+
name=name,
618619
synopsis=description,
620+
type=repo_type,
619621
)
620622
if long_description is not None:
621623
kwds["description"] = long_description
@@ -722,12 +724,13 @@ def path_to_repo_name(path):
722724

723725
def shed_repo_type(config, name):
724726
repo_type = config.get("type", None)
725-
if repo_type is None and name.startswith("package_"):
726-
repo_type = REPO_TYPE_TOOL_DEP
727-
elif repo_type is None and name.startswith("suite_"):
728-
repo_type = REPO_TYPE_SUITE
729-
elif repo_type is None:
730-
repo_type = REPO_TYPE_UNRESTRICTED
727+
if repo_type is None:
728+
if name.startswith("package_"):
729+
repo_type = REPO_TYPE_TOOL_DEP
730+
elif name.startswith("suite_"):
731+
repo_type = REPO_TYPE_SUITE
732+
else:
733+
repo_type = REPO_TYPE_UNRESTRICTED
731734
return repo_type
732735

733736

0 commit comments

Comments
 (0)