Skip to content

Hygienic mypy plugin: don't import Django into the mypy process #1384

Open
@intgr

Description

@intgr

We have no immediate plans to implement this, but I decided to open this issue for discussions, to split it out from #1337.

Original post by @intgr #1337 (comment)

The mypy plugin should be "hygienic" with regards to Django code being checked. It should not directly import project code or Django into the mypy runtime, so it doesn't get entangled with the code it's checking. Instead it could for example invoke subprocesses to discover Django internals.

The current implementation is problematic for many reasons. For instance mypy shouldn't crash with traceback when there's a syntax error in Django settings. And when using mypy daemon dmypy, it should be capable of re-discovering changed models files, instead of using obsolete state or randomly crashing, as it does now.

Metadata

Metadata

Assignees

No one assigned

    Labels

    discussion neededIssues or PRs that require further discussion or a decision to be madeenhancementNew feature or requestmetaMeta-issues and discussionmypy-pluginIssues specific to mypy_django_plugin

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions