-
Notifications
You must be signed in to change notification settings - Fork 130
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
Add type hints to __main__.py #463
Conversation
def main(org_args): | ||
"""Run main.""" | ||
global devices, homekit_id, light, api, lights, gateway, groups, moods, tasks, dump_devices, dump_all # pylint: disable=global-variable-undefined, invalid-name | ||
if __name__ == "__main__": |
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.
By putting all the code here instead of in a function, we don't need the global
definition, which was messing up the type hints.
This comment was marked as resolved.
This comment was marked as resolved.
I believe this concludes the task of adding type hints to the library? I remember you did a breaking change in one of the pull requests, albeit a small one. Should I bump to 10.0.0 or is this 9.1.0? If we're going for 10 we might as well drop the methods discussed in #457. |
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.
In a follow up, we can make _model_class
non optional and remove the cases for it in resource.py.
We can also now mark the library as typed with a file py.typed
.
I think we can make a major bump after removing the stale methods. |
This PR adds type hints to
__main__.py
.