anachronic / importmagic.el Goto Github PK
View Code? Open in Web Editor NEWAn Emacs package that resolves unimported Python symbols
License: GNU General Public License v3.0
An Emacs package that resolves unimported Python symbols
License: GNU General Public License v3.0
I am using the spacemacs python layer on macos and I am running into this error.
I have installed importmagic and epc using pip globally.
➜ pip install importmagic epc Requirement already satisfied: importmagic in /usr/local/lib/python3.7/site-packages (0.1.7) Requirement already satisfied: epc in /usr/local/lib/python3.7/site-packages (0.0.5) Requirement already satisfied: setuptools>=0.6b1 in /usr/local/lib/python3.7/site-packages (from importmagic) (41.6.0) Requirement already satisfied: sexpdata>=0.0.3 in /usr/local/lib/python3.7/site-packages (from epc) (0.0.3)
I've installed importmagic and epc for python2 as well.
I have set my python interpreter in emacs to "python3"
(setq flycheck-python-pycompile-executable "python3") (setq python-shell-interpreter "python3")
All other python features work except this one. Not sure how to resolve this.
I'm using pip3 to install these dependencies. I tried pip as well but no luck get this working.
After installing the dependencies. I get:
Requirement already satisfied: importmagic in /usr/local/lib/python3.6/site-packages
Requirement already satisfied: epc in /usr/local/lib/python3.6/site-packages
Requirement already satisfied: setuptools>=0.6b1 in /usr/local/lib/python3.6/site-pack
ages (from importmagic)
Requirement already satisfied: sexpdata>=0.0.3 in /usr/local/lib/python3.6/site-packag
es (from epc)
And I get the error message when opening a python file.
Importmagic and/or epc not found. importmagic.el will not be working.
Do I have to configure this just like what this sublime plugin did here?
It would be much appreciated if this support use a remote python environment for tramp files
We're currently relying on travis to set up virtual environments. However, I'm not 100% convinced that emacs is using the virtual environments provided by the OS, since nowhere are we sourcing those virtualenvs. This leads me to think that emacs is always using OS's python
rather than the virtual environment's.
virtualenvwrapper.el
seems like a good place to look at.
I'd like to make a macro that defines tests for every Python version we want to support. That way we can keep our definitions and be sure that we're sourcing the right python versions.
Hi, thanks for the awesome package.
Currently for os.path.join*
(where *
is the cursor), importmagic-fix-symbol-at-point
will ask imports for os.path
which give candidates like
It would be nice to have an option to ask imports for os
even the cursor is right after os.path.join
like
for one who prefers usages like os.path.join()
and datetime.datetime.now()
instead of join()
and now()
.
Also, if the cursor is right after os.path*
, importmagic-fix-symbol-at-point
, candidates is now given as
which (importing path
while using as os.path
) is probably not what the user want in this situation.
How do you think about it? I found this because I saw the gif of the importmagic
repo and noticed that it imports os
in this situation.
Thanks for the great package. I have a suggestion. Rather than hard code a "python" in starting a epc server, it would be nice if the package could read the variable python-shell-interpreter
or read the virtualenv settings or providing a customization of it.
Python 2.7 breaks with a SyntaxError because of the non-ASCII character in your name, I suspect. It's easy enough to resolve; add # -*- coding: utf-8 -*-
to the top of the file and all's well.
And yeah, I should be using 3.x.
I have done pip install -e .
in my project where I have to import all the files as:
from broker._utils._log import log
from broker._utils.tools import QuietExit, print_tb
from broker.utils import tools
$ tree
├── broker
│ ├── _utils
│ ├── _log.py
│ ├── tools.py
But importmagic
does not find any modue names under broker
like import broker._utils._log.py
.
Would it be possible to force it to see them as well?
It's also mentioned here: jorgenschaefer/elpy#1230
The problem is that sometimes the process hangs and then uses the CPU fully. Do you know what could be the solution to this?
When running importmagic-fix-symbol
, I keep getting the error message:
epc:net-send: Process epc con 3 not running
I cannot find any info online why this happens. I do have a buffer called *epc con 6*
. Why does importmagic
need "epc con 3"? What is special about it?
I faced seg fault on my emacs importmagic. During deep investigation I found out that problem appears on newer versions of python. I could not find reason for that. But I found workaround that wont harm. And during lack of support for original python importmagic. I would be happy to see fixes at least here.
What needs to be done? Add name='default'
here
There's a new mode in emacs29, python-base-mode
, which python-mode
and python-ts-mode
both derive from, and importmagic ought to test against that.
This has been requested in #3 and would solve #10 if error messages were more accurate. Issue can be closed after
importmagic
and/or epc
are not found and running python process failed (which do not exist right now) are separated. Right now the default behavior is having only the first error message for both cases.importmagic.el
uses the python-shell-interpreter
variable in order to find the python executable. This was ultimately the problem in #10.I'll mention #12 aims to fix this but it's a little buggy atm.
I might be missing something, but it seems that the style configuration for importmagic
isn't exposed.
From a brief look, maybe it makes sense for the get_import_statement
to take a configuration alist and convert it to a dictionary (not sure how epc
handles this) to set on the Imports
object. Does that make sense/sound about right?
I have not been using Emacs now for a very long time, and I don't have time to maintain this project. In fact, #17 has stayed open for a very long time, and I'll admit I haven't even taken a look at it.
I'm going to archive this repository unless I can find a new maintainer before Jan 31, 2020. If anyone reading this wishes to maintain this, project, please comment here.
This issue affects importmagic.el
in a slightly different way than jedi.el
and I don't know where to look for a log that contains a traceback, but it hangs forever on 0.0.4 and works fine on 0.0.3: jd-boyd/sexpdata#36
At least the option to silence non informative non error status messages like the index updated one.
hello, i use elpy mode to write python code im emacs, but the latest elpy mode remove the importmagic package, some command is no longer to use, such as elpy-importmagic-fixup, it's very conveniont, is there any method to implete it in importmagic.el?
When I auto-complete in a directory like this:
+ src/
+ foo/
| bar.py
| baz.py
| __init__.py
if I'm in baz.py
and I type BazClass
, a symbol that appears in bar.py
, I will see suggestions like this:
from foo.baz import BazClass
from baz import BazClass
the latter seems to be straightforwardly incorrect. Is there some way I can configure importmagic to get rid of it?
From the docstring of defvar
:
To define a user option, use ‘defcustom’ instead of ‘defvar’.
I assume this is because it's a C module and therefore there's no source to scan. I'm opening this on .el
rather than the Python library because the Python library has a way to add import statements but it's not clear to me what the "right" way to inject those into the relevant process is.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.