Skip to content

Commit

Permalink
Fix new UP037 errors from ruff 0.4.5
Browse files Browse the repository at this point in the history
  • Loading branch information
nsoranzo committed Jun 10, 2024
1 parent 211c1d4 commit 70b5811
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion lib/galaxy/datatypes/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -864,7 +864,7 @@ def find_conversion_destination_for_dataset_by_extensions(
ext = dataset_or_ext
dataset = None

accepted_datatypes: List["Data"] = []
accepted_datatypes: List[Data] = []
for accepted_format in accepted_formats:
if isinstance(accepted_format, str):
accepted_datatype = self.get_datatype_by_extension(accepted_format)
Expand Down
4 changes: 2 additions & 2 deletions lib/galaxy/model/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7989,8 +7989,8 @@ def __init__(self):
self._inputs_by_name = None
# Injected attributes
# TODO: code using these should be refactored to not depend on these non-persistent fields
self.module: Optional["WorkflowModule"]
self.state: Optional["DefaultToolState"]
self.module: Optional[WorkflowModule]
self.state: Optional[DefaultToolState]
self.upgrade_messages: Optional[Dict]

@reconstructor
Expand Down
4 changes: 2 additions & 2 deletions lib/galaxy/model/tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def __init__(self, sa_session: galaxy_scoped_session, galaxy_session=None) -> No
self.item_tag_assoc_info: Dict[str, ItemTagAssocInfo] = {}
# Can't include type annotation in signature, because lagom will attempt to look up
# GalaxySession, but can't find it due to the circular import
self.galaxy_session: Optional["GalaxySession"] = galaxy_session
self.galaxy_session: Optional[GalaxySession] = galaxy_session

def create_tag_handler_session(self, galaxy_session: Optional["GalaxySession"]):
# Creates a transient tag handler that avoids repeated flushes
Expand Down Expand Up @@ -502,7 +502,7 @@ class GalaxyTagHandlerSession(GalaxyTagHandler):

def __init__(self, sa_session, galaxy_session: Optional["GalaxySession"]):
super().__init__(sa_session, galaxy_session)
self.created_tags: Dict[str, "Tag"] = {}
self.created_tags: Dict[str, Tag] = {}

def _get_tag(self, tag_name):
"""Get tag from cache or database."""
Expand Down
2 changes: 1 addition & 1 deletion lib/galaxy/tool_shed/galaxy_install/tools/data_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def install_data_managers(
repository,
repository_tools_tups,
) -> List["DataManagerInterface"]:
rval: List["DataManagerInterface"] = []
rval: List[DataManagerInterface] = []
if "data_manager" in metadata_dict:
tpm = tool_panel_manager.ToolPanelManager(self.app)
repository_tools_by_guid = {}
Expand Down
2 changes: 1 addition & 1 deletion lib/galaxy/webapps/galaxy/services/dataset_collections.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ def contents(
raise exceptions.RequestParameterInvalidException(
"Parameter instance_type not being 'history' is not yet implemented."
)
hdca: "HistoryDatasetCollectionAssociation" = self.collection_manager.get_dataset_collection_instance(
hdca: HistoryDatasetCollectionAssociation = self.collection_manager.get_dataset_collection_instance(
trans, "history", hdca_id
)

Expand Down
4 changes: 2 additions & 2 deletions lib/galaxy/webapps/galaxy/services/history_contents.py
Original file line number Diff line number Diff line change
Expand Up @@ -697,7 +697,7 @@ def bulk_operation(
history = self.history_manager.get_mutable(history_id, trans.user, current_history=trans.history)
filters = self.history_contents_filters.parse_query_filters(filter_query_params)
self._validate_bulk_operation_params(payload, trans.user, trans)
contents: List["HistoryItem"]
contents: List[HistoryItem]
if payload.items:
contents = self._get_contents_by_item_list(
trans,
Expand Down Expand Up @@ -1366,7 +1366,7 @@ def _apply_operation_to_item(
def _get_contents_by_item_list(
self, trans, history: History, items: List[HistoryContentItem]
) -> List["HistoryItem"]:
contents: List["HistoryItem"] = []
contents: List[HistoryItem] = []

dataset_items = filter(lambda item: item.history_content_type == HistoryContentType.dataset, items)
datasets_ids = (dataset.id for dataset in dataset_items)
Expand Down
2 changes: 1 addition & 1 deletion lib/galaxy/workflow/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ def replacement_for_input(self, trans, step: "WorkflowStep", input_dict: Dict[st
modules.NoReplacement,
model.DatasetCollectionInstance,
List[model.DatasetCollectionInstance],
"HistoryItem",
HistoryItem,
] = modules.NO_REPLACEMENT
prefixed_name = input_dict["name"]
multiple = input_dict["multiple"]
Expand Down

0 comments on commit 70b5811

Please sign in to comment.