limo: 1.0.11 > 1.1 (#376325)
[NixPkgs.git] / pkgs / development / python-modules / python-lsp-black / default.nix
blob8286298f53087a4e1b37e54a2506e1b55778a71c
2   lib,
3   buildPythonPackage,
4   pythonOlder,
5   fetchFromGitHub,
6   black,
7   fetchpatch,
9   # build-system
10   setuptools,
12   # dependencies
13   python-lsp-server,
14   tomli,
16   # checks
17   pytestCheckHook,
20 buildPythonPackage rec {
21   pname = "python-lsp-black";
22   version = "2.0.0";
23   pyproject = true;
25   disabled = pythonOlder "3.8";
27   src = fetchFromGitHub {
28     owner = "python-lsp";
29     repo = "python-lsp-black";
30     tag = "v${version}";
31     hash = "sha256-nV6mePSWzfPW2RwXg/mxgzfT9wD95mmTuPnPEro1kEY=";
32   };
34   patches =
35     /**
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
38     */
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=";
42     })
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=";
46     });
48   build-system = [ setuptools ];
50   dependencies = [
51     black
52     python-lsp-server
53   ] ++ lib.optionals (pythonOlder "3.11") [ tomli ];
55   pythonImportsCheck = [ "pylsp_black" ];
57   nativeCheckInputs = [ pytestCheckHook ];
59   meta = {
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 ];
65   };