Skip to content

Commit

Permalink
More typing?
Browse files Browse the repository at this point in the history
  • Loading branch information
jmchilton committed Aug 31, 2023
1 parent 7a1950b commit 82086d0
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 10 deletions.
8 changes: 6 additions & 2 deletions lib/galaxy/tool_shed/galaxy_install/client.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import threading
from typing import (
Any,
Dict,
Generic,
List,
Optional,
Expand All @@ -15,7 +16,10 @@
from galaxy.model.tool_shed_install import HasToolBox
from galaxy.security.idencoding import IdEncodingHelper
from galaxy.tool_shed.cache import ToolShedRepositoryCache
from galaxy.tool_util.data import ToolDataTableManager
from galaxy.tool_util.data import (
OutputDataset,
ToolDataTableManager,
)
from galaxy.tool_util.toolbox.base import AbstractToolBox

if TYPE_CHECKING:
Expand All @@ -29,7 +33,7 @@ class DataManagerInterface(Protocol):
def process_result(self, out_data):
...

def write_bundle(self, out) -> None:
def write_bundle(self, out: Dict[str, OutputDataset]) -> Dict[str, OutputDataset]:
...


Expand Down
9 changes: 6 additions & 3 deletions lib/galaxy/tool_shed/unittest_utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@
InstallationTarget,
)
from galaxy.tool_shed.util.repository_util import get_installed_repository
from galaxy.tool_util.data import ToolDataTableManager
from galaxy.tool_util.data import (
OutputDataset,
ToolDataTableManager,
)
from galaxy.tool_util.loader_directory import looks_like_a_tool
from galaxy.tool_util.toolbox.base import (
AbstractToolBox,
Expand Down Expand Up @@ -134,8 +137,8 @@ class DummyDataManager(DataManagerInterface):
def process_result(self, out_data):
return None

def write_bundle(self, out) -> None:
return None
def write_bundle(self, out) -> Dict[str, OutputDataset]:
return {}


class StandaloneDataManagers(DataManagersInterface):
Expand Down
8 changes: 4 additions & 4 deletions lib/galaxy/tools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3091,10 +3091,10 @@ def exec_after_process(self, app, inp_data, out_data, param_dict, job=None, fina
pass
elif data_manager_mode == "bundle":
for bundle_path, dataset in data_manager.write_bundle(out_data).items():
dataset = cast(model.HistoryDatasetAssociation, dataset)
dataset.dataset.object_store.update_from_file(
dataset.dataset,
extra_dir=dataset.dataset.extra_files_path_name,
hda = cast(model.HistoryDatasetAssociation, dataset)
hda.dataset.object_store.update_from_file(
hda.dataset,
extra_dir=hda.dataset.extra_files_path_name,
file_name=bundle_path,
alt_name=os.path.basename(bundle_path),
create=True,
Expand Down
2 changes: 1 addition & 1 deletion lib/galaxy/tools/data_manager/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ def process_result(self, out_data: Dict[str, OutputDataset]) -> None:
def write_bundle(
self,
out_data: Dict[str, OutputDataset],
):
) -> Dict[str, OutputDataset]:
tool_data_tables = self.data_managers.app.tool_data_tables
return tool_data_tables.write_bundle(
out_data,
Expand Down

0 comments on commit 82086d0

Please sign in to comment.