Installation¶
You can install zuban by using:
pip install zuban --break-system-packages --upgrade
Using --break-system-packages should not pose any issues, as no
third-party Python packages are actually installed.
After installation, two executables will be available:
zuban- Usezuban checkfor type checking andzuban serverfor the Language Server Protocol (LSP)zmypy- An alias forzuban mypythat is compatible with Mypy usage (e.g.,zmypy --strict)
Installing the Language Server is straightforward. In most editors, you can
configure zuban directly as the Language Server executable. Here are
example configs for some IDE’s/Editors.
VSCode¶
Note
You must install Zuban separately via pip before using the extension.
Install the extension from the Visual Studio Marketplace.
If you’re using a virtual environment, make sure to activate it and start Zuban from the corresponding directory. VSCode integration is limited for now, but future updates will aim to support virtual environment selection within the editor.
VIM¶
After installing Zuban, add LSP support using vim-lsp:
au User lsp_setup call lsp#register_server({
\ 'name': 'Zuban',
\ 'cmd': ['zuban', 'server'],
\ 'allowlist': ['python'],
\ })
Neovim¶
After installing Zuban, add LSP support using neovim-lsp:
vim.lsp.config('zubanls', {
name = "ZubanLS",
cmd = { "zuban", "server" },
root_markers = { "pyproject.toml", ".git" },
filetypes = { "python" },
})
vim.lsp.enable("zubanls")
Helix¶
After installing Zuban, add the following to languages.toml:
[[language]]
name = "python"
language-servers = ["zuban"]
[language-server.zuban]
command = "zuban"
args = ["server"]
Zed¶
You should probably try this unofficial extension here.
Emacs¶
After installing Zuban, add LSP support using eglot:
(use-package eglot
:config
(add-to-list 'eglot-server-programs
'((python-mode python-ts-mode) . ("zubanls"))))
Kate¶
After installing Zuban, add the following to
LSP Client -> User Server Settings:
{
"servers": {
"python": {
"command": ["zubanls"],
"url": "https://github.com/zubanls/zuban",
"highlightingModeRegex": "^Python$"
}
}
}
Sublime Text¶
After installing Zuban and the Sublime-LSP package, update the LSP.sublime-settings with the following snippet:
{
"clients": {
"zuban": {
"enabled": true,
"command": ["uvx", "zuban@latest", "server"],
"selector": "source.python, text.shebang"
}
}
}
Note the above makes use of uvx
for managing and running Zuban. Should you wish to not use uv, adjust the command
to point to the Zuban CLI.