-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
feat: adding more type annotations #3254
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
Conversation
The warning in
to:
However, this file is generated during |
45ca204
to
993283b
Compare
Based on feedback from @T4rk1n, removed assertions added to satisfy type checker and used other mechanisms instead.
@@ -1,5 +1,6 @@ | |||
import traceback | |||
from contextvars import copy_context | |||
from multiprocess import Process # type: ignore |
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.
multiprocess
is an extra dependencies, due to how we load everything in the dash.__init__
it would be imported in environment that hasn't installed it. Need to move back into the function call.
This library also has unparsable code so the typing/linting can't find the member and need this line back:
# pylint: disable-next=import-outside-toplevel,no-name-in-module,import-error
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.
💃
|
||
import flask | ||
|
||
from flask.typing import RouteCallable |
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 is not present in flask 1.1.1 and requirements are set to 1.0.4
Flask only has typing after 2.0.0
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.
RouteCallable in flask.typing was added by PR pallets/flask#4676 which was released in flask 2.2.0 https://github.com/pallets/flask/commits/2.2.0?after=b17bb9ed563ab2857c0db9a07ec4e6407404c7be+34, so probably need to update requirements to >= 2.2.0
This PR will address #3226. Using
pyright --pythonversion 3.9 ./dash
to check.