Ask Your Question
3

What is the process of adding to pyproject.toml to disregard absent library stubs for mypy?

asked 2023-06-04 05:28:07 +0000

lakamha gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2023-06-04 05:50:01 +0000

pufferfish gravatar image

To add to pyproject.toml to disregard absent library stubs for mypy, you can use the ignore_missing_imports setting. Here are the steps to follow:

  1. Open your pyproject.toml file.
  2. Add the following section to the file, if it does not already exist:

    [mypy]
    
  3. Add the following line to the mypy section to ignore missing imports:

    ignore_missing_imports = true
    
  4. Save the pyproject.toml file.

This setting tells mypy to ignore any missing import errors, including missing library stubs. This can be useful when working with external libraries that do not have stubs available or when using third-party packages that have incomplete type annotations.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2023-06-04 05:28:07 +0000

Seen: 13 times

Last updated: Jun 04 '23