Skip to content

Commit

Permalink
refactor: move loading of lib tools and converters
Browse files Browse the repository at this point in the history
  • Loading branch information
bernt-matthias committed Nov 10, 2023
1 parent 791a53e commit a7c7ede
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
6 changes: 0 additions & 6 deletions lib/galaxy/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@
from galaxy.tools.data_manager.manager import DataManagers
from galaxy.tools.error_reports import ErrorReports
from galaxy.tools.search import ToolBoxSearch
from galaxy.tools.special_tools import load_lib_tools
from galaxy.tours import (
build_tours_registry,
ToursRegistry,
Expand Down Expand Up @@ -648,11 +647,6 @@ def __init__(self, **kwargs) -> None:
self.datatypes_registry.load_datatype_converters(self.toolbox)
# Load external metadata tool
self.datatypes_registry.load_external_metadata_tool(self.toolbox)
# Load history import/export tools.
load_lib_tools(self.toolbox)
# Load built-in converters
if self.config.display_builtin_converters:
self.toolbox.load_builtin_converters()
self.toolbox.persist_cache(register_postfork=True)
# visualizations registry: associates resources with visualizations, controls how to render
self.visualizations_registry = self._register_singleton(
Expand Down
5 changes: 0 additions & 5 deletions lib/galaxy/queue_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
from galaxy.config import reload_config_options
from galaxy.tools import ToolBox
from galaxy.tools.data_manager.manager import DataManagers
from galaxy.tools.special_tools import load_lib_tools

logging.getLogger("kombu").setLevel(logging.WARNING)
log = logging.getLogger(__name__)
Expand Down Expand Up @@ -182,10 +181,6 @@ def _get_new_toolbox(app, save_integrated_tool_panel=True):
new_toolbox.data_manager_tools = app.toolbox.data_manager_tools
app.datatypes_registry.load_datatype_converters(new_toolbox, use_cached=True)
app.datatypes_registry.load_external_metadata_tool(new_toolbox)
load_lib_tools(new_toolbox)
# Load built-in converters
if app.config.display_builtin_converters:
new_toolbox.load_builtin_converters()
[new_toolbox.register_tool(tool) for tool in new_toolbox.data_manager_tools.values()]
app.toolbox = new_toolbox
app.toolbox.persist_cache()
Expand Down
7 changes: 7 additions & 0 deletions lib/galaxy/tool_util/toolbox/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
NullDependencyManager,
)
from galaxy.tool_util.loader_directory import looks_like_a_tool
from galaxy.tools.special_tools import load_lib_tools
from galaxy.util import (
etree,
ExecutionTimer,
Expand All @@ -32,6 +33,7 @@
string_as_bool,
unicodify,
)

from galaxy.util.bunch import Bunch
from galaxy.util.dictifiable import Dictifiable
from .filters import FilterFactory
Expand Down Expand Up @@ -1411,6 +1413,11 @@ def __init__(
super().__init__(
config_filenames, tool_root_dir, app, view_sources, default_panel_view, save_integrated_tool_panel
)
# Load history import/export tools.
load_lib_tools(self.toolbox)
# Load built-in converters
if app.config.display_builtin_converters:
self.load_builtin_converters()
old_toolbox = getattr(app, "toolbox", None)
if old_toolbox:
self.dependency_manager = old_toolbox.dependency_manager
Expand Down

0 comments on commit a7c7ede

Please sign in to comment.