Skip to content

Mypy 0.710 broke support for inline weak import comments #7024

Closed
@AdiRishi

Description

@AdiRishi

Are you reporting a bug, or opening a feature request?
I'm reporting a breaking change in mypy 0.710

Please insert below the code you are checking with mypy
The following import at the top of a file no longer works

# mypy: weak=import

What is the actual behavior/output?
<path_to_file>:1: error: Unrecognized option: weak = import

What is the behavior/output you expect?
It is expected that mypy allows weak imports in the file, or at the very least doesn't raise an error.

What are the versions of mypy and Python you are using?
Python version: 3.7
mypy version: 0.710
mypy-extensions version: 0.4.1
typed-ast version: 1.4.0

What are the mypy flags you are using? (For example --strict-optional)
The exact command we are running is
mypy --ignore-missing-imports --disallow-untyped-defs --strict-optional

I have yet to find which exact version of mypy had this breaking change.
I just thought I'd make this issue, and see if you are aware/have a recommended fix for this.

I appreciate any help you provide and I'm happy to provide further details if necessary.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions