Skip to content

Mypy fails on external libraries  #19131

Closed as duplicate of#18927
Closed as duplicate of#18927
@Lyranile

Description

@Lyranile

I have this code

 from structlog import configure, get_logger
 from structlog.dev import ConsoleRenderer
 from structlog.stdlib import (
     AsyncBoundLogger,
     LoggerFactory,
 )
 
 from response.level import Level
 
 configure(  # pragma: no cover
     processors=[
         ConsoleRenderer(
             colors=True,
             sort_keys=True,
         ),
     ],
     logger_factory=LoggerFactory(),
     wrapper_class=AsyncBoundLogger,
     cache_logger_on_first_use=True,
 )
 
 logger: AsyncBoundLogger = get_logger(  # pragma: no cover
     "uvicorn",
 )

I ran mypy to check for any issues on a report
image-5.png

And it gives me this issueimage-4.png

How do I solve these issues, and how can I make mypy ignore these if solving is not an option

What do I do when external libraries are untyped?

mypy 1.15.0
Python 3.13
MacOS

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugmypy got something wrong

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions