Enforcing typing in blocks.py and context.py #2887
Merged
Merged
Conversation
Contributor
|
All the demos for this PR have been deployed at https://huggingface.co/spaces/gradio-pr-deploys/pr-2887-all-demos |
blocks.py, components.py, and context.py blocks.py and context.py
blocks.py and context.py blocks.py and context.py
freddyaboulton
approved these changes
Dec 27, 2022
Collaborator
freddyaboulton
left a comment
There was a problem hiding this comment.
Awesome PR @abidlabs !! Will be very helpful as more contributors contribute to gradio as well.
I went through the deployed demos as well and everything looks good from the file refactor. If that's the case after merging in latest main, feel free to merge!
Member
Author
|
Thank you for the review @freddyaboulton! |
Member
Author
|
All the demos look good to me! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixing typing issues (#2832) and path-related refactoring (#2831) for the following files:
blocks.pycontext.pyAdding typing has already discovered some bugs, such as a function that would
raise Falsein place ofreturn False!Adds
pyrightto the CircleCI workflow to enforce typing in these two files. I usedpyrightbecause it was working more reliably thanmypyfor me in WSL and because it is already integrated into VSCode using the Pylance extensionBefore (
blocks.py):After:
I had to touch other files in some cases to fix typing as it related to one of the two files above, but those other files are not fully correctly-typed yet. Also renamed
queue.pytoqueuing.pyanddataclasses.pytodatacls.pybecausequeueanddataclassesare built-in modules in Python, which was confusing the type checker