2021-07-24 12:14:16 +00:00
|
|
|
{ lib
|
2022-05-18 14:49:53 +00:00
|
|
|
, pythonOlder
|
2021-07-24 12:14:16 +00:00
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, pytestCheckHook
|
2022-05-18 14:49:53 +00:00
|
|
|
, black
|
2021-07-24 12:14:16 +00:00
|
|
|
, python-lsp-server
|
2024-01-13 08:15:51 +00:00
|
|
|
, setuptools
|
|
|
|
, tomli
|
2021-07-24 12:14:16 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "python-lsp-black";
|
2024-01-13 08:15:51 +00:00
|
|
|
version = "2.0.0";
|
|
|
|
pyproject = true;
|
|
|
|
disabled = pythonOlder "3.8";
|
2021-07-24 12:14:16 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "python-lsp";
|
|
|
|
repo = "python-lsp-black";
|
2023-07-15 17:15:38 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2024-01-13 08:15:51 +00:00
|
|
|
hash = "sha256-nV6mePSWzfPW2RwXg/mxgzfT9wD95mmTuPnPEro1kEY=";
|
2021-07-24 12:14:16 +00:00
|
|
|
};
|
|
|
|
|
2024-01-13 08:15:51 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
setuptools
|
|
|
|
];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [ pytestCheckHook ];
|
2021-07-24 12:14:16 +00:00
|
|
|
|
2024-01-13 08:15:51 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
black
|
|
|
|
python-lsp-server
|
|
|
|
] ++ lib.optionals (pythonOlder "3.11") [
|
|
|
|
tomli
|
|
|
|
];
|
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"pylsp_black"
|
|
|
|
];
|
2021-07-24 12:14:16 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://github.com/python-lsp/python-lsp-black";
|
|
|
|
description = "Black plugin for the Python LSP Server";
|
2024-01-13 08:15:51 +00:00
|
|
|
changelog = "https://github.com/python-lsp/python-lsp-black/blob/${src.rev}/CHANGELOG.md";
|
2021-07-24 12:14:16 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ cpcloud ];
|
|
|
|
};
|
|
|
|
}
|