szabope / mypy-pycharm-plugin

This plugin provides PyCharm with both real-time and on-demand scanning capabilities using an external MyPy tool.
Apache License 2.0
2 stars 0 forks source link

Plugin seems to do nothing in PyCharm Professional 2024.3 #24

Open Kyle-sandeman-mrdfood opened 1 day ago

Kyle-sandeman-mrdfood commented 1 day ago

Hi, thanks for picking up where Roberto's plugin left off! I believe the plugin was working for some time but I think upgrading to 2024.3 may have broken something. I have tried reinstalling the plugin as well as downgrading the plugin back to 1.0.0. I have NOT tried downgrading PyCharm.

I hope this .mov works for you: https://github.com/user-attachments/assets/3a0db6f5-4db8-409b-be08-3125fc5358ea if not:

Images ![image](https://github.com/user-attachments/assets/91cb04d4-3474-483d-80c0-c46a0293715f) Of course, the yellow highlights are from PyCharm itself, mypy inspections are still default (red underline) ![image](https://github.com/user-attachments/assets/b66e658a-4a51-46e1-81a6-a3918de9eef8) ![image](https://github.com/user-attachments/assets/4e6ec245-b63c-4f2e-85c7-d93d58841de1)

In any case, the summary is that no plugin functionality works. No inspections in the editor, no files are scanned when using the toolbar, etc. My mypy config file has not changed since this problem started, but I can provide it if necessary. I couldn't see any relevant logs for this plugin, which I think existed in Roberto's one (i.e. it would log the invoked command and some other things, I believe)

szabope commented 1 day ago

Hey Kyle,

Thanks for reporting! I can reproduce the issue on 2024.3 with 1.0.3 plugin.

I'm on it. The problem seems to affect new projects, the one I use for manual testing is still okay. And the issue must occur at some early stage, as I didn't receive the in-editor notification about missing configuration either. I'll get back to you when fix is merged.

szabope commented 1 day ago

Workaround until fix is available: switch interpreter back and forth.

@Kyle-sandeman-mrdfood can you please confirm this workaround?

Kyle-sandeman-mrdfood commented 1 day ago

Hi, wow that's a quick reply 😁 I cannot confirm the workaround. I first spotted the issue in a new project, but existing projects are broken too.

Original interpreter (from screenshots in OP): miniconda base which is python 3.12 Newly selected interpreter: miniconda py3.11, no change. The most interesting part of this issue is the "0 file(s)" image

szabope commented 1 day ago

Well, then I found an unrelated IJ issue with querying the projectSdk. That's something. :) I'll report it later.

Next idea: I've just realized that it is a file outside a project: /tmp/test_file.py I can reproduce the issue if I touch /tmp/test_file.py, open it in PyCharm, paste your method and then even start adding lines. And when I hit Ctrl+S, it starts working. Can you confirm this one? The intention that adds # type: ignore is also broken for external files.

Long story short: I'm on it.

Kyle-sandeman-mrdfood commented 1 day ago

Apologies if I misled you, but /tmp/test_file.py was actually a symlink because I didn't want to create a new project for this πŸ˜…. (couldn't show project structure etc in screenshots) To be clear, the test_file in the editor was in the project. Only the manual mypy run was against the symlink

Happy to re-test whenever you have something πŸ‘

szabope commented 1 day ago

Well, misleading me made me think about cases I missed to think about before, so I'm still grateful for it. :) First I'll fix those issues that I can reproduce, and hope that they are related to your issue in some way. This will take a day or two. Then I'll ask you to have a look, and hope that either these issues are fixed or something at least changed, so it helps with the investigation.

Thank you again for reporting the issue and helping me with the investigation.