-
Notifications
You must be signed in to change notification settings - Fork 304
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
Drop extension_name for name in ExtensionApp #224
Comments
For more context, we brought up some issues with the path resolution in a JEP Issue. In JupyterLab, we have some robust logic for detecting whether user or sys-prefix should take precedence. If using a different name allows us to use better semantics then I am all for it 😄 |
Another data point is that the PyPA recommends only shipping data files within the package itself: https://setuptools.readthedocs.io/en/latest/setuptools.html#non-package-data-files. Also, The pattern I would like to see is:
|
Adopting |
How do you handle enabling/disabling when using the entry point mechanism? Can you store dynamic values (i.e. |
This would be awesome. I need to do better familiarize myself with the entry point framework. |
The entry point would serve as a "soft" enable, that could be overridden by config. |
Thanks, @blink1073. This is great! We discussed this in the Jupyter Server meeting this morning. I'm going to draft a PR using the entry points. |
Yeah I saw the meeting notes. 😉 |
Thanks for the ping @blink1073, Entry points are interesting, although why are configuration directories to be avoided? Also, configuration directories are the default in most of Jupyter, and are language agnostic (which matters for other cases than server extensions such as kernels), so I am generally in favor of placing configuration and data files respectively in Regarding the change of APIs with respect to server extension, another change in jupyter_server is the renaming from |
Right, but jupyter server currently handles both. See this chunk: |
@SylvainCorlay, I explained why not to prefer |
@blink1073 I don't think I understand the proposal fully: If we support Similarly to @SylvainCorlay: Is your concern that your extensions will lose the ability to use |
Sylvain and I spoke afterward, but to clarify here:
The overall point being that |
I think that it is a very good practice in general to keep making use of For cases like e.g. kernels, which is language it is important to keep that mechanism anyways, because entry points are a python thing, so why not use the same structure for extension apps? We cannot access INSTALL_PREFIX/share or INSTALL_PREFIX/etc without making use of data_files, and it is so much a common practice for any software package do use the content of these directories that the recommendation of PyPI to not use data files that are not in the package seems misguided in my opinion. |
I'm not arguing that data_files aren't a good idea. I am arguing for practicality in that their support is not well documented or supported. I have been bitten many times by the fact that they aren't handled in development installs, and the syntax for using them is awkward at best, even with our helper functions. The order of path preference I'll take up separately, since it was discussed at this week's server meeting as a possible JEP topic. |
That is indeed an issue, but there are major benefits. I find that having a directory structure in the source similar to that of the installation prefix like in xeus-python or nbconvert 6 makes reading the structure of the package easier. |
I'm saying support both. I personally would be happy to never use data_files again unless their level of support changes. |
Alternative proposal (gym thoughts): we make data_files work in develop mode using jupyter_packaging and embrace pyproject.toml everywhere using that. |
Cool, thanks for pushing back @SylvainCorlay. "There should be one-- and preferably only one --obvious way to do it." |
This is great. Thanks, y'all. Follow-up question— Right now, we only use What would such a file look like? Is it empty and we extract the extension name from its file name? Or do we need some defined JSON pattern? |
I thought we were also using |
There isn't a "discovery" mechanism for installed extensions that are not explicitly enabled/disabled. It the server extension module is listed somewhere in the Otherwise, an extension has to create a JSON file with config enabling it for Jupyter Server to see it. |
"Installed" to me means the extension python package is installed and Jupyter Server is aware it exists. Right now, you cannot have an extension that is installed—thereby visible by |
We do for |
Wait, no, |
That is jupyterlab enabling itself, i.e. equivalent of running |
PS: That might seem like just semantics, but it means there is no way for a server extension to make itself discoverable by |
Closing since we're using |
This issue is to track the change from
ExtensionApp.extension_name
toExtensionApp.name
Prior discussion from #222.
The text was updated successfully, but these errors were encountered: