After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 778708 - python autocomplete fails with jedi 0.10.0
python autocomplete fails with jedi 0.10.0
Status: RESOLVED FIXED
Product: gnome-builder
Classification: Other
Component: plugins
3.22.x
Other Linux
: Normal normal
: ---
Assigned To: GNOME Builder Maintainers
GNOME Builder Maintainers
: 781418 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2017-02-15 20:07 UTC by Jussi Kukkonen
Modified: 2017-08-09 21:14 UTC
See Also:
GNOME target: ---
GNOME version: 3.21/3.22


Attachments
jedi: adapt to jedi 0.10.0 (8.68 KB, patch)
2017-08-09 14:46 UTC, Elad Alfassa
none Details | Review
jedi: adapt to jedi 0.10.0 (8.88 KB, patch)
2017-08-09 15:14 UTC, Elad Alfassa
committed Details | Review
flatpak: bump bundled jedi version (1.10 KB, patch)
2017-08-09 21:12 UTC, Christian Hergert
committed Details | Review

Description Jussi Kukkonen 2017-02-15 20:07:19 UTC
jedi plugin load fails on Debian Unstable with 
    jedi not found, python auto-completion not possible.

python3-jedi is installed. The reason seems to be that "from jedi.evaluate.compiled import builtin" fails with:
    ImportError: cannot import name 'builtin'

I'm testing with Debians python3-jedi 0.10.0~git1+f05c071-1 (which is slightly before 0.10.0 release) but I'm guessing this applies to 0.10.0 as well.

There is now a jedi.evaluate.compiled.builtin_from_name(evaluator, string) which seems like it could do the same job as what "builtin" was used for -- I just don't quite understand what the code is doing to actually test this.
Comment 1 Christian Hergert 2017-04-17 19:57:56 UTC
*** Bug 781418 has been marked as a duplicate of this bug. ***
Comment 2 Laurent Bigonville 2017-05-11 13:22:21 UTC
I can confirm this, I can see that this has been removed in 2014 from the jedi code:

commit dfb494b9c471bcb9582a5f5a7a29ec1ee9602442
Author: Dave Halter <davidhalter88@gmail.com>
Date:   Sun Jan 12 18:22:33 2014 +0100

    finally able to delete the old builtin stuff

 jedi/evaluate/builtin.py | 455 ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 test/test_builtin.py     |  13 ------
 test/test_compiled.py    |   9 ++++
 3 files changed, 9 insertions(+), 468 deletions(-)
Comment 3 Alexandre Franke 2017-06-29 08:15:20 UTC
Not sure this is the same issue but jedi also fails to load for me with current master. I get this:

jedi not found, python auto-completion not possible.
Exception in thread Thread-1:
Traceback (most recent call last):
  • File "/usr/lib64/python3.5/threading.py", line 914 in _bootstrap_inner
    self.run()
  • File "/usr/lib64/python3.5/threading.py", line 862 in run
    self._target(*self._args, **self._kwargs)
  • File "/home/afranke/src/jhbuild/install/lib/gnome-builder/plugins/jedi_plugin.py", line 301 in update
    namespace = tree.find('core:namespace', namespaces=ns)
  • File "src/lxml/lxml.etree.pyx", line 2191 in lxml.etree._ElementTree.find
  • File "src/lxml/lxml.etree.pyx", line 1874 in lxml.etree._ElementTree._assertHasRoot
AssertionError: ElementTree not initialized, missing root

which is quite different. I can open another report if necessary.
Comment 4 Christian Hergert 2017-06-29 08:16:41 UTC
I believe that is a different issue, and i think it is related to the GObject Introspection for Python plugin.
Comment 5 Alexandre Franke 2017-06-29 09:07:34 UTC
Filed #784327.
Comment 6 Ewan Paterson 2017-07-16 21:19:06 UTC
I have experienced the same bug while packaging the latest version of jedi for Solus and I can't commit that update until this issue is resolved. I have looked at the ways other projects have solved similar issues (e.g. Spyder: https://github.com/spyder-ide/spyder/blob/master/spyder/utils/introspection/jedi_patch.py) but I'm not familiar enough with GNOME Builder to provide a fix myself. Any progress on this issue would be greatly appreciated.
Comment 7 Elad Alfassa 2017-08-09 14:46:10 UTC
Created attachment 357277 [details] [review]
jedi: adapt to jedi 0.10.0

This patch makes the jedi plugin work again with jedi 0.10.0

note that with this patch applied, the minimum version of jedi that is supported by the plugin is 0.10.0, as it's very difficult to support multiple versions of jedi when monkey-patching so much stuff.

A more sustainable approach would obviously be to integrate these changes in jedi upstream, but upstream doesn't seem interested in GObject-Introspection specific code.
Comment 8 Elad Alfassa 2017-08-09 15:14:35 UTC
Created attachment 357278 [details] [review]
jedi: adapt to jedi 0.10.0

I accidentally added a line in the previous patch that shouldn't have been there. Here's a new version of the patch with that line removed.
Comment 9 Ewan Paterson 2017-08-09 16:03:38 UTC
Applied the patch to GNOME Builder 3.24.2 with jedi 0.10.2 on Solus. All appears to be working now. Thanks very much Elad!
Comment 10 Christian Hergert 2017-08-09 21:12:52 UTC
Created attachment 357307 [details] [review]
flatpak: bump bundled jedi version
Comment 11 Christian Hergert 2017-08-09 21:14:34 UTC
Thank you so much for looking into and fixing this!

Most distros are on 0.10.x now, so we don't need to maintain compat with 0.9.0.
We still bundled 0.9 so we could try to keep it working in flatpak, but it is
easy enough for us to bump that now.

Attachment 357278 [details] pushed as 8bf74c7 - jedi: adapt to jedi 0.10.0
Attachment 357307 [details] pushed as a7e383a - flatpak: bump bundled jedi version