wyuenho / emacs-pet

Tracks down the correct Python tooling executables from your virtualenvs so you can glue the binaries to Emacs and delete code in init.el

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support flymake?

publicimageltd opened this issue · comments

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

  • PET latest version
  • Emacs 29.1 with eglot
  • Python and mypy latest version
  • Standard installation of PET, as recommended in the doc (by using setq-locale and the hook python-base-mode-hook.

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!