jupter_notebook_config.py not being executed
dylanraws opened this issue · 9 comments
Description
Since upgrading from nbclassic v0.3.7 to v0.4.3, starting jupyter with jupyter nbclassic
is no longer executing ~/.jupyter/jupyter_notebook_config.py
. The ~/.jupyter/jupyter_server_config.py
file is still being executed (same as before).
Expected behavior
When running jupyter nbclassic
, the jupyter_notebook_config.py
file should be executed.
Steps to reproduce
pip install notebook==6.* nbclassic==0.4.3
- Add invalid syntax to the
~/.jupyter/jupyter_server_config.py
file - Add invalid syntax to the
~/.jupyter/jupyter_notebook_config.py
file - Start the jupyter server with
jupyter nbclassic
- Observe in the output that the syntax error was only observed for
jupyter_server_config.py
, not forjupyter_notebook_config.py
When repeating the steps with nbclassic==0.3.7
, the syntax error can be seen for both config files, proving that both are being executed.
@Zsailer you mentioned a potential issue in the notebook_shim. Do you confirm the issue would be there or do we need to look in nbclassic (I can imagine the issue is on that side).
We can likely pick up these config files in notebook_shim, but this may take some work. I'll try to carve out time today/tomorrow to develop a fix.
We had to change the extension name to allow installing both notebook. (v7) and nbclassic extensions at the same time.
Sound like notebook_shim is a good place to handle that change and add there the loading of the jupyter_notebook_config
files. Happy to review and help.
fwiw, this specific issue can be addressed by explicitly setting config_file_name = 'jupyter_notebook_config'
in the nbclassic ExtensionApp. The default is to use jupyter_{name}_config
, but it can be set directly.
fwiw, this specific issue can be addressed by explicitly setting config_file_name = 'jupyter_notebook_config' in the nbclassic ExtensionApp. The default is to use jupyter_{name}_config, but it can be set directly.
That is a excellent hint.
Stepping back a bit, what do we want as behavior? should just jupyter_notebook_config be read, or jupyter_nbclassic_config only, or both?
We don't want the admin/user, especially that some trait are already converted (with warning) by notebook_shim to the jupyter_server traits.
If we want to build something crazy, we can convert the notebook traits to nbclassic traits, among some of them would be converted to server ones (please let's not do that).
My understanding of the goal of nbclassic is to get the classic notebook experience delivered while running on the updated Jupyter server. That is, keep everything as-is working (config, extensions, etc.). That suggests it should load existing config names and not defining new ones.
But this is also notebook 7, right? I'm not really sure nbclassic has a place in a future with notebook 7, since nbclassic is really the same thing as notebook 7, before notebook 7. So it seems to me that nbclassic will be deprecated in favor of notebook 7 once it arrives, and the two should behave identically. Or is that wrong?
fwiw, this specific issue can be addressed by explicitly setting config_file_name = 'jupyter_notebook_config' in the nbclassic ExtensionApp. The default is to use jupyter_{name}_config, but it can be set directly.
@Zsailer I have just discussed with @RRosio and @ericsnekbytes. It sound to us that @minrk proposal could just be applied to solve this issue. WDYT?