Registry / testing / python-lsp-black

python-lsp-black

JSON →
library2.0.0pypypiunverified

A Black plugin for the Python LSP Server (python-lsp-server). Formats Python code using Black on save or on demand. Current version 2.0.0 requires python-lsp-server and Black >= 23.11.0. Initial release cadence was ~yearly, now slower.

pip install python-lsp-black
INSTALL
IMPORT
SIG · PYTHON-LSP-BLACK
P
python-lsp-black
testingpythonv2.0.0
Install
3.6s avg
Import
Disk
39MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v2.0.0 · 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.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 39.8MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 3.6s · import 0.000s · 41MB
39MB installed
● package 39MB
Code
Verified usage

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

plugin
No import needed; auto-loaded via entry point
Plugin is auto-discovered by python-lsp-server when installed. Do not import directly.

After installation, black formatting is available. No explicit import needed.

# Ensure python-lsp-server and python-lsp-black are installed # Then, in your editor with LSP client configured for pylsp, # Black formatting should work automatically. # You can configure via pylsp settings, e.g.: # pylsp.plugins.black.line_length = 88
Debug
Known issues
breakingEntrypoint name changed from 'pylsp_black' to 'black' in v2.0.0. Existing configuration using 'pylsp.plugins.pylsp_black' must be updated to 'pylsp.plugins.black'.
fix
In your LSP configuration, change 'pylsp.plugins.pylsp_black' to 'pylsp.plugins.black'.
affects: <2.0.0 -> >=2.0.0
gotchaThis plugin automatically disables autopep8 and yapf formatters to avoid conflicts. If you need those, remove python-lsp-black or configure pylsp to re-enable them manually.
fix
Set pylsp.plugins.autopep8.enabled = True and pylsp.plugins.yapf.enabled = True in your config after installing python-lsp-black (not recommended).
affects: >=1.2.1
gotchaPython 3.7 support dropped in v2.0.0.
fix
Use Python 3.8 or later, or pin to python-lsp-black <2.0.0 (last 1.3.0).
affects: >=2.0.0
Upgrade
Version history
2.0.0latest on PyPI · released Dec 19, 2023
Audit
Dependencies
python-lsp-serverrequiredCore LSP server this plugin extends
blackrequiredThe formatter engine; requires >= 23.11.0 for v2.0.0
Agent activity
13 hits · last 30 days
node
10
Resources
python-lsp-black — pip install python-lsp-black · libregistry