From 63c74022a22541abc57e93115a28a270adf97d75 Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Wed, 29 Nov 2023 15:45:50 +0100 Subject: [PATCH] Set correct tool_path for packaged galaxy --- lib/galaxy/config/__init__.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/galaxy/config/__init__.py b/lib/galaxy/config/__init__.py index 4601fe34151c..0fd337bc0198 100644 --- a/lib/galaxy/config/__init__.py +++ b/lib/galaxy/config/__init__.py @@ -850,7 +850,14 @@ def _process_config(self, kwargs: Dict[str, Any]) -> None: self.install_database_engine_options = get_database_engine_options(kwargs, model_prefix="install_") self.shared_home_dir = kwargs.get("shared_home_dir") self.cookie_path = kwargs.get("cookie_path") - self.tool_path = self._in_root_dir(self.tool_path) + if not running_from_source and kwargs.get("tool_path") is None: + try: + self.tool_path = str(files("galaxy.tools") / "bundled") + except ModuleNotFoundError: + # Might not be a full galaxy installation + self.tool_path = self._in_root_dir(self.tool_path) + else: + self.tool_path = self._in_root_dir(self.tool_path) self.tool_data_path = self._in_root_dir(self.tool_data_path) if not running_from_source and kwargs.get("tool_data_path") is None: self.tool_data_path = self._in_data_dir(self.schema.defaults["tool_data_path"])