Bug 252395 - devel/py-jedi: update to 0.18 breaks devel/ipython autocompletion
Summary: devel/py-jedi: update to 0.18 breaks devel/ipython autocompletion
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Ruslan Makhmatkhanov
URL: https://github.com/ipython/ipython/pu...
Keywords:
Depends on:
Blocks:
 
Reported: 2021-01-04 00:05 UTC by rsmith
Modified: 2021-01-21 05:40 UTC (History)
4 users (show)

See Also:
fernape: maintainer-feedback? (python)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description rsmith 2021-01-04 00:05:08 UTC
After #252325 was closed, I ran into the fact that autocompletion in IPython no longer worked. For example:

    elysium:~> ipython

    In [1]: cd tmp 
    Traceback (most recent call last):
    File "/usr/local/lib/python3.9/site-packages/IPython/terminal/ptutils.py", line 113, in get_completions
        yield from self._get_completions(body, offset, cursor_position, self.ipy_completer)
    File "/usr/local/lib/python3.9/site-packages/IPython/terminal/ptutils.py", line 129, in _get_completions
        for c in completions:
    File "/usr/local/lib/python3.9/site-packages/IPython/core/completer.py", line 438, in _deduplicate_completions
        completions = list(completions)
    File "/usr/local/lib/python3.9/site-packages/IPython/core/completer.py", line 1818, in completions
        for c in self._completions(text, offset, _timeout=self.jedi_compute_type_timeout/1000):
    File "/usr/local/lib/python3.9/site-packages/IPython/core/completer.py", line 1861, in _completions
        matched_text, matches, matches_origin, jedi_matches = self._complete(
    File "/usr/local/lib/python3.9/site-packages/IPython/core/completer.py", line 2029, in _complete
        completions = self._jedi_matches(
    File "/usr/local/lib/python3.9/site-packages/IPython/core/completer.py", line 1373, in _jedi_matches
        interpreter = jedi.Interpreter(
    File "/usr/local/lib/python3.9/site-packages/jedi/api/__init__.py", line 725, in __init__
        super().__init__(code, environment=environment,
    TypeError: __init__() got an unexpected keyword argument 'column'

Looking at the github repo for IPython, I found that there was a pull-request related to this: https://github.com/ipython/ipython/pull/12751

In essence, this modifies dependency for py-jedi as follows:

    jedi>=0.16,<0.18.0

Apparently, there has been a change in the py-jedi API.
The master branch for IPython was fixed, but this fix has not been backported to the 7.x branch.

So it seems to me that a rollback to 0.17 is in order until this is fixed in IPython.
Comment 1 rsmith 2021-01-05 22:45:26 UTC
On further investigation, it turns out that to restore functionality for IPython, *both* devel/py-jedi and textproc/py-parso need downgrading.

I performed the following to get a working IPython back:

# cd /usr/ports
# svnlite update -r 559750 devel/py-jedi
# cd devel/py-jedi
# make package deinstall install clean
# cd /usr/ports
# svnlite update devel/py-jedi
# svnlite update -r 559531 textproc/py-parso
# cd textproc/py-parso
# make package deinstall install clean
# cd /usr/ports
# svnlite update textproc/py-parso

And for now:
# pkg lock -y py39-parso-0.7.1 py39-jedi-0.17.1
Comment 2 Ruslan Makhmatkhanov freebsd_committer 2021-01-19 09:29:40 UTC
Hello, the issue was resolved in ipython port's r562034 (upstream patch added, that don't use deprecated api).
Comment 3 rsmith 2021-01-21 05:40:03 UTC
Unfortunately this doesn't completely fix the problems; it exposes other bugs. See bug 252875.