20 buildPythonPackage rec {
21 pname = "python-lsp-black";
25 disabled = pythonOlder "3.8";
27 src = fetchFromGitHub {
29 repo = "python-lsp-black";
31 hash = "sha256-nV6mePSWzfPW2RwXg/mxgzfT9wD95mmTuPnPEro1kEY=";
36 includes a series of patches fixing tests not yet released as 2.0.1+ version
37 they are meant to keep up to date with black releases
39 lib.optional (lib.versionAtLeast black.version "24.2.0") (fetchpatch {
40 url = "https://github.com/python-lsp/python-lsp-black/commit/d43b41431379f9c9bb05fab158c4d97e6d515f8f.patch";
41 hash = "sha256-38bYU27+xtA8Kq3appXTkNnkG5/XgrUJ2nQ5+yuSU2U=";
43 ++ lib.optional (lib.versionAtLeast black.version "24.3.0") (fetchpatch {
44 url = "https://github.com/python-lsp/python-lsp-black/commit/9298585a9d14d25920c33b188d79e820dc98d4a9.patch";
45 hash = "sha256-4u0VIS7eidVEiKRW2wc8lJVkJwhzJD/M+uuqmTtiZ7E=";
48 build-system = [ setuptools ];
53 ] ++ lib.optionals (pythonOlder "3.11") [ tomli ];
55 pythonImportsCheck = [ "pylsp_black" ];
57 nativeCheckInputs = [ pytestCheckHook ];
60 homepage = "https://github.com/python-lsp/python-lsp-black";
61 description = "Black plugin for the Python LSP Server";
62 changelog = "https://github.com/python-lsp/python-lsp-black/releases/tag/v${version}";
63 license = lib.licenses.mit;
64 maintainers = with lib.maintainers; [ cpcloud ];