-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Import submodules into __init__.py for IDE code completion #174
Conversation
dash/__init__.py
Outdated
@@ -1,3 +1,7 @@ | |||
from .dash import Dash # noqa: F401 | |||
from . import authentication # noqa: F401 |
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.
let's leave this one out, as it isn't used anymore (dash-auth
package is used instead)
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.
Fixed!
This looks good to me. Is this syntax safe for python 2 and python 3? Tests passed, so I'm assuming that it is. |
IDE completion for the component libraries will probably require doing code generation/builds rather than dynamic code evaulation at runtime. This was started in #150, I'll continue the discussion over there. |
I've added some comments about what would be required to do this here: #150 (comment) |
Relative imports work in both Python 2 and 3. Looks like they were introduced in Python2.5 via PEP 328. Thanks for the detailed writeup on how to add IDE completion for components. I will take a look when I get some time. |
Thanks @alysivji ! |
Update component gen process for recent MDN changes
Update component gen process for recent MDN changes
Fix for #144, but only for the dash library itself.
I was also looking to add IDE completion for dash-core-components, but this seems a bit more difficult as component data is loaded from
metadata.json
.We see all the core components in the namespace (and, therefore, in IPython), but they do not show up in the IDE. Hardcoding
__all__
is a workaround, but not something I want to do.@chriddyp do you have any thoughts on this?