Skip to content

feature request: dmypy/mypy lsp support (python) #2318

Closed

Description

@nathan-gage

For code bases which make heavy use of static typing, pyright is often insufficient/behaves differently than mypy linting.

Activity

  1. github-actions commented on Aug 29, 2025

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    Feel free to ignore if none of these address your specific case.

  2. mjbommar commented on Aug 31, 2025

    @mjbommar

    +1 to supporting ty/ruff as well. The worst part about my opencode experience has been pyright causing crashes.

  3. rekram1-node commented on Aug 31, 2025

    @rekram1-node
    Collaborator

    pyright causing crashes? what is it doing for you? Eating all your memory?

  4. mjbommar commented on Aug 31, 2025

    @mjbommar

    pyright causing crashes? what is it doing for you? Eating all your memory?

    Normally yes, but today, it was 99% CPU and never returning (on node 24). Appreciate you are not here to debug pyright hogging resources generally.

  5. AndBoyS commented on Nov 25, 2025

    @AndBoyS

    Here's my opencode.json for ruff and mypy (using uv, if you use pip just remove uv run).
    You need python-lsp-server and pylsp-mypy packages intalled for mypy (and probably [tool.pylsp-mypy] enabled = true live_mode = true in pyproject.toml)

    {
      "$schema": "https://opencode.ai/config.json",
      "lsp": {
        "mypy": {
          "command": [
            "uv",
            "run",
            "pylsp",
          ],
          "extensions": [
            ".py",
            ".pyi"
          ]
        },
        "ruff": {
          "command": [
            "uv",
            "run",
            "ruff",
            "server",
          ],
          "extensions": [
            ".py",
            ".pyi"
          ]
        }
      }
    }
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions