leinardi / mypy-pycharm

A plugin providing both real-time and on-demand scanning of Python files with Mypy from within PyCharm/IDEA.
Apache License 2.0
188 stars 30 forks source link

"Mypy found no problems" after adding "[plugins]" part in mypy.ini #109

Open HappyCthulhu opened 1 year ago

HappyCthulhu commented 1 year ago

Step 1: Are you in the right place?

Step 2: Describe your environment

Step 3: Describe the problem:

I know, that similar problem was described in this issue. But nobody told, how to reproduce it. So, i will)

Steps to reproduce:

  1. install lib django-stubs[compatible-mypy] to your project with pip install django-stubs[compatible-mypy]
  2. add it in plugins part like this:
[mypy]
mypy_path = stubs/

plugins =
    mypy_django_plugin.main

Observed Results:

So, after adding plugins part mypy pycharm plugin cant find any problems. But, if u with run mypy throung terminal, its finds problems.

Expected Results:

Before adding plugins part: image

After adding plugins part: image

Mypy binary: image

My config:

[mypy]
mypy_path = stubs/
plugins =
    mypy_django_plugin.main

    [mypy.plugins.django-stubs]
    django_settings_module = "config.settings"
hughperkins commented 1 year ago

I want to like pycharm, because I use Rider for C#, and Rider is awesome. But without mypy support, pycharm is dead on arrival...

millsks commented 1 year ago

Does this help you?

hughperkins commented 1 year ago

No. There are actually multiple different issues. But that was not one of them. mypy works perfectly for me. But pycharm doesn't appear to use mypy, which is the root of the issues. One issue is that pycharm treats a parameter written as someparam: str = None as implicitly typed to Optional[str], rather than as a syntax error. The current pycharm behavior was deprecated in mypy a year or two ago. There are additional errors that mypy detects, but pycharm does not. I've gone back to using vscode for now, whilst for Unity/C#, Rider is pretty good.

pingvincible commented 9 months ago

Hi! I'm experiencing the same issue. Is there any workarounds about it?

HappyCthulhu commented 9 months ago

Hi! I'm experiencing the same issue. Is there any workarounds about it?

Nope... I solved it by moving to VsCode. Its very shitty for python, but u can set up mypy pretty nicelly. And mypy is very important. Also have in plans find out, how mypy works in emacs