-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow disabling mypy completely per module/package #3383
Comments
In mypy.ini you can include a section like this:
(assuming the name of your generated module is |
Ah, that was the config flag I was missing.
Can I do that at package scope or only module?
…On Fri, May 19, 2017, 2:20 PM Guido van Rossum ***@***.***> wrote:
In mypy.ini you can include a section like this:
[mypy-foo.bar.baz]
ignore_errors = True
(assuming the name of your generated module is foo.bar.baz, e.g. living
in a file foo/bar/baz.py.)
See http://mypy.readthedocs.io/en/latest/config_file.html
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#3383 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAA5NCrVffgcyyimnzUe12-uYHhImxSlks5r7d1igaJpZM4NgnIs>
.
|
You can use |
It seems that some errors are too terrible to ignore: > mypy .
/.../lib/python3.10/site-packages/lmdbm/lmdbm.py:28: error: syntax error in type comment "(bool, ) -> None"
/.../lib/python3.10/site-packages/lmdbm/lmdbm.py:98: error: syntax error in type comment "(int, ) -> None"
/.../lib/python3.10/site-packages/lmdbm/lmdbm.py:103: error: syntax error in type comment "(object, ) -> bytes"
/.../lib/python3.10/site-packages/lmdbm/lmdbm.py:113: error: syntax error in type comment "(bytes, ) -> KT"
/.../lib/python3.10/site-packages/lmdbm/lmdbm.py:118: error: syntax error in type comment "(VT, ) -> bytes"
/.../lib/python3.10/site-packages/lmdbm/lmdbm.py:128: error: syntax error in type comment "(bytes, ) -> VT"
/.../lib/python3.10/site-packages/lmdbm/lmdbm.py:133: error: syntax error in type comment "(KT, ) -> VT"
/.../lib/python3.10/site-packages/lmdbm/lmdbm.py:161: error: syntax error in type comment "(KT, ) -> None"
/.../lib/python3.10/site-packages/lmdbm/lmdbm.py:188: error: syntax error in type comment "(object, ) -> bool"
/.../lib/python3.10/site-packages/lmdbm/lmdbm.py:288: error: syntax error in type comment "(VT, ) -> bytes"
/.../lib/python3.10/site-packages/lmdbm/lmdbm.py:294: error: syntax error in type comment "(bytes, ) -> VT"
Found 11 errors in 1 file (errors prevented further checking) I've tried to silence this with: # pyproject.toml
[[tool.mypy.overrides]]
module = "lmdbm.*"
ignore_errors = true but, alas, this isn't working... Encountered with P.S. I'm sorry for resurrecting an old thread. |
Yeah, "errors prevented further checking" is an indicator of a too terrible error :-) The easiest thing for you is probably to add a per-module follow_imports=skip. (Instead of analysing the module and trying to ignore errors, that will prevent analysis of the module in the first place and just preemptively replace everything from it with Any) |
Since people are linking to this: I fixed the blocking import part of this in #13506. There might still be some reporting issues though. Also note: the per-module follow_imports option refers to the module you're using, not the module you use it from (which is what you want in this situation!). Be careful with follow_imports, in particular, if you set it globally you will make mypy kinda useless. (Locking, since I think enough has changed that further discussion on this issue will just prove confusing) |
I'd like to exclude a package from mypy entirely. Due to some constraints right now, I need to commit some generated code to my repo, and it's breaking my mypy setup because it's untyped.
I can't just tune down the parameters because mypy treats certain ones as global - I tried flipping all the flags off that I could, but even setting
follow_imports = silent
in my mypy.ini under[mypy-pkg/foo]
, I still get errors abouterror: No library stub file for module 'blah'
coming from inside thefoo
packageThis would also help make it easier for new projects to start using mypy incrementally in their CI, by blacklisting sections that haven't been updated yet.
The text was updated successfully, but these errors were encountered: