Giter VIP home page Giter VIP logo

Comments (6)

elarivie avatar elarivie commented on August 19, 2024

Hello @DavidS3141

An "Internal Error" means an internal error within the lint tool mypy itself, you should therefore fill a bug report as shown in the error message to Mypy issue tracker

Note: An Internal error also implies that you would have obtained the same error if you would have call mypy manually using the CLI.

From A linter-mypy point of view, the only error that I see from the provided information is that the Mypy Nofity Internal Error setting is not checked and you are nevertheless still receiving the error pop-up. Which atom version, which linter-mypy version are you using?

Note: I have seen, and know how to trigger some Mypy internal error, but the one that you have is a new one to me...I am curious to know

  • Which OS you are using
  • Which python version you are using
  • Which installation step for Mypy you used.
  • etc... give some more information about your configuration

(The above information are most likely also going to be ask by Mypy maintainers)

In the meantime to help you debug your current environment I suggest to fully uninstall Mypy and re-install it using the following command line:

   python3 -m pip uninstall mypy
   python3 -m pip install -U mypy

Then make sure that you can manually using the CLI trigger a Mypy lint and obtain some warning without any internal error.

from linter-mypy.

demmerichs avatar demmerichs commented on August 19, 2024

Yeah sry, I should have been clearer, I know that the first part sounds like mypy issue, I just wanted to note it here for completeness. My problem was with the option obviously not working as intended for silencing the pop ups.

I am using the newest lint-mypy (2.6.9), mypy (0.770) and atom (1.45.0) I think.
I installed mypy via pip like you have shown under python version 3.6.9 under Ubuntu 18.04

I tried now some configuration settings out but I am new to mypy and can't really tell some of the options apart from what they are doing 'exactly'.

I will be able to check on the INTERNAL ERROR stuff on Monday at work, but today I found again something interesting, a discrepancy between lint-mypy and the CLI trigger.

src/pack/module.py

def some_func_with_type_annotations()...

src/pack/init.py

from .module import some_func_with_type_annotations

src/some_file_on_which_i_run_mypy.py

from pack import some_func_with_type_annotations

The above setup shows me an [attr-defined] error in Atom from lint-mypy telling me that the module pack has no member some_func_with_type_annotations. However, if I execute mypy on the CLI for the last file, it tells me everything is ok.
Interestingly, when I change the __init__.py from pack from the original from .module import func to from .module import func as func, then lint-mypy aggrees and also starts telling me that everything is okay.

from linter-mypy.

demmerichs avatar demmerichs commented on August 19, 2024

Actually I might not be able to have mypy correctly working, as it seems to show me no type error when using the function, although I intenionally put one in, and lint-mypy actually shows me the error when I "fix" the init.py like mentioned before.

It seems like I have gotten something very wrong about how mypy works with imports?

from linter-mypy.

elarivie avatar elarivie commented on August 19, 2024

Hello @DavidS3141,

I took a look at linter-mypy source code related to mypy internal error detection...

the code is currently looking for the following string:

": error: INTERNAL ERROR -- please report a bug at https://github.com/python/mypy/issues"

while the error from mypy that you receive is:

"error: INTERNAL ERROR -- Please try using mypy master on Github: https://mypy.rtfd.io/en/latest/common_issues.html#using-a-development-build Please report a bug at https://github.com/python/mypy/issues"

This string difference prevent linter-mypy from correctly identifying the internal error.

Both string are highly similar except:

  • That the word "please" first letter is upper case in your version
  • Yours contains some extra text in the middle about a development build

Linter-mypy fix: I'll update linter-mypy to make it less picky by only looking for the string:

"error: INTERNAL ERROR --"

By doing so the internal error will be detected in both cases and therefore you will have control to show or not the pop-up from linter-mypy settings

But...

  • You may want to review you local Mypy installation because you seem to have a development version installed.
  • The linter-mypy fix that I will do won't fix the root internal error present in Mypy, you should therefore still fill a bug report at the Mypy project.

from linter-mypy.

elarivie avatar elarivie commented on August 19, 2024

The fix is now available in linter-mypy v2.6.10

@DavidS3141
Let me know if it solves your pop-up issue

from linter-mypy.

demmerichs avatar demmerichs commented on August 19, 2024

Turning off the internal errors work now. And I have got now parity between the results from linter-mypy and the CLI mypy, still some issues with imports but I will head over to mypy and reference my issue here for completeness later.

Thanks for your help.

EDIT:
So one issue for my import errors were that I did not use --namespace-packages of mypy, as I do not use __init__.py in my packages. Did not know about this subtle difference and thought until now, that a package is a package. Also it does not help that the default setting for this is off.

Anyway, there was still this issue with the INTERNAL ERROR, which I reported here.

from linter-mypy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.