Skip to content

Add code completion#28

Merged
SylvainCorlay merged 3 commits intojupyter-xeus:masterfrom
martinRenou:add_code_completion
Dec 3, 2018
Merged

Add code completion#28
SylvainCorlay merged 3 commits intojupyter-xeus:masterfrom
martinRenou:add_code_completion

Conversation

@martinRenou
Copy link
Copy Markdown
Member

@martinRenou martinRenou commented Nov 27, 2018

Fixes #13

@martinRenou
Copy link
Copy Markdown
Member Author

I wanted to add tests with jupyter_kernel_test but it's not possible while the fix on xeus is not released

@SylvainCorlay
Copy link
Copy Markdown
Member

I assume this is WIP.

@martinRenou
Copy link
Copy Markdown
Member Author

It's not 😊 it works. Just wanted to add tests for coverage, but we need to release xeus first

@martinRenou martinRenou force-pushed the add_code_completion branch 2 times, most recently from 56a2bf3 to da8d9a0 Compare November 29, 2018 09:04
@ihnorton
Copy link
Copy Markdown

Not quite sure if it is necessary here, but we used a small hack in Slicer to ensure that jedi shell-out is running in the same python as the parent (see davidhalter/jedi#1142 and davidhalter/jedi#1187).

@martinRenou
Copy link
Copy Markdown
Member Author

Thanks @ihnorton! I guess that's why tests are not passing :P Let's try that

@martinRenou
Copy link
Copy Markdown
Member Author

Arf... Apparently, it doesn't fix my issue. I'm seeing a very weird error in the CI that I can't reproduce locally, while having exactly the same version of Python (3.6), the same version of jedi and pytest.
It's a completion test which does not work.
The code is: is, and the given completion is expected to be ['issubclass', 'isinstance'], but on the CI it also finds 'IsADirectoryError'. The problem is that there is no capital 'i'. So I really don't get it.

I'll activate CI for different versions of Python.

@martinRenou martinRenou force-pushed the add_code_completion branch 9 times, most recently from b4a48b3 to 231d775 Compare November 30, 2018 11:11
@martinRenou
Copy link
Copy Markdown
Member Author

In the end I was able to reproduce this behavior locally, using a clean environment. But then, after installing jupyter with conda, this behavior vanishes...
conda install jupyter -c conda-forge brings those packages:

    backcall:           0.1.0-py_0              conda-forge
    bleach:             3.0.2-py_0              conda-forge
    dbus:               1.13.0-h3a4f0e9_0       conda-forge
    entrypoints:        0.2.3-py36_1002         conda-forge
    fontconfig:         2.13.1-h65d0f4c_0       conda-forge
    freetype:           2.9.1-h6debe1e_4        conda-forge
    gettext:            0.19.8.1-h5e8e0c9_1     conda-forge
    glib:               2.56.2-h464dc38_1       conda-forge
    gst-plugins-base:   1.12.5-hde13a9d_0       conda-forge
    gstreamer:          1.12.5-h5856ed1_0       conda-forge
    icu:                58.2-hfc679d8_0         conda-forge
    ipykernel:          5.1.0-py36h24bf2e0_1001 conda-forge
    ipython:            7.2.0-py36h24bf2e0_1000 conda-forge
    ipywidgets:         7.4.2-py_0              conda-forge
    jinja2:             2.10-py_1               conda-forge
    jpeg:               9c-h470a237_1           conda-forge
    jupyter:            1.0.0-py_1              conda-forge
    jupyter_console:    6.0.0-py_0              conda-forge
    libpng:             1.6.35-ha92aebf_2       conda-forge
    libuuid:            2.32.1-h470a237_2       conda-forge
    libxcb:             1.13-h470a237_2         conda-forge
    libxml2:            2.9.8-h422b904_5        conda-forge
    markupsafe:         1.1.0-py36h470a237_0    conda-forge
    mistune:            0.8.4-py36h470a237_0    conda-forge
    nbconvert:          5.3.1-py_1              conda-forge
    nbformat:           4.4.0-py_1              conda-forge
    notebook:           5.7.2-py36_1000         conda-forge
    pandoc:             2.5-0                   conda-forge
    pandocfilters:      1.4.2-py_1              conda-forge
    pcre:               8.41-hfc679d8_3         conda-forge
    pexpect:            4.6.0-py36_1000         conda-forge
    pickleshare:        0.7.5-py36_1000         conda-forge
    prometheus_client:  0.4.2-py_0              conda-forge
    prompt_toolkit:     2.0.7-py_0              conda-forge
    pthread-stubs:      0.4-h470a237_1          conda-forge
    ptyprocess:         0.6.0-py36_1000         conda-forge
    pygments:           2.3.0-py_0              conda-forge
    pyqt:               5.6.0-py36h8210e8a_7    conda-forge
    qt:                 5.6.2-hf70d934_9        conda-forge
    qtconsole:          4.4.3-py_0              conda-forge
    send2trash:         1.5.0-py_0              conda-forge
    sip:                4.18.1-py36hfc679d8_0   conda-forge
    terminado:          0.8.1-py36_1001         conda-forge
    testpath:           0.4.2-py36_1000         conda-forge
    wcwidth:            0.1.7-py_1              conda-forge
    webencodings:       0.5.1-py_1              conda-forge
    widgetsnbextension: 3.4.2-py36_1000         conda-forge
    xorg-libxau:        1.0.8-h470a237_6        conda-forge
    xorg-libxdmcp:      1.1.2-h470a237_7        conda-forge

@martinRenou
Copy link
Copy Markdown
Member Author

Also the completion doesn't work using jupyter console

@martinRenou
Copy link
Copy Markdown
Member Author

martinRenou commented Dec 3, 2018

It's clear what the issue is. When monkey patching IPython for widgets support, I import IPython, which I shouldn't do. And IPython changes jedi settings. Installing jupyter with conda installs ipython, so the import works, the monkey patching is done, and jedi settings are changed.

The monkey patching should be done without importing IPython.

@SylvainCorlay SylvainCorlay merged commit 4c8fd05 into jupyter-xeus:master Dec 3, 2018
@martinRenou martinRenou deleted the add_code_completion branch December 3, 2018 14:49
@martinRenou martinRenou mentioned this pull request Feb 4, 2021
DerThorsten pushed a commit to DerThorsten/xeus-python that referenced this pull request Nov 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants