You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I work in a company that has its own python library for managing paths and imports. In our code, you'll see things like: moduleName = importer.importPackage('moduleName')
which does a lot of work under the hood in figuring out what moduleName refers to, where on disk it lives, puts that path on the sys.path, and then asks python to import it. We've written a pylint plugin that makes this work in pylint; it walks the AST and everywhere it finds one of those calls, it does a similar lookup to find where the module lives and then tells pylint to parse it and add it as an import to the current module.
I'm wondering about the feasibility of adding support for something like this to Jedi. We've started using Jedi a lot more recently and while it works great for normal style imports, anytime it hits any of our custom imports, we don't get any auto-completion. It seems that Jedi cannot current support something like this (no plugin interface). I was wondering if such a thing would be possible and consistent with Jedi's design. I'm happy to help contribute code towards that end if such a thing would be considered.
The text was updated successfully, but these errors were encountered:
There is a plugin interface (look at jedi.plugins.builtins). It's just that it's not public. While your use case can work easily with that plugin system, it's just not documented and "stable".
So feel free to implement something that plugs into that (or possibly just fork Jedi, it's probably the easiest way). However I will not support you if you go down that road (Consulting is of course possible).
It's also quite possible that Jedi will change the API and you will need to rewrite some things. But it could definitely be beneficial for you guys.
As a side note I would probably recommend you guys to use the sys.meta_path stuff. That stuff could potentially also work with Jedi and you can still use normal imports while still doing magic. What you guys did is probably a bad idea.
I work in a company that has its own python library for managing paths and imports. In our code, you'll see things like:
moduleName = importer.importPackage('moduleName')
which does a lot of work under the hood in figuring out what moduleName refers to, where on disk it lives, puts that path on the sys.path, and then asks python to import it. We've written a pylint plugin that makes this work in pylint; it walks the AST and everywhere it finds one of those calls, it does a similar lookup to find where the module lives and then tells pylint to parse it and add it as an import to the current module.
I'm wondering about the feasibility of adding support for something like this to Jedi. We've started using Jedi a lot more recently and while it works great for normal style imports, anytime it hits any of our custom imports, we don't get any auto-completion. It seems that Jedi cannot current support something like this (no plugin interface). I was wondering if such a thing would be possible and consistent with Jedi's design. I'm happy to help contribute code towards that end if such a thing would be considered.
The text was updated successfully, but these errors were encountered: