2023-04-29 16:46:19 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, pythonOlder
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchPypi
|
|
|
|
, ruff
|
|
|
|
, pygls
|
|
|
|
, lsprotocol
|
|
|
|
, hatchling
|
|
|
|
, typing-extensions
|
|
|
|
, unittestCheckHook
|
|
|
|
, python-lsp-jsonrpc
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "ruff-lsp";
|
2023-05-24 13:37:59 +00:00
|
|
|
version = "0.0.27";
|
2023-04-29 16:46:19 +00:00
|
|
|
format = "pyproject";
|
|
|
|
disabled = pythonOlder "3.7";
|
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit version;
|
|
|
|
pname = "ruff_lsp";
|
2023-05-24 13:37:59 +00:00
|
|
|
hash = "sha256-Mp5PX87UFUADl/INxZptTsHUBxNpaSRqdsPgRNnLCaQ=";
|
2023-04-29 16:46:19 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
# ruff binary added to PATH in wrapper so it's not needed
|
|
|
|
sed -i '/"ruff>=/d' pyproject.toml
|
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
hatchling
|
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
pygls
|
|
|
|
lsprotocol
|
|
|
|
typing-extensions
|
|
|
|
];
|
|
|
|
|
|
|
|
doCheck = stdenv.isDarwin;
|
|
|
|
|
|
|
|
nativeCheckInputs = [
|
|
|
|
unittestCheckHook
|
|
|
|
python-lsp-jsonrpc
|
|
|
|
ruff
|
|
|
|
];
|
|
|
|
|
|
|
|
makeWrapperArgs = [
|
|
|
|
# prefer ruff from user's PATH, that's usually desired behavior
|
|
|
|
"--suffix PATH : ${lib.makeBinPath [ ruff ]}"
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://github.com/charliermarsh/ruff-lsp";
|
|
|
|
description = "A Language Server Protocol implementation for Ruff";
|
|
|
|
changelog = "https://github.com/charliermarsh/ruff-lsp/releases/tag/v${version}";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ kalekseev ];
|
|
|
|
};
|
|
|
|
}
|