Merge pull request #19716 from jmchilton/fix_citation_handling

[24.2] Fix #19515 - invalid citation handling changed with 24.2.
This commit is contained in:
John Chilton
2025-05-13 13:04:22 -04:00
committed by GitHub
6 changed files with 67 additions and 5 deletions
+4 -2
View File
@@ -1,3 +1,4 @@
import os
from typing import (
Dict,
Type,
@@ -8,6 +9,7 @@ from galaxy.util import plugin_config
if TYPE_CHECKING:
from galaxy.tool_util.locations import ToolLocationResolver
from galaxy.util.path import StrPath
class ToolLocationFetcher:
@@ -19,8 +21,8 @@ class ToolLocationFetcher:
return plugin_config.plugins_dict(galaxy.tool_util.locations, "scheme")
def to_tool_path(self, path_or_uri_like: str, **kwds) -> str:
if "://" not in path_or_uri_like:
def to_tool_path(self, path_or_uri_like: "StrPath", **kwds) -> "StrPath":
if isinstance(path_or_uri_like, os.PathLike) or "://" not in path_or_uri_like:
path = path_or_uri_like
else:
uri_like = path_or_uri_like
+1 -2
View File
@@ -86,9 +86,8 @@ def get_tool_source(
tool_location_fetcher = ToolLocationFetcher()
assert config_file
config_file = str(config_file)
config_file = tool_location_fetcher.to_tool_path(config_file)
config_file = str(tool_location_fetcher.to_tool_path(config_file))
if not enable_beta_formats:
tree, macro_paths = load_tool_with_refereces(config_file)
return XmlToolSource(tree, source_path=config_file, macro_paths=macro_paths)
+7 -1
View File
@@ -708,7 +708,13 @@ class XmlToolSource(ToolSource):
return citations
for citation_elem in citations_elem:
citation = parse_citation_elem(citation_elem)
try:
citation = parse_citation_elem(citation_elem)
except Exception:
if Version(self.parse_profile()) < Version("24.2"):
continue
else:
raise
if citation:
citations.append(citation)