Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Mypy to 1.11.2 and fix new signature override errors #18811

Merged
merged 8 commits into from
Sep 14, 2024

Commits on Sep 13, 2024

  1. Configuration menu
    Copy the full SHA
    cb0e3ed View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    f6c6a37 View commit details
    Browse the repository at this point in the history
  3. Fix signature override of GenomeFilterMixin._add_parsers() method

    Fix the following mypy 1.11 error:
    ```
    lib/galaxy/managers/history_contents.py:638: error: Signature of "_add_parsers"
    incompatible with supertype "GenomeFilterMixin"  [override]
            def _add_parsers(self):
            ^
    lib/galaxy/managers/history_contents.py:638: note:      Superclass:
    lib/galaxy/managers/history_contents.py:638: note:          def _add_parsers(self, database_connection: str) -> Any
    lib/galaxy/managers/history_contents.py:638: note:      Subclass:
    lib/galaxy/managers/history_contents.py:638: note:          def _add_parsers(self) -> Any
    ```
    nsoranzo committed Sep 13, 2024
    Configuration menu
    Copy the full SHA
    440fbd6 View commit details
    Browse the repository at this point in the history
  4. Fix signature override of DatasetAssociationSerializer.serialize()

    …method
    
    Fix the following mypy 1.11 errors:
    
    ```
    lib/galaxy/managers/hdas.py:616: error: Signature of "serialize" incompatible
    with supertype "DatasetAssociationSerializer"  [override]
            def serialize(self, hda, keys, user=None, **context):
            ^
    lib/galaxy/managers/hdas.py:616: note:      Superclass:
    lib/galaxy/managers/hdas.py:616: note:          def serialize(self, item: Any, keys: Any, **context: Any) -> Any
    lib/galaxy/managers/hdas.py:616: note:      Subclass:
    lib/galaxy/managers/hdas.py:616: note:          def serialize(self, hda: Any, keys: Any, user: Any = ..., **context: Any) -> Any
    lib/galaxy/managers/hdas.py:616: error: Signature of "serialize" incompatible
    with supertype "ModelSerializer"  [override]
            def serialize(self, hda, keys, user=None, **context):
            ^
    lib/galaxy/managers/hdas.py:616: note:      Superclass:
    lib/galaxy/managers/hdas.py:616: note:          def serialize(self, item: Any, keys: Any, **context: Any) -> Any
    lib/galaxy/managers/hdas.py:616: note:      Subclass:
    lib/galaxy/managers/hdas.py:616: note:          def serialize(self, hda: Any, keys: Any, user: Any = ..., **context: Any) -> Any
    ```
    nsoranzo committed Sep 13, 2024
    Configuration menu
    Copy the full SHA
    ed336d8 View commit details
    Browse the repository at this point in the history
  5. Fix signature override of DatabaseOperationTool.produce_outputs() m…

    …ethod
    
    Fix the following mypy 1.11 errors:
    
    ```
    lib/galaxy/tools/__init__.py:3989: error: Signature of "produce_outputs"
    incompatible with supertype "DatabaseOperationTool"  [override]
            def produce_outputs(self, trans, out_data, output_collections, inc...
            ^
    lib/galaxy/tools/__init__.py:3989: note:      Superclass:
    lib/galaxy/tools/__init__.py:3989: note:          def produce_outputs(self, trans: Any, out_data: Any, output_collections: Any, incoming: Any, history: Any, **kwds: Any) -> Any
    lib/galaxy/tools/__init__.py:3989: note:      Subclass:
    lib/galaxy/tools/__init__.py:3989: note:          def produce_outputs(self, trans: Any, out_data: Any, output_collections: Any, incoming: Any, history: Any, tag_handler: Any, **kwds: Any) -> Any
    lib/galaxy/tools/__init__.py:4026: error: Signature of "produce_outputs"
    incompatible with supertype "DatabaseOperationTool"  [override]
            def produce_outputs(self, trans, out_data, output_collections, inc...
            ^
    lib/galaxy/tools/__init__.py:4026: note:      Superclass:
    lib/galaxy/tools/__init__.py:4026: note:          def produce_outputs(self, trans: Any, out_data: Any, output_collections: Any, incoming: Any, history: Any, **kwds: Any) -> Any
    lib/galaxy/tools/__init__.py:4026: note:      Subclass:
    lib/galaxy/tools/__init__.py:4026: note:          def produce_outputs(self, trans: Any, out_data: Any, output_collections: Any, incoming: Any, history: Any, tag_handler: Any, **kwds: Any) -> Any
    ```
    nsoranzo committed Sep 13, 2024
    Configuration menu
    Copy the full SHA
    fd5ca34 View commit details
    Browse the repository at this point in the history
  6. Fix signature override of WorkflowModule.save_to_step() method

    Fix the following mypy 1.11 errors:
    
    ```
    lib/galaxy/workflow/modules.py:650: error: Signature of "save_to_step"
    incompatible with supertype "WorkflowModule"  [override]
            def save_to_step(self, step, **kwd):
            ^
    lib/galaxy/workflow/modules.py:650: note:      Superclass:
    lib/galaxy/workflow/modules.py:650: note:          def save_to_step(self, step: Any, detached: Any = ...) -> Any
    lib/galaxy/workflow/modules.py:650: note:      Subclass:
    lib/galaxy/workflow/modules.py:650: note:          def save_to_step(self, step: Any, **kwd: Any) -> Any
    lib/galaxy/workflow/modules.py:1030: error: Signature of "save_to_step"
    incompatible with supertype "WorkflowModule"  [override]
            def save_to_step(self, step, **kwd):
            ^
    lib/galaxy/workflow/modules.py:1030: note:      Superclass:
    lib/galaxy/workflow/modules.py:1030: note:          def save_to_step(self, step: Any, detached: Any = ...) -> Any
    lib/galaxy/workflow/modules.py:1030: note:      Subclass:
    lib/galaxy/workflow/modules.py:1030: note:          def save_to_step(self, step: Any, **kwd: Any) -> Any
    lib/galaxy/workflow/modules.py:1680: error: Signature of "save_to_step"
    incompatible with supertype "WorkflowModule"  [override]
            def save_to_step(self, step, **kwd):
            ^
    lib/galaxy/workflow/modules.py:1680: note:      Superclass:
    lib/galaxy/workflow/modules.py:1680: note:          def save_to_step(self, step: Any, detached: Any = ...) -> Any
    lib/galaxy/workflow/modules.py:1680: note:      Subclass:
    lib/galaxy/workflow/modules.py:1680: note:          def save_to_step(self, step: Any, **kwd: Any) -> Any
    ```
    nsoranzo committed Sep 13, 2024
    Configuration menu
    Copy the full SHA
    0b4fee5 View commit details
    Browse the repository at this point in the history
  7. Fix signature override of Tool.exec_after_process() method

    Fix the following mypy 1.11 error:
    
    ```
    lib/galaxy/tools/__init__.py:3212: error: Signature of "exec_after_process"
    incompatible with supertype "Tool"  [override]
            def exec_after_process(self, app, inp_data, out_data, param_dict, ...
            ^
    lib/galaxy/tools/__init__.py:3212: note:      Superclass:
    lib/galaxy/tools/__init__.py:3212: note:          def exec_after_process(self, app: Any, inp_data: Any, out_data: Any, param_dict: Any, job: Any = ..., **kwds: Any) -> Any
    lib/galaxy/tools/__init__.py:3212: note:      Subclass:
    lib/galaxy/tools/__init__.py:3212: note:          def exec_after_process(self, app: Any, inp_data: Any, out_data: Any, param_dict: Any, job: Any, final_job_state: Any = ..., **kwds: Any) -> Any
    ```
    
    Also:
    - Add some type annotions
    - Small refactorings
    nsoranzo committed Sep 13, 2024
    Configuration menu
    Copy the full SHA
    7154daf View commit details
    Browse the repository at this point in the history
  8. Update mypy to 1.11.2

    Remove now unneeded `type: ignore` .
    nsoranzo committed Sep 13, 2024
    Configuration menu
    Copy the full SHA
    1f8260d View commit details
    Browse the repository at this point in the history