Skip to content

Commit f29e8d1

Browse files
committed
Fix remote shed tool config paths
1 parent 0bd4fe7 commit f29e8d1

2 files changed

Lines changed: 25 additions & 2 deletions

File tree

planemo/galaxy/config.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,10 @@
6363
write_file,
6464
)
6565
from planemo.mulled import build_involucro_context
66-
from planemo.runnable import RunnableType
66+
from planemo.runnable import (
67+
GALAXY_TOOLS_PREFIX,
68+
RunnableType,
69+
)
6770
from planemo.shed import tool_shed_url
6871
from .api import (
6972
DEFAULT_ADMIN_API_KEY,
@@ -616,7 +619,12 @@ def _all_tool_paths(
616619
) -> Set[str]:
617620
extra_tools = extra_tools or []
618621
all_tool_paths = {
619-
r.path for r in runnables if r.has_tools and not r.data_manager_conf_path and not r.is_remote_workflow_uri
622+
r.path
623+
for r in runnables
624+
if r.has_tools
625+
and not r.data_manager_conf_path
626+
and not r.is_remote_workflow_uri
627+
and not r.uri.startswith(GALAXY_TOOLS_PREFIX)
620628
}
621629
extra_tools = _expand_paths(galaxy_root, extra_tools=extra_tools)
622630
all_tool_paths.update(extra_tools)

tests/test_galaxy_config.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,15 @@
77
import yaml
88

99
from planemo.galaxy.config import (
10+
_all_tool_paths,
1011
galaxy_config,
1112
get_refgenie_config,
1213
write_galaxy_config,
1314
)
15+
from planemo.runnable import (
16+
for_path,
17+
for_uri,
18+
)
1419
from .test_utils import (
1520
create_test_context,
1621
skip_if_environ,
@@ -58,6 +63,16 @@ def test_refgenie_config_version():
5863
assert yaml.load(refgenie_config, Loader=yaml.SafeLoader)["config_version"] == 0.3
5964

6065

66+
def test_all_tool_paths_excludes_remote_galaxy_tools():
67+
local_tool = os.path.join(os.path.dirname(__file__), "data", "tools", "two_tests.xml")
68+
remote_tool_id = "toolshed.g2.bx.psu.edu/repos/iuc/collection_element_identifiers/collection_element_identifiers/0.0.3"
69+
70+
tool_paths = _all_tool_paths([for_path(local_tool), for_uri(f"gxid://tools/{remote_tool_id}")])
71+
72+
assert local_tool in tool_paths
73+
assert f"gxid://tools/{remote_tool_id}" not in tool_paths
74+
75+
6176
def _assert_property_is(config, prop, value):
6277
env_var = "GALAXY_CONFIG_OVERRIDE_%s" % prop.upper()
6378
assert config.env[env_var] == value

0 commit comments

Comments
 (0)