Skip to content

Commit

Permalink
Small improvement to typing in metadata_generator.
Browse files Browse the repository at this point in the history
  • Loading branch information
jmchilton committed Jun 28, 2024
1 parent be2304d commit 938d398
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions lib/galaxy/tool_shed/metadata/metadata_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@
Union,
)

from typing_extensions import Protocol
from typing_extensions import (
Protocol,
TypedDict,
)

from galaxy import util
from galaxy.model.tool_shed_install import ToolShedRepository
Expand Down Expand Up @@ -64,6 +67,21 @@
]


class RepositoryMetadataToolDict(TypedDict):
id: str
guid: str
name: str
version: str
profile: str
description: Optional[str]
version_string_cmd: Optional[str]
tool_config: str
tool_type: str
requirements: Optional[Any]
tests: Optional[Any]
add_to_tool_panel: bool


class RepositoryProtocol(Protocol):
name: str
id: str
Expand Down Expand Up @@ -597,7 +615,7 @@ def generate_tool_metadata(self, tool_config, tool, metadata_dict):
# should not be displayed in the tool panel are datatypes converters and DataManager tools
# (which are of type 'manage_data').
add_to_tool_panel_attribute = self._set_add_to_tool_panel_attribute_for_tool(tool)
tool_dict = dict(
tool_dict = RepositoryMetadataToolDict(
id=tool.id,
guid=guid,
name=tool.name,
Expand Down

0 comments on commit 938d398

Please sign in to comment.