-
-
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
Support debug=True if native namespace-packages are present #1895
Conversation
Linting failed because i'm accessing _path: but as far as i know, there is no public access to path for namespace-packages, atleast before python3.10 I'm looking forward to your suggestions on how to handle this @alexcjohnson . |
Super, thanks for the PR @lschmelting! You can override this linting rule on the relevant line(s): Line 535 in 0f1b299
Is there an easy way we could add a test for this? ie include a namespace package in a test like the hot reloading test - we don't need to actually trigger hot reloading from the namespace package IMO, but we need to hit the hot reload code while there's a namespace package loaded. Perhaps turn something like dash-test-components into a namespace package? Or perhaps there's a way to mock this in the test by directly manipulating Then last thing is to add a changelog entry. |
The problem only seems to affect native namespace packages. Turning dash-test-components into a native namespace package would require a different folder structure, since implicit namespace packages don't have an __ init__.py in the package directory (https://packaging.python.org/en/latest/guides/packaging-namespace-packages/#native-namespace-packages). I took a closer look at the code surrounding |
Alright, let's not worry about a test - would be an awfully big lift compared to the code changes here. So the linting fix and a changelog entry and we'll be ready to go :) |
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.
💃 Thank you very much @lschmelting!
debug=True fails if namespace-packages are present.
Traceback:
This PR solves the problem for me, though i don't know if there is a more elegant way.