diff --git a/lib/galaxy/dependencies/pinned-typecheck-requirements.txt b/lib/galaxy/dependencies/pinned-typecheck-requirements.txt index 0aab0f8b71ce..0fcfcb679b1e 100644 --- a/lib/galaxy/dependencies/pinned-typecheck-requirements.txt +++ b/lib/galaxy/dependencies/pinned-typecheck-requirements.txt @@ -8,7 +8,7 @@ cryptography==42.0.8 ; python_version >= "3.8" and python_version < "3.13" lxml-stubs==0.5.1 ; python_version >= "3.8" and python_version < "3.13" mypy-boto3-s3==1.34.138 ; python_version >= "3.8" and python_version < "3.13" mypy-extensions==1.0.0 ; python_version >= "3.8" and python_version < "3.13" -mypy==1.10.1 ; python_version >= "3.8" and python_version < "3.13" +mypy==1.11.0 ; python_version >= "3.8" and python_version < "3.13" pycparser==2.22 ; python_version >= "3.8" and python_version < "3.13" and platform_python_implementation != "PyPy" pydantic-core==2.20.1 ; python_version >= "3.8" and python_version < "3.13" pydantic==2.8.2 ; python_version >= "3.8" and python_version < "3.13" diff --git a/lib/galaxy/managers/base.py b/lib/galaxy/managers/base.py index 6629e6911267..3d4c39e1cd4b 100644 --- a/lib/galaxy/managers/base.py +++ b/lib/galaxy/managers/base.py @@ -697,7 +697,7 @@ def serialize(self, item, keys, **context): try: returned[key] = self.serializers[key](item, key, **context) except SkipAttribute: - # dont add this key if the deserializer threw this + # don't add this key if the serializer threw this pass elif key in self.serializable_keyset: returned[key] = self.default_serializer(item, key, **context) diff --git a/lib/galaxy/managers/configuration.py b/lib/galaxy/managers/configuration.py index 7a133b3f0fb2..d0ccfa8d53c2 100644 --- a/lib/galaxy/managers/configuration.py +++ b/lib/galaxy/managers/configuration.py @@ -104,8 +104,8 @@ def __init__(self, app): self.default_view = "all" self.add_view("all", list(self.serializers.keys())) - def default_serializer(self, config, key): - return getattr(config, key, None) + def default_serializer(self, item, key, **context): + return getattr(item, key, None) def add_serializers(self): def _defaults_to(default) -> base.Serializer: diff --git a/lib/galaxy/tool_shed/galaxy_install/metadata/installed_repository_metadata_manager.py b/lib/galaxy/tool_shed/galaxy_install/metadata/installed_repository_metadata_manager.py index e2ed787bdba2..02272ddfe06f 100644 --- a/lib/galaxy/tool_shed/galaxy_install/metadata/installed_repository_metadata_manager.py +++ b/lib/galaxy/tool_shed/galaxy_install/metadata/installed_repository_metadata_manager.py @@ -192,7 +192,9 @@ def reset_metadata_on_selected_repositories(self, user, **kwd): status = "error" return message, status - def set_repository(self, repository): + def set_repository( + self, repository, relative_install_dir: Optional[str] = None, changeset_revision: Optional[str] = None + ): super().set_repository(repository) self.repository_clone_url = common_util.generate_clone_url_for_installed_repository(self.app, repository) diff --git a/lib/galaxy/tool_util/unittest_utils/parameters.py b/lib/galaxy/tool_util/unittest_utils/parameters.py index d3be68b7cca2..71738b5f4694 100644 --- a/lib/galaxy/tool_util/unittest_utils/parameters.py +++ b/lib/galaxy/tool_util/unittest_utils/parameters.py @@ -1,5 +1,4 @@ import os -from typing import List from galaxy.tool_util.parameters import ( from_input_source, @@ -11,7 +10,6 @@ class ParameterBundle(ToolParameterBundle): - input_models: List[ToolParameterT] def __init__(self, parameter: ToolParameterT): self.input_models = [parameter] diff --git a/lib/galaxy/tools/error_reports/plugins/__init__.py b/lib/galaxy/tools/error_reports/plugins/__init__.py index 97de6441cb30..08e03097775e 100644 --- a/lib/galaxy/tools/error_reports/plugins/__init__.py +++ b/lib/galaxy/tools/error_reports/plugins/__init__.py @@ -17,6 +17,6 @@ class ErrorPlugin(metaclass=ABCMeta): def plugin_type(self): """Short string providing labelling this plugin""" - def submit_report(self, dataset, job, tool, user_submission=False, **kwargs): + def submit_report(self, dataset, job, tool, **kwargs): """Submit the bug report and render a string to be displayed to the user.""" return None diff --git a/lib/galaxy/tools/error_reports/plugins/slack.py b/lib/galaxy/tools/error_reports/plugins/slack.py index 53affb80bc1a..3c4f273ed034 100644 --- a/lib/galaxy/tools/error_reports/plugins/slack.py +++ b/lib/galaxy/tools/error_reports/plugins/slack.py @@ -17,7 +17,7 @@ class SlackPlugin(BaseGitPlugin): - """Send error report to Sentry.""" + """Send error report to Slack.""" plugin_type = "slack" diff --git a/lib/galaxy/util/__init__.py b/lib/galaxy/util/__init__.py index 607207eb872c..b8132c4bc955 100644 --- a/lib/galaxy/util/__init__.py +++ b/lib/galaxy/util/__init__.py @@ -1134,7 +1134,7 @@ def commaify(amount): @overload -def unicodify( # type: ignore[overload-overlap] +def unicodify( value: Literal[None], encoding: str = DEFAULT_ENCODING, error: str = "replace", diff --git a/lib/galaxy/util/odict.py b/lib/galaxy/util/odict.py index aeb66cd20039..4b3fdbc2dc7f 100644 --- a/lib/galaxy/util/odict.py +++ b/lib/galaxy/util/odict.py @@ -71,10 +71,6 @@ def setdefault(self, key, failobj=None): self._keys.append(key) return UserDict.setdefault(self, key, failobj) - def update(self, dict): - for key, val in dict.items(): - self.__setitem__(key, val) - def values(self): return map(self.get, self._keys) diff --git a/lib/galaxy_test/driver/driver_util.py b/lib/galaxy_test/driver/driver_util.py index 77ab88ca0682..3c5121f99640 100644 --- a/lib/galaxy_test/driver/driver_util.py +++ b/lib/galaxy_test/driver/driver_util.py @@ -799,7 +799,7 @@ def __init__(self): self.server_wrappers: List[ServerWrapper] = [] self.temp_directories: List[str] = [] - def setup(self, config_object=None) -> None: + def setup(self) -> None: """Called before tests are built.""" def tear_down(self) -> None: diff --git a/lib/galaxy_test/selenium/test_workflow_editor.py b/lib/galaxy_test/selenium/test_workflow_editor.py index be5433ef3f18..ececfacac313 100644 --- a/lib/galaxy_test/selenium/test_workflow_editor.py +++ b/lib/galaxy_test/selenium/test_workflow_editor.py @@ -1481,12 +1481,6 @@ def workflow_index_open_with_name(self, name): self.workflow_index_search_for(name) self.components.workflows.edit_button.wait_for_and_click() - def workflow_upload_yaml_with_random_name(self, content): - workflow_populator = self.workflow_populator - name = self._get_random_name() - workflow_populator.upload_yaml_workflow(content, name=name) - return name - @retry_assertion_during_transitions def assert_wf_name_is(self, expected_name): edit_name_element = self.components.workflow_editor.edit_name.wait_for_visible() diff --git a/lib/tool_shed/metadata/repository_metadata_manager.py b/lib/tool_shed/metadata/repository_metadata_manager.py index 31a1fc45cac0..1f9b817e0230 100644 --- a/lib/tool_shed/metadata/repository_metadata_manager.py +++ b/lib/tool_shed/metadata/repository_metadata_manager.py @@ -957,9 +957,11 @@ def reset_metadata_on_selected_repositories(self, **kwd): status = "error" return message, status - def set_repository(self, repository, repository_clone_url=None): + def set_repository( + self, repository, relative_install_dir: Optional[str] = None, changeset_revision: Optional[str] = None + ): super().set_repository(repository) - self.repository_clone_url = repository_clone_url or common_util.generate_clone_url_for(self.trans, repository) + self.repository_clone_url = relative_install_dir or common_util.generate_clone_url_for(self.trans, repository) def set_repository_metadata(self, host, content_alert_str="", **kwd): """ diff --git a/lib/tool_shed/test/base/driver.py b/lib/tool_shed/test/base/driver.py index a4fa67efdfb5..5fe5280d786c 100644 --- a/lib/tool_shed/test/base/driver.py +++ b/lib/tool_shed/test/base/driver.py @@ -66,7 +66,7 @@ def build_shed_app(simple_kwargs): class ToolShedTestDriver(driver_util.TestDriver): """Instantiate a Galaxy-style TestDriver for testing the tool shed.""" - def setup(self): + def setup(self) -> None: """Entry point for test driver script.""" self.external_shed = bool(os.environ.get("TOOL_SHED_TEST_EXTERNAL", None)) if not self.external_shed: diff --git a/test/unit/tool_util/test_parameter_specification.py b/test/unit/tool_util/test_parameter_specification.py index 1ad8332230fc..81ebc33b3017 100644 --- a/test/unit/tool_util/test_parameter_specification.py +++ b/test/unit/tool_util/test_parameter_specification.py @@ -14,13 +14,13 @@ encode, RequestInternalToolState, RequestToolState, - ToolParameterModel, validate_internal_job, validate_internal_request, validate_request, validate_test_case, ) from galaxy.tool_util.parameters.json import to_json_schema_string +from galaxy.tool_util.parameters.models import ToolParameterT from galaxy.tool_util.unittest_utils.parameters import ( parameter_bundle, parameter_bundle_for_file, @@ -85,12 +85,12 @@ def _test_file(file: str, specification=None): _assert_internal_requests_invalid(tool_parameter_model, combos["request_invalid"]) -def _for_each(test: Callable, parameter: ToolParameterModel, requests: List[Dict[str, Any]]) -> None: +def _for_each(test: Callable, parameter: ToolParameterT, requests: List[Dict[str, Any]]) -> None: for request in requests: test(parameter, request) -def _assert_request_validates(parameter, request) -> None: +def _assert_request_validates(parameter: ToolParameterT, request: Dict[str, Any]) -> None: try: validate_request(parameter_bundle(parameter), request) except RequestParameterInvalidException as e: diff --git a/test/unit/webapps/test_service_base.py b/test/unit/webapps/test_service_base.py index 993b841c133e..4a8f351af080 100644 --- a/test/unit/webapps/test_service_base.py +++ b/test/unit/webapps/test_service_base.py @@ -13,7 +13,7 @@ def __init__(self, expected_filename: str, expected_mime_type: str) -> None: self.expected_filename = expected_filename self.expected_mime_type = expected_mime_type - def new_target(self, filename, mime_type): + def new_target(self, filename, mime_type, duration=None, security=None): assert filename == self.expected_filename assert mime_type == self.expected_mime_type