-
Notifications
You must be signed in to change notification settings - Fork 178
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
chore(api): apply mypy consistently across api #15821
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Going from Well
to Location
is done by doing well.top()
or well.bottom()
or something. In general though, I wouldn't worry too much about it; just getting the warnings removed is good enough, and making the typing elegant can happen in a followup pass.
The things to worry about are actual non-typechecking code changes to production software. That's what needs a second look, as in the API transfers code, for instance.
hw_api_cntrlr = await API.build_hardware_controller( | ||
loop=asyncio.get_running_loop(), | ||
feature_flags=HardwareFeatureFlags.build_from_ff(), | ||
firmware=_find_smoothie_file(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should Be NONE since this isn't running on an actual robot
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Talked about in person - made a different change
This was a bit more in depth - the code changes here actually needed a bit more, as much as I wanted to remove them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed this, fixed up some little changes and some noise, very happy with it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This mostly looks good to me, but here's a few things that look questionable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hallelujah.
The failing tests are because fe6252c needs to be merged into edge as well as release |
Overview
At present, typechecking is not applied fully and consistently across the API directory. This PR removes exceptions to mypy checking rules and makes sure that all mypy typechecking tests pass.
EXEC-201 EXEC-202
Test Plan and Hands on Testing
Remove all exceptions from
api/mypy.ini
and runmake -C api lint
from the home directory and make sure all the tests pass.Changelog
Review requests
Lots of file changes in this one. Most changes in most files are just monotonous
-> None
function return type annotations(or something similar). For reviewers, I would focus on the following files:protocols/labware.py
: My edits to _check_for_subdirectories seem strange. I'm not confident in the new things I imported to get that type annotation to work.test_transfers.py
: There are dozens of conversions betweenLocation
,Well
, andLocation | Well
. What should be done about these? If one function has aWell
and wants to call a function that takes in aLocation
, how should I convert it?Risk assessment
Low.