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

Better Typing for Tool Execution Plumbing #18626

Merged
merged 2 commits into from
Aug 6, 2024

Conversation

jmchilton
Copy link
Member

@jmchilton jmchilton commented Jul 31, 2024

The latest mypy upgrade (xref #18608 ) is going to force us to clean up some of the typing around tool execution and in particular conflicting type signatures around the execute method of ToolAction subclasses. That PR is already getting large and I think cleaning up the typing around tool execution is a bit intricate - so I was hoping to do it in its own PR ahead of that one.

I think SetMetadataToolAction.execute was doing the most mangling of the type execute signature. Adding a overwrite argument. I have tried to refactor access to the internals of that so that consumers can call them with an overwrite argument that isn't through the generic execute method. Additionally, I've tried to make set_output_hid a class variable instead of an argument since it seems we were mostly changing it via changing the default arguments to subclass execute methods - which is problematic. (This didn't work - I've reworked everything to put set_output_hid back into the argument list.)

How to test the changes?

(Select all options that apply)

  • This is a refactoring of components with existing test coverage.

License

  • I agree to license these and all my past contributions to the core galaxy codebase under the MIT license.

@jmchilton jmchilton added the kind/refactoring cleanup or refactoring of existing code, no functional changes label Jul 31, 2024
@jmchilton jmchilton force-pushed the tool_execution_typing branch from 1bcf28e to 7f3cd89 Compare July 31, 2024 02:42
@jmchilton
Copy link
Member Author

jmchilton commented Jul 31, 2024

It looks like I need to undo the set_output_hid changes based on the failing tests. Everything is more verbose but I think I am much more confident in changing this code in the structured tool state branch with all this typing in place.

Done. I think it is in good shape now.

@jmchilton jmchilton force-pushed the tool_execution_typing branch from 7f3cd89 to 1f33b16 Compare July 31, 2024 02:44
@jmchilton jmchilton force-pushed the tool_execution_typing branch 5 times, most recently from 3084552 to 400a375 Compare July 31, 2024 16:22
@jmchilton jmchilton force-pushed the tool_execution_typing branch from 400a375 to 3345de1 Compare August 1, 2024 00:38
@jmchilton jmchilton marked this pull request as ready for review August 1, 2024 14:40
@github-actions github-actions bot added this to the 24.2 milestone Aug 1, 2024
@mvdbeek mvdbeek merged commit 94611cb into galaxyproject:dev Aug 6, 2024
53 of 55 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/testing area/tool-framework area/workflows kind/refactoring cleanup or refactoring of existing code, no functional changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants