Registry / testing / pylsp-mypy

pylsp-mypy

JSON →
library0.7.1pypypiunverified

pylsp-mypy is a plugin for the Python LSP Server that integrates Mypy for static type checking. It provides live diagnostics as you type or on file save. The library is currently at version 0.7.1 and maintains an active release cadence, frequently updating to support new `mypy` and `python-lsp-server` features and bug fixes.

pip install pylsp-mypy
INSTALL
IMPORT
SIG · PYLSP-MYPY
P
pylsp-mypy
testingpythonv0.7.1
Install
5.4s avg
Import
Disk
102MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.7.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.920 runs
installs and imports cleanly · install 0.0s · import 0.000s · 102.8MB
glibc
py 3.103.920 runs
installs and imports cleanly · install 5.4s · import 0.000s · 102MB
102MB installed
● package 102MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

pylsp-mypy
This library is a plugin and is not typically imported directly in user code. It is loaded and configured by the Python LSP Server.
pylsp-mypy functions as an extension to the Python LSP Server. Its features are enabled and configured via the LSP client's settings or a `pyproject.toml` file, rather than direct Python imports.

To use `pylsp-mypy`, install it alongside `python-lsp-server` and `mypy` in your development environment. Configuration is typically done via a `[tool.pylsp-mypy]` section in your `pyproject.toml` file, where you can enable it, set `live_mode` for as-you-type checks, and enable `strict` Mypy rules.

# 1. Install pylsp-mypy (and python-lsp-server) in your project's virtual environment: pip install python-lsp-server pylsp-mypy mypy # 2. Add or update your pyproject.toml to enable and configure pylsp-mypy: # (This example enables live mode and strict checking) # [tool.pylsp-mypy] # enabled = true # live_mode = true # strict = true # exclude = ["tests/*"] # 3. Open a Python file in your LSP-compatible editor (e.g., VS Code, Neovim, Emacs) # The LSP server will automatically detect and load pylsp-mypy for type checking.
Debug
Known issues
breakingPython 3.10 is now the minimum required Python version.
fix
Ensure your development environment and `python-lsp-server` run on Python 3.10 or newer. If you are on an older Python version, you must use an earlier `pylsp-mypy` version (e.g., 0.6.x supports Python 3.8+).
affects: 0.7.0 and later
gotchaEnabling `dmypy` (daemon mode) currently disables `live_mode`.
fix
If you want real-time type checking as you type, keep `dmypy = false` (the default) and `live_mode = true`. If you prioritize faster checks on save for large projects, set `dmypy = true` and accept that `live_mode` will be implicitly disabled.
affects: All versions
gotchaDefault `--follow-imports silent` can invalidate `mypy`'s cache.
fix
The default `pylsp-mypy` invocation of `mypy` uses `--follow-imports silent`. If you run `mypy` from the command line with its default `--follow-imports normal`, this mismatch will cause `mypy`'s cache to be invalidated, slowing down subsequent runs. To prevent this, either configure `[tool.pylsp-mypy] overrides = [true, '--follow-imports', 'normal']` or set `[tool.mypy] follow_imports = 'silent'` in your `pyproject.toml`.
affects: All versions
gotchaUsing `mypy_command` or `dmypy_command` requires an explicit environment variable for security reasons.
fix
If you customize the `mypy_command` or `dmypy_command` to run `mypy` from a specific virtual environment or using a wrapper (e.g., `poetry run mypy`), you must set the environment variable `PYLSP_MYPY_ALLOW_DANGEROUS_CODE_EXECUTION`. This is a security measure to prevent arbitrary code execution from potentially malicious project configurations.
affects: All versions
Upgrade
Version history
0.7.1latest on PyPI · released Feb 2, 2026
Audit
Dependencies
python-lsp-serverrequiredpylsp-mypy is a plugin for the Python LSP Server, which must be installed in the same virtual environment.
mypyrequiredProvides the core static type checking functionality that pylsp-mypy integrates.
tomlioptionalUsed for parsing `pyproject.toml` configuration files.
fastjsonschemaoptionalOften a dependency for validating `pyproject.toml` configuration, sometimes causing build issues with older versions.
Agent activity
7 hits · last 30 days
node
6
Resources
pylsp-mypy — pip install pylsp-mypy · libregistry