GNOME Bugzilla – Bug 778708
python autocomplete fails with jedi 0.10.0
Last modified: 2017-08-09 21:14:40 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.
*** Bug 781418 has been marked as a duplicate of this bug. ***
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(-)
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):
+ Trace 237601
self.run()
self._target(*self._args, **self._kwargs)
namespace = tree.find('core:namespace', namespaces=ns)
which is quite different. I can open another report if necessary.
I believe that is a different issue, and i think it is related to the GObject Introspection for Python plugin.
Filed #784327.
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.
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.
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.
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!
Created attachment 357307 [details] [review] flatpak: bump bundled jedi version
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