jupyter-xeus / xeus-python

Jupyter kernel for the Python programming language
BSD 3-Clause "New" or "Revised" License
429 stars 73 forks source link

xeus-python kernel may be ignoring `ipython_config.py` #417

Open bolliger32 opened 3 years ago

bolliger32 commented 3 years ago

This issue stems from https://github.com/krassowski/jupyterlab-lsp/issues/531. Due to some issues with slow tab completion using jupyterlab-lsp, I was following the instructions to set c.Completer.use_jedi = False in ipython_config.py. I'm not sure whether this class gets used directly at all but it is the base class for IPCompleter so the use_jedi trait gets inherited in IPCompleter. I say this b/c running the %config magic shows IPCompleter as a class you can modify but does not show Completer. Regardless, after making this adjustment to the ipython_config.py file, I noticed that the use_jedi trait is indeed set to False when using the ipykernel kernel, but it remains at the default True when using xeus-python. (I check this with %config IPCompleter).

As hypothesized by @martinRenou in the original issue, is it possible that xeus-python is not reading ipython_config.py? I'm still a bit unsure whether this observed behavior actually indicates a problem b/c in my mind this trait seems to be an ipykernel-specific trait. However, it is located not in ipython_kernel_config.py but in ipython_config.py which I understand to mean it is in the kernel-independent set of traits. So this makes me think it likely should get picked up by xeus-python...

martinRenou commented 3 years ago

xeus-python should read ipython_config.py and uses the Completer class which is an IPython thing. I'll try to find time to give it a try.

Is your config file under the profile_default folder?

bolliger32 commented 3 years ago

@martinRenou correct - it's at ~/.ipython/profile_default/ipython_config.py

bolliger32 commented 3 years ago

@martinRenou just a thought - I guess it could also be that the kernel is properly accessing the Completer class but that the %config magic is not properly returning the state of the current kernel...

SylvainCorlay commented 3 years ago

@bolliger32 which version of xeus-python are you using?

bolliger32 commented 3 years ago

I was using 0.11.1 but just updated to 0.11.2 and see the same thing

SylvainCorlay commented 3 years ago

Thanks! I was just checking that you were not using anything anterior to 0.11.