Skip to content

Way to disable missing library stubs errors #16913

@csm10495

Description

@csm10495

Feature

I understand that generally we want to use stubs and type annotations, but sometimes we're in an environment where:

  • I can't install new packages at check time (maybe air-gapped to network)
  • I don't have the stubs available

Requesting a command line and config option to disable errors/warnings relating to inability to find/use stubs for the entire project.

Lets call this option ignore_missing_stubs it defaults to False.

Pitch

This should be combinable and usable at a global level to disable errors relating to inability to use type stubs for known libraries.

A user can use this option combined with ignore_missing_imports = True to disable all [import-untyped] errors globally for the project.

In other words:

[mypy]
ignore_missing_imports = True
ignore_missing_stubs = True

Would lead to no errors on missing both missing imports and no errors on missing stubs for known packages.

I completely understand that this is counter to how we want mypy to be used, but honestly the current nagging for import-untyped is a bit overboard for me. At the moment disabling the stub error without listing out all libs, and disabling it manually and/or adding type ignores to each import line seems to be the only way.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions