Skip to content

Commit

Permalink
Add type annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
nsoranzo committed Jan 20, 2025
1 parent 4720ee3 commit 4c7a0cc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
7 changes: 5 additions & 2 deletions lib/galaxy/managers/workflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,10 @@
joinedload,
subqueryload,
)
from typing_extensions import Annotated
from typing_extensions import (
Annotated,
TypeAlias,
)

from galaxy import (
exceptions,
Expand Down Expand Up @@ -1827,7 +1830,7 @@ def __module_from_dict(
self.add_item_annotation(sa_session, trans.get_user(), step, annotation)

# Stick this in the step temporarily
DictConnection = Dict[str, Union[int, str]]
DictConnection: TypeAlias = Dict[str, Union[int, str]]
temp_input_connections: Dict[str, Union[List[DictConnection], DictConnection]] = step_dict.get(
"input_connections", {}
)
Expand Down
5 changes: 3 additions & 2 deletions lib/galaxy/tool_util/cwl/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from typing import (
Dict,
List,
Optional,
overload,
Union,
)
Expand Down Expand Up @@ -531,7 +532,7 @@ class WorkflowProxy:
def __init__(self, workflow, workflow_path=None):
self._workflow = workflow
self._workflow_path = workflow_path
self._step_proxies = None
self._step_proxies: Optional[List[Union[SubworkflowStepProxy, ToolStepProxy]]] = None

@property
def cwl_id(self):
Expand Down Expand Up @@ -562,7 +563,7 @@ def get_outputs_for_label(self, label):

def tool_reference_proxies(self):
"""Fetch tool source definitions for all referenced tools."""
references = []
references: List[ToolProxy] = []
for step in self.step_proxies():
references.extend(step.tool_reference_proxies())
return references
Expand Down

0 comments on commit 4c7a0cc

Please sign in to comment.