2024-08-16 23:33:27 +00:00
|
|
|
{
|
|
|
|
lib,
|
2024-10-17 20:05:05 +00:00
|
|
|
python3Packages,
|
2024-08-16 23:33:27 +00:00
|
|
|
fetchFromGitHub,
|
2024-09-06 13:18:28 +00:00
|
|
|
|
2024-10-17 20:05:05 +00:00
|
|
|
# tests
|
|
|
|
versionCheckHook,
|
|
|
|
|
2024-09-06 13:18:28 +00:00
|
|
|
# passthru
|
2024-08-16 23:35:24 +00:00
|
|
|
nix-update-script,
|
2023-02-05 09:41:35 +00:00
|
|
|
}:
|
|
|
|
|
2024-10-17 20:05:05 +00:00
|
|
|
python3Packages.buildPythonApplication rec {
|
2023-02-05 09:41:35 +00:00
|
|
|
pname = "ruff-lsp";
|
2024-10-17 20:05:05 +00:00
|
|
|
version = "0.0.58";
|
2023-09-09 00:46:02 +00:00
|
|
|
pyproject = true;
|
2023-02-05 09:41:35 +00:00
|
|
|
|
2023-08-18 14:15:36 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "astral-sh";
|
|
|
|
repo = "ruff-lsp";
|
2023-11-10 06:58:15 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2024-10-17 20:05:05 +00:00
|
|
|
hash = "sha256-TB4OcKkaUGYAmiGNJRnfRmiXTyTQL4sFoBrzxT6DWec=";
|
2023-02-05 09:41:35 +00:00
|
|
|
};
|
|
|
|
|
2024-10-17 20:05:05 +00:00
|
|
|
build-system = with python3Packages; [ hatchling ];
|
2023-02-05 09:41:35 +00:00
|
|
|
|
2024-10-17 20:05:05 +00:00
|
|
|
dependencies = with python3Packages; [
|
2023-10-06 04:42:47 +00:00
|
|
|
packaging
|
2023-02-05 09:41:35 +00:00
|
|
|
pygls
|
|
|
|
lsprotocol
|
2024-10-23 15:07:41 +00:00
|
|
|
ruff
|
2023-02-05 09:41:35 +00:00
|
|
|
typing-extensions
|
|
|
|
];
|
|
|
|
|
2024-10-17 20:05:05 +00:00
|
|
|
nativeCheckInputs = with python3Packages; [
|
2023-06-17 21:18:28 +00:00
|
|
|
pytestCheckHook
|
2023-06-19 07:03:20 +00:00
|
|
|
pytest-asyncio
|
2023-02-05 09:41:35 +00:00
|
|
|
python-lsp-jsonrpc
|
2024-10-23 15:07:41 +00:00
|
|
|
ruff.bin
|
2024-10-17 20:05:05 +00:00
|
|
|
versionCheckHook
|
2023-02-05 09:41:35 +00:00
|
|
|
];
|
2024-10-17 20:05:05 +00:00
|
|
|
versionCheckProgramArg = [ "--version" ];
|
2023-02-05 09:41:35 +00:00
|
|
|
|
|
|
|
makeWrapperArgs = [
|
|
|
|
# prefer ruff from user's PATH, that's usually desired behavior
|
2024-10-23 15:07:41 +00:00
|
|
|
"--suffix PATH : ${lib.makeBinPath (with python3Packages; [ ruff ])}"
|
2023-06-23 21:11:51 +00:00
|
|
|
# Unset ambient PYTHONPATH in the wrapper, so ruff-lsp only ever runs with
|
|
|
|
# its own, isolated set of dependencies. This works because the correct
|
|
|
|
# PYTHONPATH is set in the Python script, which runs after the wrapper.
|
|
|
|
"--unset PYTHONPATH"
|
2023-02-05 09:41:35 +00:00
|
|
|
];
|
|
|
|
|
2024-08-16 23:35:24 +00:00
|
|
|
passthru = {
|
|
|
|
updateScript = nix-update-script { };
|
|
|
|
};
|
|
|
|
|
2024-06-27 19:37:12 +00:00
|
|
|
meta = {
|
2024-02-02 11:36:43 +00:00
|
|
|
changelog = "https://github.com/astral-sh/ruff-lsp/releases/tag/v${version}";
|
2023-02-05 09:41:35 +00:00
|
|
|
description = "Language Server Protocol implementation for Ruff";
|
2023-06-17 21:18:28 +00:00
|
|
|
homepage = "https://github.com/astral-sh/ruff-lsp";
|
2024-06-27 19:37:12 +00:00
|
|
|
license = lib.licenses.mit;
|
2024-02-02 11:36:43 +00:00
|
|
|
mainProgram = "ruff-lsp";
|
2024-08-16 23:33:27 +00:00
|
|
|
maintainers = with lib.maintainers; [
|
|
|
|
figsoda
|
|
|
|
kalekseev
|
|
|
|
];
|
2023-02-05 09:41:35 +00:00
|
|
|
};
|
|
|
|
}
|