Skip to content

Error in sqlmesh-lsp due to older pygls version #4823

@roee88

Description

@roee88
  File "\.venv\Scripts\sqlmesh_lsp.exe\__main__.py", line 5, in <module>
    from sqlmesh.lsp.main import main
  File "\.venv\Lib\site-packages\sqlmesh\lsp\main.py", line 11, in <module>
    from pygls.server import LanguageServer
  File "\.venv\Lib\site-packages\pygls\server.py", line 29, in <module>
    from lsprotocol.types import (
    ...<6 lines>...
    )
ImportError: cannot import name 'WorkspaceApplyEditResponse' from 'lsprotocol.types' (\.venv\Lib\site-packages\lsprotocol\types.py)

The dependencies of the lsp extra are not pinned to any specific version. A fresh install with uv grabs lsprotocol==2025.0.0 and pygls==1.0.2 and fails with the above. As a workaround I had to uv add --dev pygls -U to upgrade pygls to version 1.3.1. I'm not sure why pygls 1.0.2 is grabbed by default; the dependency tree shows that it comes only from sqlmesh (v0.196.3). Please consider adding a version specifier to pygls and lsprotocol.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions