From f938bf6273a4577b08b2f2e43bc578de67833a84 Mon Sep 17 00:00:00 2001 From: Denis Kariakin Date: Mon, 17 Oct 2022 20:49:19 +0200 Subject: [PATCH] Fixes after rebase --- lib/galaxy/jobs/__init__.py | 19 ++++++++----------- lib/galaxy/tool_util/cwl/representation.py | 2 +- lib/galaxy/tool_util/parser/yaml.py | 4 +--- mypy.ini | 15 --------------- 4 files changed, 10 insertions(+), 30 deletions(-) diff --git a/lib/galaxy/jobs/__init__.py b/lib/galaxy/jobs/__init__.py index 659d2cae7a9a..f1169ba46756 100644 --- a/lib/galaxy/jobs/__init__.py +++ b/lib/galaxy/jobs/__init__.py @@ -298,11 +298,11 @@ class JobConfiguration(ConfiguresHandlers): runner_plugins: List[dict] handlers: dict - handler_runner_plugins: Dict[str, List[str]] + handler_runner_plugins: Dict[str, str] tools: Dict[str, list] tool_classes: Dict[str, list] resource_groups: Dict[str, list] - destinations: Dict[str, list] + destinations: Dict[str, tuple] resource_parameters: Dict[str, Any] DEFAULT_BASE_HANDLER_POOLS = ("job-handlers",) @@ -332,7 +332,7 @@ def __init__(self, app: MinimalManagerApp): self.handler_max_grab = None self.handler_ready_window_size = JobConfiguration.DEFAULT_HANDLER_READY_WINDOW_SIZE self.destinations = {} - self.default_destination_id = 'local' + self.default_destination_id = None self.tools = {} self.tool_classes = {} self.resource_groups = {} @@ -601,10 +601,11 @@ def __set_default_job_conf(self): self._set_default_handler_assignment_methods() else: self.app.application_stack.init_job_handling(self) + self.handler_ready_window_size = JobConfiguration.DEFAULT_HANDLER_READY_WINDOW_SIZE # Set the destination self.default_destination_id = "local" - self.destinations['local'] = [JobDestination(id='local', runner='local')] - log.debug('Done loading job configuration') + self.destinations["local"] = [JobDestination(id="local", runner="local")] + log.debug("Done loading job configuration") def get_tool_resource_xml(self, tool_id, tool_type): """Given a tool id, return XML elements describing parameters to @@ -646,9 +647,8 @@ def __parse_resource_parameters(self): @staticmethod def get_params(config, parent): rval = {} - for param in parent.findall('param'): - key = param.get('id') - param_value: Union[str, List[Any]] = [] + for param in parent.findall("param"): + key = param.get("id") if key in ["container", "container_override"]: containers = map(requirements.container_from_element, param.findall("container")) param_value = list(map(lambda c: c.to_dict(), containers)) @@ -996,9 +996,6 @@ def __init__(self, job: model.Job, app: MinimalManagerApp, use_persisted_destina # the path rewriter needs destination params, so it cannot be set up until after the destination has been # resolved self._job_io = None - self._dataset_path_rewriter = None - self.output_paths: List[DatasetPath] = None # type: ignore[assignment] - self.output_hdas_and_paths: Dict[str, Union[List, Tuple]] = None # type: ignore[assignment] self.tool_provided_job_metadata = None self.params = None if job.params: diff --git a/lib/galaxy/tool_util/cwl/representation.py b/lib/galaxy/tool_util/cwl/representation.py index 447fbe295512..11f2175c1129 100644 --- a/lib/galaxy/tool_util/cwl/representation.py +++ b/lib/galaxy/tool_util/cwl/representation.py @@ -9,7 +9,7 @@ Any, Dict, NamedTuple, - Optional + Optional, ) from galaxy.exceptions import RequestParameterInvalidException diff --git a/lib/galaxy/tool_util/parser/yaml.py b/lib/galaxy/tool_util/parser/yaml.py index 7509e3814772..6ca4879d5c8a 100644 --- a/lib/galaxy/tool_util/parser/yaml.py +++ b/lib/galaxy/tool_util/parser/yaml.py @@ -1,10 +1,8 @@ import json - -import packaging.version from typing import ( Any, Dict, - List + List, ) import packaging.version diff --git a/mypy.ini b/mypy.ini index f2e7de3ccdb5..8b1a28dd10bd 100644 --- a/mypy.ini +++ b/mypy.ini @@ -178,11 +178,6 @@ check_untyped_defs = False check_untyped_defs = False [mypy-galaxy.tools.bundled.filters.join] check_untyped_defs = False -[mypy-galaxy.tool_util.output_checker] -[mypy-galaxy.tools.bundled.data_source.hbvar_filter] -check_untyped_defs = False -[mypy-galaxy.tool_util.provided_metadata] -check_untyped_defs = False [mypy-galaxy.tool_util.verify.test_data] check_untyped_defs = False [mypy-galaxy.tool_util.toolbox.parser] @@ -271,12 +266,6 @@ check_untyped_defs = False check_untyped_defs = False [mypy-galaxy.model.database_utils] check_untyped_defs = False -[mypy-galaxy.job_metrics.instrumenters.env] -check_untyped_defs = False -[mypy-galaxy.job_metrics.instrumenters.collectl] -check_untyped_defs = False -[mypy-galaxy.job_metrics.instrumenters.cgroup] -check_untyped_defs = False [mypy-galaxy.datatypes.sniff] check_untyped_defs = False [mypy-galaxy.config.schema] @@ -357,8 +346,6 @@ check_untyped_defs = False check_untyped_defs = False [mypy-galaxy.tool_util.deps] check_untyped_defs = False -[mypy-galaxy.model.tool_shed_install.migrate.check] -check_untyped_defs = False [mypy-galaxy.jobs.runners.util.cli.job.lsf] check_untyped_defs = False [mypy-galaxy.authnz.managers] @@ -389,8 +376,6 @@ check_untyped_defs = False check_untyped_defs = False [mypy-tool_shed.dependencies.attribute_handlers] check_untyped_defs = False -[mypy-galaxy.tool_shed.galaxy_install.tools.data_manager] -check_untyped_defs = False [mypy-galaxy.tool_shed.galaxy_install.repository_dependencies.repository_dependency_manager] check_untyped_defs = False [mypy-galaxy.datatypes.triples]