depot/third_party/nixpkgs/pkgs/development/python-modules/python-lsp-black/default.nix
Default email e7ec2969af Project import generated by Copybara.
GitOrigin-RevId: 9b19f5e77dd906cb52dade0b7bd280339d2a1f3d
2024-01-13 09:15:51 +01:00

49 lines
1 KiB
Nix

{ lib
, pythonOlder
, buildPythonPackage
, fetchFromGitHub
, pytestCheckHook
, black
, python-lsp-server
, setuptools
, tomli
}:
buildPythonPackage rec {
pname = "python-lsp-black";
version = "2.0.0";
pyproject = true;
disabled = pythonOlder "3.8";
src = fetchFromGitHub {
owner = "python-lsp";
repo = "python-lsp-black";
rev = "refs/tags/v${version}";
hash = "sha256-nV6mePSWzfPW2RwXg/mxgzfT9wD95mmTuPnPEro1kEY=";
};
nativeBuildInputs = [
setuptools
];
nativeCheckInputs = [ pytestCheckHook ];
propagatedBuildInputs = [
black
python-lsp-server
] ++ lib.optionals (pythonOlder "3.11") [
tomli
];
pythonImportsCheck = [
"pylsp_black"
];
meta = with lib; {
homepage = "https://github.com/python-lsp/python-lsp-black";
description = "Black plugin for the Python LSP Server";
changelog = "https://github.com/python-lsp/python-lsp-black/blob/${src.rev}/CHANGELOG.md";
license = licenses.mit;
maintainers = with maintainers; [ cpcloud ];
};
}