-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Switch to using bokeh_sampledata package #13874
Conversation
b5bc31a
to
0adbb97
Compare
This is convenience more than anything else, but LSP, like LSPs do not actually run the code, so they cannot access the values of Here I have an example without the import: Where I have updated from typing import TYPE_CHECKING
from . import _create_sampledata_shim
if TYPE_CHECKING:
from bokeh_sampledata.us_cities import data # noqa
__getattr__, __dir__ = _create_sampledata_shim(__name__) I'm not saying this is needed, but at least something to be aware of. |
@hoxbro That makes sense, and as an aside, is coincidentally very closely aligned with the new discussion #13870. Would it be possible to take a similar approach as described there, and generate (I would very much like to have any comments from you in #13870 as well) |
8e3c747
to
a8baafb
Compare
Docs are fixed now, I think this is ready for review. @tcmetzger let me know what you think about any docs needs. @hoxbro assuming you agree about |
Yes, this should be possible. I did some initial testing below. I have created the following folder structure to test it out: Where from __future__ import annotations
data: callable
__dir__: list[str] I think the logic follows PEP-561, and I think adding the stubs folder will take precedence over the So then I tried to add the |
cc @mosc9575 also if you have any comments about the docs or anything else |
f4edf97
to
094987a
Compare
@hoxbro that's really encouraging. I had imagined putting the
Is there any specific advantages to using the separate |
Sorry, I can see I wasn't clear in my previous post. When using
Not as far as I see. This was just the starting point I took to test things out. |
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.
Looks good. Let's follow up with *.pyi
, etc., in future PRs.
OK I think there's still some docs tweaks and tests that can be added but let's get this merged so that @philippjfr can experiment with a dev build |
fixes: #13856
Initial push to see how CI behaves. cc @philippjfr
@bokeh/dev For simplicity I opted to just mention
pip install bokeh_sampledata
in most places (error messages especially) but we could expand to includeconda
if that seems necessary.Additionally, for now I have just removed everything related to
bokeh sampledata
altogether. But can add some kind of actionable error message in case users attempt to run that, if desired.