Closed publicimageltd closed 9 months ago
Which LSP server are you using?
Spyder pyhon lsp and ruff as a linter
Please tell me about your directory structure and how you normally run mypy, and what configuration you have so mypy can pick up your stubs.
I have a .venv
file in the python project folder. Mypy is installed globally (I'm on arch, it is installed as a pacman package). I don't run mypy manually, but delegate that to Emacs.
I just called mypy manually, same reply (no stub installed etc.). To check, I Just installed it in the activated venv (pip install mypy
+ pip install of the stub library), but no change.
But as to how mypy communicates with Emacs: no idea. I thought it is done by eglot.
Actually it seems to be a problem with mypy and not with PET, but I would be glad about any help how to further investigate the issue.
In this case I would suggest you play around with mypy's configuration before jumping to the conclusion of this being a bug of PET. If it doesn't run in your terminal, it's not going to run in Emacs.
Yes, sorry for the noise. Will check on that. Thanks for the fast reply!
Description
I use eglot in a virtual environment. Everything works fine except that mypy does not load the stubs for typechecking imported modules. I'm using flymake, and it reports an error that mypy cannot find the stubs. Except that the stubs are installed in the venv.
If I switch to flycheck, the mypy error goes away. Thus I believe that flymake somehow does not fully recognize the environemt set by PET.
If I can test this, I'd welcome some pointers how to investigate this issue. It might, of course, also be due to eglot, but I have no idea how to test it (and I do not want to install lsp-mode).
** Setup
setq-locale
and the hookpython-base-mode-hook
.