-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Adds the --ignore-missing-stubs command line option #4491
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
Conversation
--ignore-missing-stubs MODULE-1 [MODULE-2 ...] will suppress missing typeshed information for the specified modules Fixes issue python#3905
Thanks! I have one issue with the UI design though. The way argparse parses flags with an arbitrary number of values unfortunately makes it hard to specify that flag followed by a filename (meant as a positional arg):
will complain that there's no target module, package or file. My suggested solution is to use a comma as a separator instead; you'll have to do a little parsing of the (single) argument to make that work, and it'll require some more work for mypy.ini. |
What about naming it It would be nice if there was an easy way to ignore an entire package. Maybe the target should act as a prefix, ignoring all submodules as well? Or we could support the The documentation should probably cover packages and submodules as well. |
Note that IIRC it's possible to ignore specific modules by putting either |
The new syntax is --ignore-missing-stubs module-1[,module-2,...,module-n]
The above commit has the new syntax and additional tests to make sure behavior is consistent with the config files. |
Can anyone help merge this PR? This feature would be very useful to several projects I'm working on. |
@boompig To move forward with this, please respond to my comments above. |
I think this may be confused with
It's missing numpy and pandas, for example.
This is a good idea, though in practice I wonder how often this comes up for a user who has chosen to use mypy...
I like the idea of a * wildcard. This is a very good idea. Not sure if I have the bandwidth to work on this though, since it's a non-trivial change.
Can you explain further? |
The current approach only works for certain third party modules that happen to be whitelisted in mypy. It doesn't allow ignoring missing stdlib stubs and non-whitelisted third party modules, which is too limiting (and also confusing). We could continue to use
You could mention that ignoring package |
I'm not so sure this is needed.
I did test this and it worked fine. |
If you're thinking of #3789, according to the OP it still parses those modules? |
Interesting. It seems if I have:
it will skip it with |
Ah, I know why. The latter invocation searches the folder named |
Agree that this isn't needed.
To suppress use of a typeshed package this is present but that you want to suppress anyways, you can use:
(the |
--ignore-missing-stubs MODULE-1 [MODULE-2 ...] will suppress missing typeshed information for the specified modules
Includes tests for both command-line and config file invocations
Fixes issue #3905