Skip to content

Allow PEP 561 packages to specify mypy settings #5260

Closed
@emmatyping

Description

@emmatyping

[This is a summary of a discussion on the typing gitter, if I missed anything please do mention it]
With the expectation of many new packages being created conforming to PEP 561, @ilevkivskyi suggested that package authors should be able to set strictness settings on their code.

Ivan's original suggestion is to allow setting some flags like --ignore-missing-imports, --no-strict-optional in the source file(s) themselves.

I suggested per-package, as defining and implementing a new format seemed like a lot of work. Also, I generally am against metadata in source code, as I find it noisy.

@Michael0x2a wanted the ability to override this.

Michael then suggested we mandate PEP 561 packages provide a config file and mypy can read per-module config options from said file.

Ivan suggested amending the suggestion to mypy will allow per-module config files in PEP 561 packages.

I concurred with Ivan.

tl;dr

I suggest that mypy read per-module config file settings, if a config file is found.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions